cargo: declare build-script tool files and runfiles #4302
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.42) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 177 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.310
Real PR Conversation Timeline
1 comments
"Review active on #4302"
general
weight: 0.35
jrandolf
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.