Skip to content

llvm-tools on nightly doesn't package with external LLVM #52102

Closed
@semarie

Description

@semarie

since #51728, Rust failed to package properly when LLVM is configured as external dependency (with explicit llvm-config in config.toml)

  > LlvmTools { stage: 2, target: "x86_64-unknown-openbsd" }
Dist LlvmTools stage2 (x86_64-unknown-openbsd)

thread 'main' panicked at 'fs::File::open(&src) failed with No such file or directory (os error 2)', bootstrap/lib.rs:1194:25
stack backtrace:
   0: <std::ffi::c_str::NulError as core::fmt::Debug>::fmt
   1: <std::env::JoinPathsError as core::fmt::Debug>::fmt
   2: <std::ffi::os_str::OsString as core::fmt::Debug>::fmt
   3: <std::ffi::os_str::OsString as core::fmt::Debug>::fmt
   4: <std::ffi::os_str::OsString as core::fmt::Debug>::fmt
   5: <std::ffi::os_str::OsString as core::fmt::Debug>::fmt
   6: <std::ffi::os_str::OsString as core::fmt::Debug>::fmt
   7: <bootstrap::dist::LlvmTools as core::fmt::Debug>::fmt
   8: <bootstrap::dist::LlvmTools as bootstrap::builder::Step>::make_run
   9: <&'a T as core::fmt::Debug>::fmt
  10: <bootstrap::dist::Extended as bootstrap::builder::Step>::make_run
  11: <&'a T as core::fmt::Debug>::fmt
  12: <bootstrap::dist::Extended as bootstrap::builder::Step>::make_run
  13: <bootstrap::compile::Assemble as core::fmt::Debug>::fmt
  14: <bootstrap::compile::Assemble as core::fmt::Debug>::fmt
  15: <bootstrap::compile::Assemble as core::fmt::Debug>::fmt
  16: <bootstrap::compile::Assemble as core::fmt::Debug>::fmt
  17: <bootstrap::dist::LlvmTools as core::fmt::Debug>::fmt
  18: __register_frame_info
  19: __register_frame_info
  20: <std::ffi::os_str::OsString as core::fmt::Debug>::fmt
  21: <std::env::JoinPathsError as core::fmt::Debug>::fmt
  22: <std::io::error::Error as core::fmt::Display>::fmt
  23: __register_frame_info
  24: __register_frame_info
  25:
Traceback (most recent call last):
  File "/data/semarie/build-rust/build_dir/rustc-nightly-src/x.py", line 20, in <module>
    bootstrap.main()
  File "/data/semarie/build-rust/build_dir/rustc-nightly-src/src/bootstrap/bootstrap.py", line 827, in main
    bootstrap(help_triggered)
  File "/data/semarie/build-rust/build_dir/rustc-nightly-src/src/bootstrap/bootstrap.py", line 818, in bootstrap
    run(args, env=env, verbose=build.verbose)
  File "/data/semarie/build-rust/build_dir/rustc-nightly-src/src/bootstrap/bootstrap.py", line 148, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /data/semarie/build-rust/build_dir/build/bootstrap/debug/bootstrap dist --jobs=4

the No such file or directory error is because buildrust tries to copy:
/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/llvm/bin/llvm-nm to /data/semarie/build-rust/build_dir/build/tmp/dist/llvm-tools-image/bin/llvm-nm.

But as LLVM was external, the directory build/x86_64-unknown-openbsd/llvm/ is empty.

I think there is two possibilities:

  • doesn't package llvm-tools componment if LLVM is external
  • package it, but uses the right directory

I will make a PR if someone told me the direction to take.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions