-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Detect linkage error when xcode-select --install
hasn't been run
#84534
Comments
From my memory, I recall seeing a MacOS pop-up a suggestion to install the XCode if I needed the commands in question. Is that not a thing anymore? |
Changes on the MacOS side might have made that suggestion stop being detected. |
It would be good to know which version of macOS that came from. On Catalina (10.15) the error is:
And a GUI dialog box pops up to install the tools. Perhaps Big Sur (11) is different, or maybe they are on an M1 that has strange behavior. |
Asked the original reporter to update this ticket. |
…eywiser Improve `xcrun` error handling The compiler invokes `xcrun` on macOS when linking Apple targets, to find the Xcode SDK which contain all the necessary linker stubs. The error messages that `xcrun` outputs aren't always that great though, so this PR tries to improve that by providing extra context when an error occurs. Fixes rust-lang#56829. Fixes rust-lang#84534. Part of rust-lang#129432. See also the alternative rust-lang#131433. Tested on: - `x86_64-apple-darwin`, MacBook Pro running Mac OS X 10.12.6 - With no tooling installed - With Xcode 9.2 - With Xcode 9.2 Commandline Tools - `aarch64-apple-darwin`, MacBook M2 Pro running macOS 14.7.4 - With Xcode 13.4.1 - With Xcode 16.2 - Inside `nix-shell -p xcbuild` (nixpkgs' `xcrun` shim) - `aarch64-apple-darwin`, VM running macOS 15.3.1 - With no tooling installed - With Xcode 16.2 Commandline Tools `@rustbot` label O-apple r? compiler CC `@BlackHoleFox` `@thomcc`
Rollup merge of rust-lang#139010 - madsmtm:parse-xcrun-better, r=wesleywiser Improve `xcrun` error handling The compiler invokes `xcrun` on macOS when linking Apple targets, to find the Xcode SDK which contain all the necessary linker stubs. The error messages that `xcrun` outputs aren't always that great though, so this PR tries to improve that by providing extra context when an error occurs. Fixes rust-lang#56829. Fixes rust-lang#84534. Part of rust-lang#129432. See also the alternative rust-lang#131433. Tested on: - `x86_64-apple-darwin`, MacBook Pro running Mac OS X 10.12.6 - With no tooling installed - With Xcode 9.2 - With Xcode 9.2 Commandline Tools - `aarch64-apple-darwin`, MacBook M2 Pro running macOS 14.7.4 - With Xcode 13.4.1 - With Xcode 16.2 - Inside `nix-shell -p xcbuild` (nixpkgs' `xcrun` shim) - `aarch64-apple-darwin`, VM running macOS 15.3.1 - With no tooling installed - With Xcode 16.2 Commandline Tools ``@rustbot`` label O-apple r? compiler CC ``@BlackHoleFox`` ``@thomcc``
When trying to run
rustc
for the first time on MacOS X, you might encounter this error message:This happens if you haven't installed the Developer Command Line Tools with
xcode-select --install
.We should detect the error output message "missing xcrun" and when it happens, emit a more targeted, friendlier error explaining what happened to the user.
Taken from https://users.rust-lang.org/t/error-compiling-my-first-basic-rust-program/58872
The text was updated successfully, but these errors were encountered: