keep xcrun working under fake developer dir#281
Merged
forketyfork merged 1 commit intomainfrom Apr 13, 2026
Merged
Conversation
Issue: PR #277 introduced a fake `DEVELOPER_DIR` for the Zig 0.15.2 macOS SDK workaround, but that developer tree did not include `usr/bin/xcrun`, so Git and other commands started failing until `DEVELOPER_DIR` was unset. Solution: Install the shim at `DEVELOPER_DIR/usr/bin/xcrun` and reuse it from the PATH entry so the fake developer directory stays valid for both Zig and tools that delegate to `/usr/bin/xcrun`. Update the development docs and repo notes so the workaround is easier to understand and maintain.
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.
Solution
PR #277 added a local shell workaround for Zig 0.15.2 on macOS, but it left the fake
DEVELOPER_DIRincomplete. Tools such as Git still go through/usr/bin/xcrun, and Apple's toolchain expects that binary to exist inside the selected developer directory.This patch moves the existing shim into
DEVELOPER_DIR/usr/bin/xcrunand keeps the PATH wrapper as a symlink to the same executable. That preserves the SDK override forzig buildwhile making the fake developer tree valid for other commands in the shell. I also updated the development notes and repo guidance so the behavior is documented where people are likely to look for it.Test plan
nix developon a macOS machine that still needs the Zig 0.15.2 SDK workaround.git statuswithout unsettingDEVELOPER_DIRand confirm it succeeds./usr/bin/xcrun --sdk macosx --show-sdk-pathand confirm it resolves toMacOSX15.4.sdk.zig buildand confirm the workaround still allows the project to link.