)]}' { "commit": "0da1c61e72fbaf8db658ae520097be146b1701c1", "tree": "e3589b9b6a54c19d52b0d7428e0d392b9ca3d677", "parents": [ "192907f11d0b5b07e51d648a62ccde44304c3a96" ], "author": { "name": "Tom Craig", "email": "tommycraig@gmail.com", "time": "Wed Jan 25 05:24:06 2023 +0000" }, "committer": { "name": "CQ Bot Account", "email": "pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com", "time": "Wed Jan 25 05:24:06 2023 +0000" }, "message": "pw_protobuf: Codegen kConstantCase field enums\n\npw_protobuf generated code includes an \"enum class Fields : uint32_t\"\ntype in in message, with values equal to the IDs for each field in the\nmessage.\n\nUnfortunately, the existing generated code uses SNAKE_CASE for the\nnames, rather than kConstantCase. In addition to be against the\nstyle guide, this makes collisions with legacy C macros much more\nlikely.\n\nIndeed, I ran into this issue due to a naming collison on OUTPUT_TYPE\nbetween stm32cube.h and descriptor.pwpb.h. Of course, ST deserves\nsignificant blame here for using inadequately namespaced global\nidentifiers... it\u0027s not just pw_protobuf\u0027s fault for not using\nkConstantCase.\n\nThis commit does not yet migrate pigweed code to use the kConstantCase\nvalues, that will be in an immediate follow-on. However, this commit\nDOES add a GN variable to control generation of the legacy\nnames (in addition to new names):\n pw_protobuf_compiler_GENERATE_LEGACY_ENUM_SNAKE_CASE_NAMES\n\nThis currently defaults to true, but will change to default to false\nafter the follow-on commit which migrates upstream pigweed away from\nSNAKE_CASE. That will have to be done by an upstream pigweed developer.\n\nBug: b/266298474\nChange-Id: I460a7d203905d39d234d3bf1a7621b52b188c109\nReviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/126804\nCommit-Queue: Wyatt Hepler \u003chepler@google.com\u003e\nReviewed-by: Wyatt Hepler \u003chepler@google.com\u003e\n", "tree_diff": [ { "type": "modify", "old_id": "7ebfb14293cc6bd4f686d8c626a8a5de578db1df", "old_mode": 33188, "old_path": "pw_protobuf/docs.rst", "new_id": "2bbcda382b8e07bd60accf35411b0449241f230b", "new_mode": 33188, "new_path": "pw_protobuf/docs.rst" }, { "type": "modify", "old_id": "2a3346b53ed62826ef78dbd5afd08c312f1582a4", "old_mode": 33188, "old_path": "pw_protobuf/py/pw_protobuf/codegen_pwpb.py", "new_id": "d5eadaa457f740d016b3b4b945e46c3fde97cf07", "new_mode": 33188, "new_path": "pw_protobuf/py/pw_protobuf/codegen_pwpb.py" }, { "type": "modify", "old_id": "9315b76d19e5b32144b0c684e9464078fa2d62f5", "old_mode": 33261, "old_path": "pw_protobuf/py/pw_protobuf/plugin.py", "new_id": "bc3c405ec783dde63d47eabd1a6669f753cae811", "new_mode": 33261, "new_path": "pw_protobuf/py/pw_protobuf/plugin.py" }, { "type": "modify", "old_id": "44c880460dcde17d48cfd860ccacfce9d4b5cb87", "old_mode": 33188, "old_path": "pw_protobuf/py/pw_protobuf/proto_tree.py", "new_id": "15bfb732a9f7f20dfa78922ef03acdb28c349d8a", "new_mode": 33188, "new_path": "pw_protobuf/py/pw_protobuf/proto_tree.py" }, { "type": "modify", "old_id": "8a6977086fbfe1e7e9190578485848a468363c6a", "old_mode": 33188, "old_path": "pw_protobuf_compiler/proto.gni", "new_id": "8a628010c2fe577036a398cfa5478a32f57bceeb", "new_mode": 33188, "new_path": "pw_protobuf_compiler/proto.gni" }, { "type": "modify", "old_id": "a87dcdaaee288c394c820bab23f747f9d5b0b8f0", "old_mode": 33188, "old_path": "pw_protobuf_compiler/py/pw_protobuf_compiler/generate_protos.py", "new_id": "95e260527585ad407777d6f09f8999e6bef75678", "new_mode": 33188, "new_path": "pw_protobuf_compiler/py/pw_protobuf_compiler/generate_protos.py" }, { "type": "modify", "old_id": "606e69d3957c9ab84acb2129e9ba51dde0a9bddf", "old_mode": 33188, "old_path": "pw_protobuf_compiler/toolchain.gni", "new_id": "806a96367dfb94935d0ad3cbf278b9886a101471", "new_mode": 33188, "new_path": "pw_protobuf_compiler/toolchain.gni" } ] }