1
Fork 0
rust/compiler/rustc_codegen_ssa/src
Jacob Pratt 0b40e6e2cf
Rollup merge of #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 https://github.com/rust-lang/rust/issues/56829.
Fixes https://github.com/rust-lang/rust/issues/84534.
Part of https://github.com/rust-lang/rust/issues/129432.
See also the alternative https://github.com/rust-lang/rust/pull/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``
2025-03-27 21:41:48 -04:00
..
back Rollup merge of #139010 - madsmtm:parse-xcrun-better, r=wesleywiser 2025-03-27 21:41:48 -04:00
debuginfo Flatten ifs in rustc_codegen_ssa 2025-03-17 18:56:52 +00:00
mir Auto merge of #138601 - RalfJung:wasm-abi-fcw, r=alexcrichton 2025-03-26 00:06:46 +00:00
traits Auto merge of #133984 - DaniPopes:scmp-ucmp, r=scottmcm 2025-03-24 22:53:12 +00:00
assert_module_sources.rs Move methods from Map to TyCtxt, part 4. 2025-03-12 08:55:37 +11:00
base.rs Auto merge of #138629 - Zoxc:graph-anon-hashmap, r=oli-obk 2025-03-24 15:02:09 +00:00
codegen_attrs.rs Rollup merge of #138627 - EnzymeAD:autodiff-cleanups, r=oli-obk 2025-03-21 15:48:55 +01:00
common.rs Test fixing raw-dylib 2024-09-24 10:10:31 -07:00
errors.rs Emit better error messages when invoking xcrun 2025-03-27 04:38:54 +01:00
lib.rs Emit better error messages when invoking xcrun 2025-03-27 04:38:54 +01:00
meth.rs More assertions, tests, and miri coverage 2025-01-30 17:44:28 +00:00
mono_item.rs Make a fake body to store typeck results for global_asm 2025-02-22 00:12:07 +00:00
size_of_val.rs Set both nuw and nsw in slice size calculation 2025-02-13 21:26:48 -08:00
target_features.rs Simplify implied_target_features. 2025-03-05 09:20:28 +11:00