You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rustc uses the SDKROOT environment variable to figure out details about the SDK to pass onward to the linker (linker stubs and the SDK version). If this flag is not set, or is set for the wrong platform, we fall back to invoking xcrun --sdk $platform --show-sdk-path.
It might be beneficial to add a commandline flag to allow passing this information as well? This has been requested by Chromium in #131477 (comment), see that for motivation.
Alternatively / additionally, we could add a flag to completely opt out of passing SDK information to the linker, such as -Clinker-features=-sdkroot (partially reverting to the state before #131477). Such a flag might also be useful for e.g. cargo zigbuild (which provides the SDK internally).
Similarly, we might want to add -Cdeployment-target=... for controlling the values that we otherwise take from the MACOSX_DEPLOYMENT_TARGET/similar environment variables.
Another thing I just discovered: macOS system python3 gets really confused if SDKROOT is set. We (chromium) have to set SDKROOT at the moment (see linked discussion). If there was a flag, we could use that and sidestep that issue.
% SDKROOT=$PWD/out/gn/sdk/xcode_links/MacOSX26.2.sdk python3
python3: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Users/thakis/src/v8/v8/out/gn/sdk/xcode_links/MacOSX26.2.sdk -find python3 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory)
xcode-select: Failed to locate 'python3', requesting installation of command line developer tools.
Activity
madsmtm commentedon Sep 27, 2025
Similarly, we might want to add
-Cdeployment-target=...for controlling the values that we otherwise take from theMACOSX_DEPLOYMENT_TARGET/similar environment variables.nico commentedon Feb 20, 2026
Another thing I just discovered: macOS system
python3gets really confused ifSDKROOTis set. We (chromium) have to setSDKROOTat the moment (see linked discussion). If there was a flag, we could use that and sidestep that issue.