Repository navigation
Conversation
jrandolf
force-pushed
the
fix/build-script-tool-inputs
branch
from
October 3, 2026 06:12
6e4b271 to
7353c37
Compare
krasimirgg
requested changes
Oct 22, 2026
Collaborator
There was a problem hiding this comment.
Thank you!
I've got a suggestion for simplifying the manual tool_files extraction and tools = depset(...) addition, shared in inline comments.
Putting tool artifacts into a depset[File] strips FilesToRunProvider for runfiles support and fails to materialize <tool>.runfiles/ (RunfilesTreeArtifact) in the sandbox, instead scattering the tool's runfiles at bare execroot paths. I suggested changes along these lines to the fix and tests, please let me know if the use case you have in mind for this fix doesn't match my thoughts. (see also #4040)
jrandolf
force-pushed
the
fix/build-script-tool-inputs
branch
from
October 29, 2026 23:14
7f2ed5b to
1e96caa
Compare
Contributor
Author
|
@krasimirgg Done |
Pass declared tools as FilesToRunProvider values to the build-script action. Replace the generated-tool fixture with a Rust binary that reads generated runtime data through its own runfiles, covering the ordinary macro and incoming-transition cases. Use the default build-setting scope for Bazel 7.4.1 compatibility and simplify the fixture executable extension handling. Assisted-by: OpenAI Codex
jrandolf
force-pushed
the
fix/build-script-tool-inputs
branch
from
November 25, 2026 21:16
1e96caa to
32d6540
Compare
Contributor
Author
|
@krasimirgg Could you take another look? It is rebased on main. |
This branch has not been deployed
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.
Build scripts now register their explicitly declared tools as
FilesToRunProvidervalues in the action'stoolslist. Bazel stages each executable and its own runfiles at the execution paths used bybuild_script_env, including when a compiler incoming transition configures the script's runfiles differently from the action's tools.The regression uses a
rust_binarywith runtime data generated bywrite_file. The tool reads that data throughRunfilesandrlocation!; the build script clears inherited runfiles environment variables before launching it, so the test exercises the tool's own runfiles. Coverage includes the public macro and an incoming-transition fixture, plus analysis checks for the exact tool execution paths. The fixture uses the default build-setting scope for compatibility with Bazel 7.4.1.Fixes #4297.
Validation on macOS arm64 after rebasing onto
b11ab7e2://cargo/tests/cargo_build_script/tool_inputs:all,//cargo/tests/cargo_build_script/runfiles:all, and//cargo/tests/cargo_build_script/tools_exec:allpass with Bazel 9.3.1 and 7.4.1, sandboxed execution, rustfmt, and clippy. The Bazel 7.4.1 invocation uses--build_runfile_links, matching the minimum-version CI configuration.RunfilesDirNotFoundbefore the provider fix and passes after it.git diff --checkpass.