Run /usr/bin/env and /usr/bin/xcrun by absolute path in Xcode detection #695
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 179 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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
Diff Size
diff_size
0.311
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #695"
general
weight: 0.35
keith
Fixes #694.
What was broken:
local_config_xcodeandlocal_config_apple_ccranenvandxcrunby bare name.repository_ctx.executelooks a bare name up on the Bazel server's PATH. When that PATH has no/usr/bin,envis not found.xcode-locatoris then not built,local_config_xcodefalls back to the stub with no Xcode versions, and the linker feature checks of the legacy C++ toolchain all turn off. None of this produces an error.Fix: call
/usr/bin/envand/usr/bin/xcrunby absolute path inxcode/xcode_configure.bzlandcrosstool/osx_cc_configure.bzl. Both binaries are always at those paths on macOS.xcrunalready ran underenv -i, so it never depended on PATH itself.Test:
test/shell/minimal_path_test.shrunsbazel query --output=buildon the rules generated in@local_config_xcodeand@local_config_apple_cc. It runs once from a Bazel server started with the host PATH and once from a server started with an empty PATH, then requires the two outputs to match. Without the fix, the empty-PATH run gets the stub Xcode configuration, and with the rules toolchain off it also gets different%{features}, so the diff fails. The test is added to both shell-script jobs in.bazelci/presubmit.yml.I could not run the test locally because I only have a Linux machine. I checked the shell plumbing with a stub
bazelbinary and am relying on the macOS CI jobs for the real run.