The internal design is consistent with other <lang>_proto_library rules. rust_proto_library attaches rust_proto_library_aspect on its `deps` attribute. The aspect traverses the dependency, and when it visits proto_library (detected by ProtoInfo provider) it registers 2 actions:
1) to run protoc with Rust backend to emit gencode
2) to compile the gencode using Rustc
Action (2) gets the Rust proto runtime as an input as well.
Coming in a followup is support and test coverage for proto_library.deps.
PiperOrigin-RevId: 514521285
At the time the way of marking some stuff `deprecated` is overcomplicated taken into account that protobuf mandates C++11 to be built.
Particularly, PROTOBUF_DEPRECATED_ENUM references gcc-6 release notes and the compiler is almost 4.5 years old as of today.
I believe it should be possible to simplify the definitions.
Closes#12026
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12026 from georgthegreat:deprecated 536c3c9ff7
PiperOrigin-RevId: 514480030
For now, this only covers linux on the two architectures we have testing support for. However, it serves as a good sanity check and can be expanded in the future.
PiperOrigin-RevId: 514449399
We have an obscure bug where packed-by-default repeated custom options defined
in proto3 files are not correctly treated as packed when dynamic extensions are
used. This CL introduces a simple fix and adds a test verifying the correct
behavior.
The bug was not a major problem in most cases, since parsers will accept both
the packed and unpacked encodings. It is useful to fix this to ensure that
descriptors are serialized in a consistent way, though.
PiperOrigin-RevId: 513249881
Fixes#12081.
The issue was the call to `MaybeDetachComment`: the conditional assumed that there was a next token, which was on the same line as the previous one, making attribution unclear. However, if there is no next token, we should not detach.
The actual fix is a one-liner. The rest of this PR is updates to the tests to verify this behavior under a handful of scenarios.
Closes#12082
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12082 from jhump:jh/fix-trailing-comment-attribution 767e41cb05
PiperOrigin-RevId: 513046172