Skip to content

bootstrap unable to copy rust-llvm-dwp when cross compiling rustc #85593

Open
@jam1garner

Description

@jam1garner

Similar to #85590, this is an issue with copying files when cross compiling (Linux -> Windows), however a bit more complicated so I didn't proceed with a fix (don't mind implementing one but would need guidance).

thread 'main' panicked at 'src.symlink_metadata() failed with No such file or directory (os error 2)', src/bootstrap/lib.rs:1196:24
stack backtrace:
   0: rust_begin_unwind
             at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/panicking.rs:493:5
   1: std::panicking::begin_panic_fmt
             at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/std/src/panicking.rs:435:5
   2: bootstrap::Build::copy
             at ./src/bootstrap/lib.rs:1196:24
   3: <bootstrap::compile::Assemble as bootstrap::builder::Step>::run
             at ./src/bootstrap/compile.rs:1116:17
   4: bootstrap::builder::Builder::ensure
             at ./src/bootstrap/builder.rs:1518:23
   5: bootstrap::builder::Builder::compiler
             at ./src/bootstrap/builder.rs:585:9
   6: <bootstrap::tool::Rustdoc as bootstrap::builder::Step>::make_run
             at ./src/bootstrap/tool.rs:500:23
   7: bootstrap::builder::StepDescription::maybe_run
             at ./src/bootstrap/builder.rs:179:13
   8: bootstrap::builder::StepDescription::run
             at ./src/bootstrap/builder.rs:220:21
   9: bootstrap::builder::Builder::run_step_descriptions
             at ./src/bootstrap/builder.rs:577:9
  10: bootstrap::builder::Builder::execute_cli
             at ./src/bootstrap/builder.rs:569:9
  11: bootstrap::Build::build
             at ./src/bootstrap/lib.rs:510:13
  12: bootstrap::main
             at ./src/bootstrap/bin/main.rs:33:5
  13: core::ops::function::FnOnce::call_once
             at /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/library/core/src/ops/function.rs:227:5

From adding debug prints it attempts to copy

.../rust/build/x86_64-unknown-linux-gnu/llvm/build/bin/llvm-dwp.exe

to

.../rust/build/x86_64-pc-windows-gnu/stage2/lib/rustlib/x86_64-pc-windows-gnu/bin/rust-llvm-dwp.exe

Looking at the Relevant code it appears to be running llvm-config from the host in order to find the copy of llvm-dwp to copy, however when cross compiling you can't just copy over the host's llvm-dwp. This results in an error due to the fact it does properly respect the exe suffix, which means the file won't exist when cross compiling as llvm-dwp.exe won't exist in the host copy of llvm's bin directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-crossArea: Cross compilationC-bugCategory: This is a bug.O-windowsOperating system: WindowsT-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