Page MenuHomePhabricator

protobuf is missing from nanapob python dependencies.
Closed, ResolvedPublic


The nanopb requirements file (external/nanopb/requirements.txt) does not captures an exact version of the "protobuf" package. As a result newer version may get installed (i.e. 3.15.6) which makes the build fail.

A fix is needed which adds:
protobuf==3.15.2 .

Example build error:

Traceback (most recent call last):
  File "/home/vagrant/src/trusted-services/tools/b-test/build-crypto-optee-arm/_deps/nanopb-src/generator/", line 50, in <module>
    from .proto import nanopb_pb2
ImportError: attempted relative import with no known parent package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vagrant/src/trusted-services/tools/b-test/build-crypto-optee-arm/_deps/nanopb-src/generator/protoc", line 6, in <module>
    from nanopb_generator import invoke_protoc
  File "/home/vagrant/src/trusted-services/tools/b-test/build-crypto-optee-arm/_deps/nanopb-src/generator/", line 71, in <module>
    import proto.nanopb_pb2 as nanopb_pb2
  File "/home/vagrant/src/trusted-services/tools/b-test/build-crypto-optee-arm/_deps/nanopb-src/generator/proto/", line 9, in <module>
    from google.protobuf import symbol_database as _symbol_database
  File "/home/vagrant/ts-venv/lib/python3.6/site-packages/google/protobuf/", line 189, in <module>
    _DEFAULT = SymbolDatabase(pool=descriptor_pool.Default())
AttributeError: module 'google.protobuf.descriptor_pool' has no attribute 'Default'
CMakeFiles/ recipe for target '' failed
make[2]: *** [] Error 1
CMakeFiles/Makefile2:96: recipe for target 'CMakeFiles/' failed
make[1]: *** [CMakeFiles/] Error 2
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2