Skip to content

Bootstrap without creating a config.toml fails with missing rust-objcopy #133195

Closed
@wesleywiser

Description

@wesleywiser

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:

// `llvm-strip` is used by rustc, which is actually just a symlink to `llvm-objcopy`, so
// copy and rename `llvm-objcopy`.
//
// But only do so if llvm-tools are enabled, as bootstrap compiler might not contain any
// LLVM tools, e.g. for cg_clif.
// See <https://github.com/rust-lang/rust/issues/132719>.
let src_exe = exe("llvm-objcopy", target_compiler.host);
let dst_exe = exe("rust-objcopy", target_compiler.host);
builder.copy_link(&libdir_bin.join(src_exe), &libdir_bin.join(dst_exe));

Possibly related to #132720 cc @jieyouxu

Meta

Cloned rust-lang/rust at b71fb5e

Host is aarch64-apple-darwin

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions