Skip to content

Missing tools in LLVM CI tarball #91710

Closed
@nox

Description

@nox

I've rebased this morning and I can't build the repo anymore since #91685 landed.

Copy "/Users/nox/src/rust/build/x86_64-apple-darwin/ci-llvm/bin/llvm-dwp" to "/Users/nox/src/rust/build/x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/bin/rust-llvm-dwp"
Copy "/Users/nox/src/rust/build/x86_64-apple-darwin/ci-llvm/bin/llvm-cov" to "/Users/nox/src/rust/build/x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/bin/llvm-cov"
Copy "/Users/nox/src/rust/build/x86_64-apple-darwin/ci-llvm/bin/llvm-nm" to "/Users/nox/src/rust/build/x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/bin/llvm-nm"
thread 'main' panicked at 'src.symlink_metadata() failed with No such file or directory (os error 2)', src/bootstrap/lib.rs:1324:24

It seems there are missing tools in the LLVM CI tarball.

AFAICT, these are the tools CI copies in the tarball:

rust/src/bootstrap/dist.rs

Lines 2077 to 2087 in 3b263ce

for bin in &[
"llvm-config",
"llvm-ar",
"llvm-objdump",
"llvm-profdata",
"llvm-bcanalyzer",
"llvm-cov",
"llvm-dwp",
] {
tarball.add_file(src_bindir.join(exe(bin, target)), "bin", 0o755);
}

And these are the tools bootstrap tries to install in build/:

rust/src/bootstrap/compile.rs

Lines 1169 to 1177 in 3b263ce

// Since we've already built the LLVM tools, install them to the sysroot.
// This is the equivalent of installing the `llvm-tools-preview` component via
// rustup, and lets developers use a locally built toolchain to
// build projects that expect llvm tools to be present in the sysroot
// (e.g. the `bootimage` crate).
for tool in LLVM_TOOLS {
let tool_exe = exe(tool, target_compiler.host);
builder.copy(&llvm_bin_dir.join(&tool_exe), &libdir_bin.join(&tool_exe));
}

LLVM_TOOLS being defined as:

rust/src/bootstrap/lib.rs

Lines 172 to 186 in 3b263ce

const LLVM_TOOLS: &[&str] = &[
"llvm-cov", // used to generate coverage report
"llvm-nm", // used to inspect binaries; it shows symbol names, their sizes and visibility
"llvm-objcopy", // used to transform ELFs into binary format which flashing tools consume
"llvm-objdump", // used to disassemble programs
"llvm-profdata", // used to inspect and merge files generated by profiles
"llvm-readobj", // used to get information from ELFs/objects that the other tools don't provide
"llvm-size", // used to prints the size of the linker sections of a program
"llvm-strip", // used to discard symbols from binary files to reduce their size
"llvm-ar", // used for creating and modifying archive files
"llvm-as", // used to convert LLVM assembly to LLVM bitcode
"llvm-dis", // used to disassemble LLVM bitcode
"llc", // used to compile LLVM bytecode
"opt", // used to optimize LLVM bytecode
];

As you can see, there are many tools in LLVM_TOOLS that are not included in that dist step shown above.

I'm on macOS, and here is the list of tools that I found in the downloaded LLVM CI tarball:

± tar tf build/cache/llvm-09d8a50ea26df391b58373e22f5891740efdd6cc-False/rust-dev-nightly-x86_64-apple-darwin.tar.xz 'rust-dev-nightly-*/rust-dev/bin/'
rust-dev-nightly-x86_64-apple-darwin/rust-dev/bin
rust-dev-nightly-x86_64-apple-darwin/rust-dev/bin/llvm-profdata
rust-dev-nightly-x86_64-apple-darwin/rust-dev/bin/lld
rust-dev-nightly-x86_64-apple-darwin/rust-dev/bin/llvm-config
rust-dev-nightly-x86_64-apple-darwin/rust-dev/bin/FileCheck
rust-dev-nightly-x86_64-apple-darwin/rust-dev/bin/llvm-objdump
rust-dev-nightly-x86_64-apple-darwin/rust-dev/bin/llvm-dwp
rust-dev-nightly-x86_64-apple-darwin/rust-dev/bin/llvm-ar
rust-dev-nightly-x86_64-apple-darwin/rust-dev/bin/llvm-bcanalyzer
rust-dev-nightly-x86_64-apple-darwin/rust-dev/bin/llvm-cov

Cc @Aaron1011 who authored #91685.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-infraRelevant to the infrastructure 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