Skip to content
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

ICE when compiled target does not match the per-package-target with forced-target #125312

Closed
bsodmike opened this issue May 20, 2024 · 2 comments
Closed
Labels
C-bug Category: This is a bug. T-cargo Relevant to the cargo team, which will review and decide on the PR/issue.

Comments

@bsodmike
Copy link

Setup a new binary with the following Cargo.toml. This is to be compiled with nightly

Code

cargo-features = ["per-package-target"]

[package]
name = "rustc-ice-20052024"
version = "0.1.0"
edition = "2021"
forced-target = "aarch64-apple-darwin"

Notice we have specified a target for the package, let's trigger the ICE

RUST_BACKTRACE=full cargo test \
   --target x86_64-apple-darwin \
   -Z panic-abort-tests \
   -Z build-std="std,panic_abort" \
   --no-default-features

Meta

rustc --version --verbose:

rustc 1.80.0-nightly (d84b90375 2024-05-19)
binary: rustc
commit-hash: d84b9037541f45dc2c52a41d723265af211c0497
commit-date: 2024-05-19
host: x86_64-apple-darwin
release: 1.80.0-nightly
LLVM version: 18.1.4

Error output

thread 'main' panicked at src/cargo/core/compiler/unit_dependencies.rs:178:34:
no entry found for key
stack backtrace:
   0:        0x110e5d783 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h65e7ba8206e9fe5e
   1:        0x110e87d1b - core::fmt::write::h58ccd03eb960a1c5
   2:        0x110e57d6e - std::io::Write::write_fmt::h543d2c65af9d92d7
   3:        0x110e5d571 - std::sys_common::backtrace::print::h28f8b34c5088ad24
   4:        0x110e5f409 - std::panicking::default_hook::{{closure}}::h23c898e78e0d311d
   5:        0x110e5f150 - std::panicking::default_hook::he086d5b1ff0552cb
   6:        0x110e5fe26 - std::panicking::rust_panic_with_hook::he2c005d00e564b32
   7:        0x110e5f792 - std::panicking::begin_panic_handler::{{closure}}::hee8e5367887f1010
   8:        0x110e5dc59 - std::sys_common::backtrace::__rust_end_short_backtrace::haf909939cf0292ab
   9:        0x110e5f4c6 - _rust_begin_unwind
  10:        0x110ef1382 - core::panicking::panic_fmt::hbf2e94c7aba44d2d
  11:        0x110e8542b - core::panicking::panic_display::hf1f58c71e8cb7f34
  12:        0x110ef134c - core::option::expect_failed::h4673c1075ec35a4c
  13:        0x11067c053 - cargo[4bc1e3eef288eb09]::core::compiler::unit_dependencies::build_unit_dependencies
  14:        0x1106a8607 - cargo[4bc1e3eef288eb09]::ops::cargo_compile::create_bcx
  15:        0x1106a6d70 - cargo[4bc1e3eef288eb09]::ops::cargo_compile::compile_ws
  16:        0x1104b23c9 - cargo[4bc1e3eef288eb09]::ops::cargo_compile::compile
  17:        0x110505d1d - cargo[4bc1e3eef288eb09]::ops::cargo_test::compile_tests
  18:        0x110503885 - cargo[4bc1e3eef288eb09]::ops::cargo_test::run_tests
  19:        0x10ff863d0 - cargo[e4f6e22280b72f14]::commands::test::exec
  20:        0x10ff980e6 - <cargo[e4f6e22280b72f14]::cli::Exec>::exec
  21:        0x10ff8e6e4 - cargo[e4f6e22280b72f14]::main
  22:        0x10ff095a6 - std[2ef0a72e01431fdb]::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>
  23:        0x10ff1a2fc - std[2ef0a72e01431fdb]::rt::lang_start::<()>::{closure#0}
  24:        0x110e4ef97 - std::rt::lang_start_internal::h16d68c8f2a0c246f
  25:        0x10ff9e0bc - _main

I stumbled on this when using an older Intel based Mac.

@bsodmike bsodmike added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 20, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 20, 2024
@bjorn3
Copy link
Member

bjorn3 commented May 20, 2024

This is a cargo crash. It looks like this is a duplicate of rust-lang/cargo#11898. It has the same panic location and uses both build-std and per-package-target like you do.

@bsodmike
Copy link
Author

Thanks,oops yeah this is cargo related!

@saethlin saethlin added T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-cargo Relevant to the cargo team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants