Add 'build_script_exec_properties' to 'crate.annotation'#3852
Merged
illicitonion merged 2 commits intobazelbuild:mainfrom Feb 19, 2026
Merged
Add 'build_script_exec_properties' to 'crate.annotation'#3852illicitonion merged 2 commits intobazelbuild:mainfrom
illicitonion merged 2 commits intobazelbuild:mainfrom
Conversation
Contributor
Author
|
Edit: It seems like running |
illicitonion
approved these changes
Feb 19, 2026
Collaborator
illicitonion
left a comment
There was a problem hiding this comment.
Looks reasonable, thanks!
dzbarsky
pushed a commit
to hermeticbuild/rules_rust
that referenced
this pull request
Feb 20, 2026
…3852) ## Intent To allow specifying [`exec_properties`](https://bazel.build/reference/be/common-definitions#common.exec_properties) via [`crate.annotation`](https://bazelbuild.github.io/rules_rust/crate_universe_bzlmod.html#annotation). ## Problem The current implementation allows tweaking a few of the attributes that get generated for the `cargo_build_script` rule, but, unfortunately, not the `exec_properties`. My current use case for which I want to be able to specify `exec_properties` is a semi-large build script that gets performance benefits from running on machines with multiple CPUs. If you are not using remote execution, it essentially boils down to whatever hardware you have available locally. However, if RBE is available, being able to set `exec_properties = {"Pool": "<pool-with-powerful-hardware>"}` allows you to specifically steer these build actions to the machines that you want to run them on. ## Solution To extend the current `cargo-bazel` code along with the relevant Starlark code to make it possible to specify `exec_properties` for the generated `cargo_build_script` rules.
1 task
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.
Intent
To allow specifying
exec_propertiesviacrate.annotation.Problem
The current implementation allows tweaking a few of the attributes that get generated for the
cargo_build_scriptrule, but, unfortunately, not theexec_properties.My current use case for which I want to be able to specify
exec_propertiesis a semi-large build script that gets performance benefits from running on machines with multiple CPUs. If you are not using remote execution, it essentially boils down to whatever hardware you have available locally. However, if RBE is available, being able to setexec_properties = {"Pool": "<pool-with-powerful-hardware>"}allows you to specifically steer these build actions to the machines that you want to run them on.Solution
To extend the current
cargo-bazelcode along with the relevant Starlark code to make it possible to specifyexec_propertiesfor the generatedcargo_build_scriptrules.