Skip to content

[rustbuild] no entry fround for key during LLVM step when cross-compiling rustc #36268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nagisa opened this issue Sep 4, 2016 · 3 comments
Closed
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@nagisa
Copy link
Member

nagisa commented Sep 4, 2016

$ python2 src/bootstrap/bootstrap.py --stage 2 --step rustc -j8 --target=i686-unknown-linux-gnu
    Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Building stage0 test artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Building stage1 std artifacts (x86_64-unknown-linux-gnu -> i686-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Building stage1 test artifacts (x86_64-unknown-linux-gnu -> i686-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.0 secs
Building LLVM for i686-unknown-linux-gnu
thread 'main' panicked at 'no entry found for key', ../src/libcore/option.rs:700
stack backtrace:
   1:     0x561baf954479 - std::sys::backtrace::tracing::imp::write::h6f07380f45fe1307
   2:     0x561baf95c6dc - std::panicking::default_hook::_{{closure}}::he6993150602797ff
   3:     0x561baf95ba29 - std::panicking::default_hook::h42f7cdc1bed8dd00
   4:     0x561baf95c0e8 - std::panicking::rust_panic_with_hook::hdcce59947203a4c0
   5:     0x561baf95bf82 - std::panicking::begin_panic::h832a3d3207d44464
   6:     0x561baf95beb0 - std::panicking::begin_panic_fmt::hd1709f2e7b5289b9
   7:     0x561baf95be31 - rust_begin_unwind
   8:     0x561baf994aaf - core::panicking::panic_fmt::hdd0d476d63f35c21
   9:     0x561baf994b25 - core::option::expect_failed::hc4b6040e56029bcc
  10:     0x561baf6b93a6 - _<core..option..Option<T>>::expect::ha1df3f891b8f9b2d
                        at /buildslave/rust-buildbot/slave/beta-dist-rustc-linux/build/obj/../src/libcore/option.rs:294
  11:     0x561baf6a0ed7 - _<std..collections..hash..map..HashMap<K, V, S> as core..ops..Index<&'a Q>>::index::h7496f7eae83e9392
                        at /buildslave/rust-buildbot/slave/beta-dist-rustc-linux/build/obj/../src/libstd/collections/hash/map.rs:1218
  12:     0x561baf7964d5 - bootstrap::Build::cxx::h3205072a6636d676
                        at /home/nagisa/Documents/rust/rust/worktrees/more-cace/src/bootstrap/lib.rs:896
  13:     0x561baf7714a9 - bootstrap::native::llvm::h13c673c7ef1162af
                        at /home/nagisa/Documents/rust/rust/worktrees/more-cace/src/bootstrap/native.rs:103
  14:     0x561baf790891 - bootstrap::Build::build::he0c681db648efe1f
                        at /home/nagisa/Documents/rust/rust/worktrees/more-cace/src/bootstrap/lib.rs:253
  15:     0x561baf699593 - bootstrap::main::h1cf80230043bd02e
                        at /home/nagisa/Documents/rust/rust/worktrees/more-cace/src/bootstrap/bin/main.rs:36
  16:     0x561baf9641c6 - __rust_maybe_catch_panic
  17:     0x561baf95b192 - std::rt::lang_start::h14913182d401dec2
  18:     0x561baf699743 - main
  19:     0x7f283b969290 - __libc_start_main
  20:     0x561baf690729 - _start
  21:                0x0 - <unknown>
@Aatch Aatch added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Sep 5, 2016
@alexcrichton
Copy link
Member

Can you provide more assistance in debugging as well? For example what was at line 896 of lib.rs? What configuration did you provide? etc.

@nagisa
Copy link
Member Author

nagisa commented Sep 6, 2016

Relevant line is a part of

/// Returns the path to the C++ compiler for the target specified, may panic
/// if no C++ compiler was configured for the target.
fn cxx(&self, target: &str) -> &Path {
    self.cxx[target].path()
}

At that point anything pertaining i686 in my config.toml were

target = [..., "i686-unknown-linux-gnu", ...]
# ...
[target.i686-unknown-linux-gnu]
# nothing here

Replacing [target.i686-unknown-linux-gnu] with

[target.i686-unknown-linux-gnu]
cc = "clang"
cxx = "clang++"

does still result in the same error.


For now, I just specified llvm-config for 32 bit version of LLVM I have, which works.

@alexcrichton
Copy link
Member

Ah ok, thanks for the info!

Right now this should be a better error (of course) but the cause is how rustbuild treats the target and host arrays in the configuration. No C++ compilers are found for the target array, so you can't request any host-related targets (e.g. LLVM) when a triple is only mentioned in the target array. You can fix this by moving the target to the host array.

alexcrichton added a commit to alexcrichton/rust that referenced this issue Sep 13, 2016
If a triple is configured only as a target, not a host, then trying to build
that triple with host artifacts would cause a panic. Fail a little nicer
instead.

Closes rust-lang#36268
bors added a commit that referenced this issue Sep 20, 2016
rustbuild: Nicer error for host builds of targets

If a triple is configured only as a target, not a host, then trying to build
that triple with host artifacts would cause a panic. Fail a little nicer
instead.

Closes #36268
bors added a commit that referenced this issue Sep 25, 2016
rustbuild: Nicer error for host builds of targets

If a triple is configured only as a target, not a host, then trying to build
that triple with host artifacts would cause a panic. Fail a little nicer
instead.

Closes #36268
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

3 participants