Find the macOS SDK when only the Command Line Tools are installed - #2614
Open
iurisilvio wants to merge 1 commit into
Open
Find the macOS SDK when only the Command Line Tools are installed#2614iurisilvio wants to merge 1 commit into
iurisilvio wants to merge 1 commit into
Conversation
The SDK path was built as `xcode-select --print-path` plus
`Platforms/MacOSX.platform/Developer/SDKs/`, which only exists inside a full
Xcode. With the Command Line Tools selected the SDKs sit directly under
`SDKs/`, so the link step failed with
warning: unable to open library directory
'/Library/Developer/CommandLineTools/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.sdk/usr/lib'
after compiling everything.
Look for the pinned SDK in both layouts, and fall back to whichever SDK xcrun
considers active if it is in neither.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Building on a Mac without a full Xcode fails at the link step, after compiling every dependency:
Platforms/MacOSX.platform/Developer/SDKs/only exists inside an Xcode installation. With the Command Line Tools selected,xcode-select --print-pathreturns/Library/Developer/CommandLineToolsand the SDKs sit directly underSDKs/.Changes
Look for the pinned SDK in both layouts, and fall back to whatever
xcrun --show-sdk-pathreports if it is in neither — a machine whose Xcode ships a newer SDK still builds rather than failing on a path that does not exist.Verification
macOS 26.0 arm64, Command Line Tools only (no Xcode), zig 0.16.0:
zig buildsucceeds and the full suite passes (305 tests). I do not have a full Xcode here to exercise the first candidate, but it is the path the code builds today and the probe only falls through when it is missing.