Skip to content

Shipping llvm-strip w/ a symlink breaks when bootstrap compiler doesn't contain any LLVM tools #132719

Closed
@jieyouxu

Description

@jieyouxu

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)

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)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions