blink icon indicating copy to clipboard operation
blink copied to clipboard

Repository no longer compiles with latest nightly

Open Teascade opened this issue 4 months ago • 2 comments

If you try to compile the project via the Dockerfile, you will encounter an error

error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/avr-rust/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc - --crate-name ___ --print=file-names --target /code/blink/avr-atmega328p.json --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
  --- stderr
  error: error loading target specification: target-c-int-width: invalid type: string "16", expected u16 at line 21 column 28
    |
    = help: run `rustc --print target-list` for a list of built-in targets

When I fixed these issues in the target as best as I could (made the numbers real numbers and set "os": "none", as required, I instead encountered a bug seemingly in the rust compiler..

error: currently all targets that support `AtomicPtr` also support `AtomicU32`
 --> /home/avr-rust/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/compiler-builtins/compiler-builtins/src/math/../../../libm/src/math/support/feature_detect.rs:5:1
  |
5 | compile_error!("currently all targets that support `AtomicPtr` also support `AtomicU32`");
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0432]: unresolved import `core::sync::atomic::AtomicU32`
 --> /home/avr-rust/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/compiler-builtins/compiler-builtins/src/math/../../../libm/src/math/support/feature_detect.rs:7:26
  |
7 | use core::sync::atomic::{AtomicU32, Ordering};
  |                          ^^^^^^^^^
  |                          |
  |                          no `AtomicU32` in `sync::atomic`
  |                          help: a similar name exists in the module: `AtomicU8`


thread 'rustc' (89) panicked at compiler/rustc_codegen_ssa/src/back/metadata.rs:378:17:
compiler/rustc_codegen_ssa/src/back/metadata.rs:378:17: AVR CPU not explicitly specified
stack backtrace:
   0:     0x7f592dc62dc3 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h54506206b99d5f7e
   1:     0x7f592e2b6a98 - core::fmt::write::hbb196ec51395983c
   2:     0x7f592dc17c51 - std::io::Write::write_fmt::heaf24d6b85cc9885
   3:     0x7f592dc28ca2 - std::sys::backtrace::BacktraceLock::print::hbc24639f21e8c05b
   4:     0x7f592dc2ec29 - std::panicking::default_hook::{{closure}}::hfabddcca5ce7b3c4
   5:     0x7f592dc2e753 - std::panicking::default_hook::hd124b65bea08dd02
   6:     0x7f592cc90b65 - std[3875e4e9fe9616d2]::panicking::update_hook::<alloc[1dcb15b95838d6d5]::boxed::Box<rustc_driver_impl[e814eafd5e9b0dbb]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7f592dc2f04f - std::panicking::panic_with_hook::h748d1fbd558217fa
   8:     0x7f592d26b9d2 - std[3875e4e9fe9616d2]::panicking::begin_panic::<alloc[1dcb15b95838d6d5]::string::String>::{closure#0}
   9:     0x7f592d252466 - std[3875e4e9fe9616d2]::sys::backtrace::__rust_end_short_backtrace::<std[3875e4e9fe9616d2]::panicking::begin_panic<alloc[1dcb15b95838d6d5]::string::String>::{closure#0}, !>
  10:     0x7f592d24e11e - std[3875e4e9fe9616d2]::panicking::begin_panic::<alloc[1dcb15b95838d6d5]::string::String>
  11:     0x7f592d26be87 - rustc_middle[6655e9dda62bae12]::util::bug::opt_span_bug_fmt::<rustc_span[7433b1fcb98b153e]::span_encoding::Span>::{closure#0}
  12:     0x7f592d26beda - rustc_middle[6655e9dda62bae12]::ty::context::tls::with_opt::<rustc_middle[6655e9dda62bae12]::util::bug::opt_span_bug_fmt<rustc_span[7433b1fcb98b153e]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  13:     0x7f592d25a62b - rustc_middle[6655e9dda62bae12]::ty::context::tls::with_context_opt::<rustc_middle[6655e9dda62bae12]::ty::context::tls::with_opt<rustc_middle[6655e9dda62bae12]::util::bug::opt_span_bug_fmt<rustc_span[7433b1fcb98b153e]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  14:     0x7f592a382ec0 - rustc_middle[6655e9dda62bae12]::util::bug::bug_fmt
  15:     0x7f593028fea5 - rustc_codegen_ssa[564647a9c527cd07]::back::metadata::elf_e_flags.cold
  16:     0x7f592f5f983f - rustc_codegen_ssa[564647a9c527cd07]::back::metadata::create_object_file
  17:     0x7f592f5f9040 - rustc_codegen_ssa[564647a9c527cd07]::back::metadata::create_wrapper_file
  18:     0x7f592f3ae10d - rustc_codegen_ssa[564647a9c527cd07]::back::link::link_rlib
  19:     0x7f592f3024e1 - rustc_codegen_ssa[564647a9c527cd07]::back::link::link_binary
  20:     0x7f592f48a328 - <rustc_interface[418b99c481e20bf6]::queries::Linker>::link
  21:     0x7f592f482426 - rustc_interface[418b99c481e20bf6]::interface::run_compiler::<(), rustc_driver_impl[e814eafd5e9b0dbb]::run_compiler::{closure#0}>::{closure#1}
  22:     0x7f592f3ec6b8 - std[3875e4e9fe9616d2]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[418b99c481e20bf6]::util::run_in_thread_with_globals<rustc_interface[418b99c481e20bf6]::util::run_in_thread_pool_with_globals<rustc_interface[418b99c481e20bf6]::interface::run_compiler<(), rustc_driver_impl[e814eafd5e9b0dbb]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  23:     0x7f592f3ec39c - <<std[3875e4e9fe9616d2]::thread::Builder>::spawn_unchecked_<rustc_interface[418b99c481e20bf6]::util::run_in_thread_with_globals<rustc_interface[418b99c481e20bf6]::util::run_in_thread_pool_with_globals<rustc_interface[418b99c481e20bf6]::interface::run_compiler<(), rustc_driver_impl[e814eafd5e9b0dbb]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[ea420da71ac079e7]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  24:     0x7f592f3f230d - std::sys::pal::unix::thread::Thread::new::thread_start::ha60715d44796f371
  25:     0x7f5928a916db - start_thread
  26:     0x7f59287ba61f - clone
  27:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/avr-rust/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/rustc-ice-2025-09-03T16_01_01-70.txt` to your bug report

note: compiler flags: --crate-type lib -C opt-level=z -C linker-plugin-lto -C strip=symbols -Z force-unstable-if-unmarked

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `core` (lib)

Not sure where to go from here to be honest.

Teascade avatar Sep 03 '25 16:09 Teascade