Skip to content

Honor build-script execution constraints in compilation and run actions - #4270

Merged
UebelAndre merged 2 commits into
bazelbuild:mainfrom
jrandolf:codex/build-script-execution-constraints
Sep 27, 2026
Merged

UebelAndre merged 2 commits into
bazelbuild:mainfrom
jrandolf:codex/build-script-execution-constraints

Conversation

@jrandolf

@jrandolf jrandolf commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

cargo_build_script(exec_compatible_with = ...) currently constrains the generated script target but not both actions that compile and run it. A build script can therefore be scheduled on an execution platform that the caller explicitly excluded.

Apply the constraint to the generated Rust binary and the build-script run target. The analysis regression checks both stages and fails when either propagation is removed.

Verification: //cargo/tests/cargo_build_script/compatible_with:exec_constraints_test and the owning build-script test suite pass on macOS. Buildifier and git diff --check pass.

Apply exec_compatible_with to both the build-script compiler action and the action that runs the script. A regression guard checks the macro expansion for both stages.

Assisted-by: OpenAI Codex
@jrandolf
jrandolf force-pushed the codex/build-script-execution-constraints branch from 816aefb to 94f6ca8 Compare September 24, 2026 18:14

@UebelAndre UebelAndre left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@UebelAndre
UebelAndre added this pull request to the merge queue Sep 27, 2026
Merged via the queue into bazelbuild:main with commit e995f47 Sep 27, 2026
3 checks passed
@jrandolf
jrandolf deleted the codex/build-script-execution-constraints branch September 27, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants