Closed
Description
After cloning, I expected python3 x.py test --stage 1 tests/ui
to succeed but instead I got many test failures like this one:
---- [ui] tests/ui/async-await/track-caller/panic-track-caller.rs#afn stdout ----
error in revision `afn`: test compilation failed although it shouldn't!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/Users/wesley/Code/rust/build/aarch64-apple-darwin/stage1/bin/rustc" "/Users/wesley/Code/rust/tests/ui/async-await/track-caller/panic-track-caller.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/wesley/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/wesley/Code/rust/vendor" "--sysroot" "/Users/wesley/Code/rust/build/aarch64-apple-darwin/stage1" "--target=aarch64-apple-darwin" "--cfg" "afn" "--check-cfg" "cfg(FALSE,afn,cls,nofeat)" "-O" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "-o" "/Users/wesley/Code/rust/build/aarch64-apple-darwin/test/ui/async-await/track-caller/panic-track-caller.afn/a" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/Users/wesley/Code/rust/build/aarch64-apple-darwin/native/rust-test-helpers" "--edition=2021"
stdout: none
--- stderr -------------------------------
error: unable to run `rust-objcopy`: No such file or directory (os error 2)
error: aborting due to 1 previous error
------------------------------------------
However, if I create a config.toml
by cp config.example.toml config.toml
, then the problem goes away.
I instrumented the code here with a println!()
and I can see that when config.toml
exists, this block runs but when config.toml
does not exist, it does not run:
rust/src/bootstrap/src/core/build_steps/compile.rs
Lines 1980 to 1988 in b71fb5e
Possibly related to #132720 cc @jieyouxu
Meta
Cloned rust-lang/rust at b71fb5e
Host is aarch64-apple-darwin
Activity
jieyouxu commentedon Nov 19, 2024
Only copy, rename and link llvm-objcopy if llvm tools are enabled #132720 fixes Shipping llvm-strip w/ a symlink breaks when bootstrap compiler doesn't contain any LLVM tools #132719 because cg_clif doesn't have llvm bin tools in the bootstrap compiler.
That was because bootstrap/codegen_ssa: ship llvm-strip and use it for -Cstrip #131405 was introduced to fix Hard-coded strip path breaks Linux -> Darwin builds #131206.
And
strip
was hard-coded before by Fix up setting strip = true in Cargo.toml makes build scripts fail in… #130781 because using a randomstrip
fromPATH
on macOS can mean using a broken homebrew strip1 as reported in Setting strip = true in Cargo.toml makes build scripts fail in release mode on MacOS #110536.Footnotes
AFAIK it's still broken ↩
jieyouxu commentedon Nov 19, 2024
I'm not very sure what's the proper fix here... Default
config.toml
-less macOS builds to acquire CI llvm and llvm bin tools?Zulip thread: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Bootstrap.20w.2Fout.20config.2Etoml.20fails.20with.20missing.20rust-objcopy
jieyouxu commentedon Nov 19, 2024
Right... because we hard code this to
rust-objcopy
in cg_ssa:rust/compiler/rustc_codegen_ssa/src/back/link.rs
Lines 1106 to 1107 in e6c1e14
jieyouxu commentedon Nov 19, 2024
Apparently without a config.toml
llvm_tools_enabled
isfalse
by defaultllvm_tools_enabled
when noconfig.toml
is present #133207Rollup merge of rust-lang#133207 - jieyouxu:macos-objcopy, r=Kobzol,b…
Unrolled build for rust-lang#133207