fix(linker): cache macOS links built against a Nix store SDK #1042
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 507 lines diff across 6 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.373
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1042"
general
weight: 0.35
jdx
In a Nix dev shell on macOS, mbx now caches native links (tests, executables, proc macros) instead of bypassing every one of them. This is option 2 of discussion jdx/mr-boxington#1039.
Trigger. A stock nixpkgs
mkShellon aarch64-darwin sets the SDK from nixpkgs'apple-sdk:xcruncannot describe that SDK. mbx needs the SDK's identity in each link key, so it refused the host.mbx explainreported every native link asunportable-native-link("the macOS SDK could not be identified").Now. If
xcrunfails andSDKROOTresolves to a path inside a/nix/store/<hash>-<name>entry, mbx identifies the SDK by that store path. Store entries are immutable, and their names change when their inputs change, so the path alone tells two SDKs apart. mbx also reads the version from the SDK'sSDKSettings.jsonand the build fromSystem/Library/CoreServices/SystemVersion.plist, so keys stay readable. The version is required. The build is included when the plist reports it.Everything else is still refused: an
SDKROOToutside the store, a path that reaches the store only through..or a symlink trick (the path is canonicalized first), the store directory itself, and a store entry with no SDK version. Hosts wherexcrunworks behave the same as before.docs/limits.mdnow describes the exception.Validation.
SDKSettings.jsonandSystemVersion.plistinto a fake store entry and checks that the fallback reports the same version and build asxcrun. It passed on an Apple M6 Mac mini (macOS 27.2.1, Command Line Tools SDK 27.2, build 26B118), along with the rest of the linker tests.AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: unavailable.
🤖 Generated with Claude Code
<!-- CURSOR_SUMMARY -->
---
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
macOS builds can now identify SDKs in the Nix store when
xcruncannot describe them, using the SDK’s recorded version and build information when available.Documentation
Clarified the requirements for using Nix store SDKs with macOS host linking.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->