Conversation
When gazelle:proto file mode generates per-file proto_library rules, plugins that produce package-level outputs (e.g. protoc-gen-prost) cause conflicting Bazel actions since multiple proto_compile rules try to declare the same output file. This adds automatic merging: when proto_compile detects overlapping outputs with an existing rule in the same package, it merges them into a single rule using a new "protos" (label_list) attribute instead of the singular "proto" attribute. Changes: - proto_compile.bzl: add "protos" attr, support multiple ProtoInfo providers, make "proto" non-mandatory - proto_compile.go: add Rule(otherGen) merge logic following the existing go_library aggregation pattern - proto_compile_test.go: unit tests for overlap detection and end-to-end aggregation via ExamplePackage_aggregation
…onic plugins Implements a Go-based proto_rust_library rule and three protoc-gen-* Go plugins (prost, prost-serde, tonic) so Rust codegen participates in dependency resolution instead of relying on starlark plugins. Adds proto_compile rule merging for package-level plugins whose outputs overlap across proto_libraries, and a Rust keyword escape utility (r# prefix) for proto packages whose segments collide with Rust reserved words (e.g. google.type → google/r#type).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements a Go-based proto_rust_library rule and three protoc-gen-* Go plugins
(prost, prost-serde, tonic) so Rust codegen participates in dependency
resolution instead of relying on starlark plugins. Adds proto_compile rule
merging for package-level plugins whose outputs overlap across proto_libraries,
and a Rust keyword escape utility (r# prefix) for proto packages whose
segments collide with Rust reserved words (e.g. google.type → google/r#type).