Closed
Description
This breaks bootstrapping when the bootstrap compiler doesn't contain any LLVM tools as is the case when cg_clif bootstraps rustc:
Building stage0 tool lld-wrapper (x86_64-unknown-linux-gnu)
Compiling lld-wrapper v0.1.0 (/home/runner/work/rustc_codegen_cranelift/rustc_codegen_cranelift/rust/src/tools/lld-wrapper)
Finished `release` profile [optimized] target(s) in 0.43s
thread 'main' panicked at src/lib.rs:1714:24:
src.symlink_metadata() failed with No such file or directory (os error 2) ("src = /home/runner/work/rustc_codegen_cranelift/rustc_codegen_cranelift/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-objcopy")
It should probably check builder.config.llvm_enabled(target_compiler.host) && builder.config.llvm_tools_enabled
before copying to ensure that llvm-objcopy
exists in the first place.
Originally posted by @bjorn3 in #131405 (comment)