← Back to Pull requests

Run /usr/bin/env and /usr/bin/xcrun by absolute path in Xcode detection #695

Closed
unknown closed this pull request without merging on Nov 18, 2026 18:55 UTC
View on GitHub
unknown unknown commented on Nov 18, 2026 13:45 UTC
Author

Fixes #694.

What was broken: local_config_xcode and local_config_apple_cc ran env and xcrun by bare name. repository_ctx.execute looks a bare name up on the Bazel server's PATH. When that PATH has no /usr/bin, env is not found. xcode-locator is then not built, local_config_xcode falls 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/env and /usr/bin/xcrun by absolute path in xcode/xcode_configure.bzl and crosstool/osx_cc_configure.bzl. Both binaries are always at those paths on macOS. xcrun already ran under env -i, so it never depended on PATH itself.

Test: test/shell/minimal_path_test.sh runs bazel query --output=build on the rules generated in @local_config_xcode and @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 bazel binary and am relying on the macOS CI jobs for the real run.

Diff: 179 lines (+134 / -45) across 2 files Reviewer: keith Review duration: 310m
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
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 35.5% (MEDIUM) · Higher = larger blast radius
35.5%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14% · Safe to merge
14%