mlot / nanopb

Automatically exported from code.google.com/p/nanopb
zlib License
0 stars 0 forks source link

master fails test alltypes with protobuf 2.5.0 #150

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. install on ubuntu and test:
    $ git clone https://code.google.com/p/nanopb/ 
    $ sudo apt-get install scons  protobuf-compiler python-protobuf     
    $ cd nanopb/tests
    $ scons

Output:
scons: Reading SConscript files ...
scons: *** (<class 'nanopb.NanopbWarning'>, 'Could not find the protoc 
compiler')  Stop.
dan@l1:~/nanopb/tests$ cd ..
dan@l1:~/nanopb$ less README.txt 
dan@l1:~/nanopb$ less tests/build/alltypes/alltypes.proto 
dan@l1:~/nanopb$ man less
dan@l1:~/nanopb$ man less
dan@l1:~/nanopb$ less tests/build/alltypes/alltypes.proto 
dan@l1:~/nanopb$ cd tests
dan@l1:~/nanopb/tests$ scons
scons: Reading SConscript files ...
Checking for C header file stdbool.h... (cached) yes
Checking for C header file stdint.h... (cached) yes
Checking for C header file stddef.h... (cached) yes
Checking for C header file string.h... (cached) yes
Checking for C header file stdlib.h... (cached) yes
Checking for C library mudflap... (cached) no
Checking support for CCFLAGS="-Wcast-qual -Wlogical-op -Wconversion 
-fstrict-aliasing -Wstrict-aliasing=1 -Wmissing-prototypes 
-Wmissing-declarations -Wredundant-decls -Wstack-protector "... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
"/usr/bin/protoc" 
"--plugin=protoc-gen-nanopb=/home/dan/nanopb/generator/protoc-gen-nanopb" -I"." 
-I"/home/dan/nanopb/generator/proto" -I"/home/dan/nanopb/generator" 
-I"/usr/include" --nanopb_out=. "build/alltypes/alltypes.proto"
build/alltypes/alltypes.proto:104:5: Expected "required", "optional", or 
"repeated".
build/alltypes/alltypes.proto:105:5: Missing field number.
scons: *** [build/alltypes/alltypes.pb.c] Error 1
scons: building terminated because of errors.

What is the expected output? What do you see instead?
I see errors instead of no errors.

What version of the product are you using? On what operating system?
Ubuntu 14.04
nanopb master branch

Please provide any additional information below.

Original issue reported on code.google.com by dpa...@gmail.com on 19 Mar 2015 at 9:05

GoogleCodeExporter commented 9 years ago
The version from github (https://github.com/metormote/nanopb) runs the tests ok.

Original comment by dpa...@gmail.com on 20 Mar 2015 at 1:50

GoogleCodeExporter commented 9 years ago
The error comes from the 'oneof' directive:
https://code.google.com/p/nanopb/source/browse/tests/alltypes/alltypes.proto#104

The protoc version in Ubuntu 14.04 is 2.5, which is too old to support the 
latest protobuf features. Version 2.6 is needed. The new features are used (and 
tested) in nanopb test cases. Unfortunately it is not easy to make the test 
cases run for older versions.

However, you should be able to use nanopb just fine even with protobuf-compiler 
2.5, except oneofs.

Original comment by Petteri.Aimonen on 20 Mar 2015 at 6:14