-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apple: Re-implement SDK discovery instead of using xcrun
#131433
base: master
Are you sure you want to change the base?
Conversation
These commits modify compiler targets. |
xcrun
xcrun
not saying we shouldn't add this, but how long do you think is left until we get fed up with shoving this kind of code into |
No idea honestly, I'm not really familiar enough with the overall crate structure to say. |
f91a3b8
to
edf397b
Compare
Short initial review since I was tagged, but not an actual compiler reviewer etc etc. |
edf397b
to
bbb59cd
Compare
Some changes occurred in src/doc/rustc/src/platform-support cc @Noratrieb |
r? compiler |
macOS changes here look fine to me. |
☔ The latest upstream changes (presumably #132497) made this pull request unmergeable. Please resolve the merge conflicts. |
Also make the SDK name be the same casing as used in the file system.
bbb59cd
to
24e7da1
Compare
24e7da1
to
bd1888f
Compare
I'm not comfortable approving this without more team discussion. it is adding an extra amount of maintenance labor, for gains that are ... unclear at best to me. (And I say this as someone who develops on a Mac ... though I freely admit that I also bias towards Linux for a lot of development.) Maybe an MCP is warranted? @rustbot label I-compiler-nominated |
@rustbot label: +S-waiting-on-team -S-waiting-on-review |
Yeah, that's a fair assessment, I guess an alternative is to parse the error messages from I'll admit that my main motivation here is that I don't like
|
r? compiler |
Shelling out to a global command line tool like this makes it difficult for
rustc
to properly implement change-tracking of the involved variables and paths (e.g. we could tell Cargo to relink after the user runsxcode-select --switch
or installs/updates Xcode) as required for #118204, and makes error handling more difficult. So instead, this PR re-implements the SDK discovery logic thatxcrun
does, to avoid depending on that.The logic is now roughly:
I have tested this in a newly created virtual machine, and verified that:
xcode-select --install
, which fixes Detect linkage error whenxcode-select --install
hasn't been run #84534.sudo xcodebuild -license
, which fixes For *-apple-ios targets, if license agreement is not agreed to (yet), better behaviour is necessary #56829.Part of #129432.
I'm not sure, but I don't think release notes are desirable here? The behaviour should be mostly identical apart from better error messages, and besides, this was very under-documented before.
CC @BlackHoleFox @thomcc.