Rust 1.26.0 fails to build on OS X 10.10.5


#1

Have been installing Rust using Homebrew, and previous versions worked fine, but the latest 1.26.0 does not build.

Always the same error:

Compiling panic_abort v0.0.0 (file:///private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0-src/src/libpanic_abort)
Compiling alloc v0.0.0 (file:///private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0-src/src/liballoc)
Compiling panic_unwind v0.0.0 (file:///private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0-src/src/libpanic_unwind)
Compiling alloc_system v0.0.0 (file:///private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0-src/src/liballoc_system)
error: Could not compile `std`.

Caused by:
process didn't exit successfully: `/private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0-src/build/bootstrap/debug/rustc --crate- 
name std libstd/lib.rs --error-format json --crate-type dylib --crate-type rlib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -- 
cfg feature="alloc_jemalloc" --cfg feature="backtrace" --cfg feature="jemalloc" --cfg feature="panic-unwind" --cfg 
feature="panic_unwind" -C metadata=a297a638e0984b03 -C extra-filename=-a297a638e0984b03 --out-dir /private/tmp/rust- 
20180514-70415-ya9x99/rustc-1.26.0-src/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps --target 
x86_64-apple-darwin -L dependency=/private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0-src/build/x86_64-apple- 
darwin/stage1-std/x86_64-apple-darwin/release/deps -L dependency=/private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0- 
src/build/x86_64-apple-darwin/stage1-std/release/deps --extern rustc_asan=/private/tmp/rust-20180514-70415-ya9x99/rustc- 
1.26.0-src/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/librustc_asan-f4f6bcd504eef548.rlib --extern 
panic_abort=/private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0-src/build/x86_64-apple-darwin/stage1-std/x86_64-apple- 
darwin/release/deps/libpanic_abort-c5809d2b73f594e5.rlib --extern alloc_system=/private/tmp/rust-20180514-70415-ya9x99/rustc- 
1.26.0-src/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/liballoc_system-6f7baa29581dba15.rlib -- 
extern compiler_builtins=/private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0-src/build/x86_64-apple-darwin/stage1- 
std/x86_64-apple-darwin/release/deps/libcompiler_builtins-bd73167a8925a884.rlib --extern core=/private/tmp/rust-20180514- 
70415-ya9x99/rustc-1.26.0-src/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/libcore- 
25b6d1996af3ba6a.rlib --extern alloc=/private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0-src/build/x86_64-apple- 
darwin/stage1-std/x86_64-apple-darwin/release/deps/liballoc-bfe57e517b27a55f.rlib --extern alloc_jemalloc=/private/tmp/rust- 
20180514-70415-ya9x99/rustc-1.26.0-src/build/x86_64-apple-darwin/stage1-std/x86_64-apple- 
darwin/release/deps/liballoc_jemalloc-03d6ea9f31c524d2.rlib --extern rustc_tsan=/private/tmp/rust-20180514-70415-ya9x99/rustc- 
1.26.0-src/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/librustc_tsan-a8408b80f28a7477.rlib --extern 
libc=/private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0-src/build/x86_64-apple-darwin/stage1-std/x86_64-apple- 
darwin/release/deps/liblibc-4fd7000939cb1dfa.rlib --extern std_unicode=/private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0- 
src/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/libstd_unicode-bb9e3d02f8a36008.rlib --extern 
panic_unwind=/private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0-src/build/x86_64-apple-darwin/stage1-std/x86_64-apple- 
darwin/release/deps/libpanic_unwind-5f5b955434cfdf44.rlib --extern unwind=/private/tmp/rust-20180514-70415-ya9x99/rustc- 
1.26.0-src/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/libunwind-36f333beda82c695.rlib -L 
native=/private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0-src/build/x86_64-apple-darwin/native/libbacktrace/.libs -l 
static=backtrace -l System -l resolv -L native=/private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0-src/build/x86_64-apple- 
darwin/native/jemalloc/lib -L native=/private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0-src/build/x86_64-apple- 
darwin/stage1-std/x86_64-apple-darwin/release/build/compiler_builtins-aa56d6d2d94a5702/out` (signal: 11, SIGSEGV: invalid 
memory reference)
command did not execute successfully: "/private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0-src/build/x86_64-apple- 
darwin/stage0/bin/cargo" "build" "--target" "x86_64-apple-darwin" "--release" "--features" "panic-unwind jemalloc backtrace" "- - 
manifest-path" "/private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0-src/src/libstd/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101
thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1064:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failed to run: /private/tmp/rust-20180514-70415-ya9x99/rustc-1.26.0-src/build/bootstrap/debug/bootstrap build
Build completed unsuccessfully in 0:24:31
make: *** [all] Error 1

It seems something goes wrong with cargo, any idea what is wrong and how we can fix it here? Thanks.


#2

It is known that recent Rust fails to build with Xcode 7 due to bugs in that version of Xcode. Exact nature of bugs is not yet characterized and unknown.

Your symptom does look similar. Which version of Xcode are you using? If it is the same problem, updating Xcode is known to fix it.


#3

Thanks for the response.

I don’t have Xcode installed, but I do have the command line tools of Xcode 7 (ver. 7.2.0.0.1.1447826929). Can I fix this without having a full Xcode installation? Or do I have to upgrade my OS X to a newer version and use a newer version of the Xcode command line tools?


#4

Both the Xcode app and the command line tools only ship with support for the latest OS (or sometimes latest minus one). So at least as far as officially supported options go, you’ll need to upgrade.


#5

Unless you want to characterize Xcode 7 bug and propose a workaround, you should upgrade your OS X and use new Xcode (command line version or otherwise).