Generate only the needed subset of binaries for bindgen and proto #1751
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.
This removes, for example, the
protobuf-bin-gen-rust-do-not-use
binary that was previously getting exposed.rules_rust/proto/3rdparty/crates/BUILD.bazel
Lines 77 to 81 in d6e3003
I had to change
impl Add for CrateAnnotations
to make crate-levelgen_binaries
work. It turns out in #1718 I didn't fully understand what thisAdd
impl was supposed to do, and I had only testedgen_binaries
before adding the global-levelgenerate_binaries
argument (#1718 (comment)). (I'm still not sure that I understand what thisAdd
is supposed to do exactly, but at least now it appears to work in practice.)The behavior I observed before the change in this PR was that global-level
generate_binaries = True
would do the right thing but crate-levelgen_binaries
would seem to get ignored whether or not global-levelgenerate_binaries
was set.