commit | 3e8bef930da69af11405e92b8df86d1fa6f7e6a7 | [log] [tgz] |
---|---|---|
author | Kesavan Yogeswaran <hikes@google.com> | Thu Mar 28 16:38:24 2024 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Mar 28 16:38:24 2024 +0000 |
tree | 91c386e511b0c20a71f76393b31d9e40c5be85ea | |
parent | 6d7b236a2fe4be187892a6541a156510142a56af [diff] |
nanopb: Fix nanopb_pb2.py generation Since nanopb 0.4.7, importing nanopb/generator/proto/__init__.py is not sufficient to generate nanopb_pb2.py. The more robust way to generate this file across nanopb versions is to import nanopb_generator.py. This approach works with nanopb versions >=0.4.1, and the existing Pigweed build infrastructure does not work with nanopb versions prior to 0.4.2. Add an assert to check that the file is actually generated so that we can catch this error in the future if a future version of nanopb breaks this script. Test: Ran generate_nanopb_proto.py in a project with various versions of nanopb (0.4.1, 0.4.2, 0.4.6, 0.4.8) and confirmed that nanopb_pb2. was generated. Change-Id: Ia39c60ae202fc1f0ff5da4221e983fcdf20e3c5e Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/200772 Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Armando Montanez <amontanez@google.com> Commit-Queue: Kesavan Yogeswaran <hikes@google.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.