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]: Encountered errors while formatting message for codegen_ssa_apple_sdk_error_sdk_path #107370

Closed
3 of 4 tasks
Qyriad opened this issue Jan 27, 2023 · 4 comments · Fixed by #107096
Closed
3 of 4 tasks
Assignees
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Qyriad
Copy link

Qyriad commented Jan 27, 2023

Reproduce

This occurs with binary crate that is able to target macOS and is most visible when cross compiling. cargo new --bin is sufficient. The command cargo rustc --target=x86_64-apple-darwin -- -C linker-flavor=ld64.lld produces the error on Linux machines, with or without -C linker=/usr/bin/ld64.lld.

Affected release channels

  • Previous Stable
  • Current Stable
  • Current Beta
  • Current Nightly

Rust Version

$ rustc --version --verbose
rustc 1.67.0 (fc594f156 2023-01-24)
binary: rustc
commit-hash: fc594f15669680fa70d255faec3ca3fb507c3405
commit-date: 2023-01-24
host: x86_64-unknown-linux-gnu
release: 1.67.0
LLVM version: 15.0.6

Current error output

thread 'rustc' panicked at 'Encountered errors while formatting message for `codegen_ssa_apple_sdk_error_sdk_path`
help: Argument `error` exists but was not referenced correctly. Try using `{$error}` instead
attr: `None`
args: `FluentArgs([("error", String("No such file or directory (os error 2)")), ("sdk_name", String("macosx"))])`
errors: `[ResolverError(Reference(Message { id: "error", attribute: None }))]`', compiler/rustc_errors/src/translation.rs:123:21

Backtrace

stack backtrace:
   0:     0x7fcad0d656fa - std::backtrace_rs::backtrace::libunwind::trace::h34aec3ef6cd8ad7e
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fcad0d656fa - std::backtrace_rs::backtrace::trace_unsynchronized::h8035d38698d0f7a8
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fcad0d656fa - std::sys_common::backtrace::_print_fmt::hff968f6695a1ba22
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fcad0d656fa - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7eea0efe77acf1ec
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fcad0dc825e - core::fmt::write::hc553f17407eb0b48
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/fmt/mod.rs:1208:17
   5:     0x7fcad0d55a85 - std::io::Write::write_fmt::h62e5f01a089f48c0
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/io/mod.rs:1682:15
   6:     0x7fcad0d654c5 - std::sys_common::backtrace::_print::h52d116aff3db4cd1
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7fcad0d654c5 - std::sys_common::backtrace::print::h9e7d2f98fb7af075
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7fcad0d6820f - std::panicking::default_hook::{{closure}}::hf74999dab2d0a95c
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:267:22
   9:     0x7fcad0d67f4b - std::panicking::default_hook::hc11ca7d10c44c42f
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:286:9
  10:     0x7fcad4068c31 - rustc_driver[faf1f11f94aaf6ff]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fcad0d68a4d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::ha7dbb2d260f78172
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/alloc/src/boxed.rs:2032:9
  12:     0x7fcad0d68a4d - std::panicking::rust_panic_with_hook::hdb4da1ae79c845a5
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:692:13
  13:     0x7fcad0d687c9 - std::panicking::begin_panic_handler::{{closure}}::h02b5b35b126d5cf2
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:579:13
  14:     0x7fcad0d65bac - std::sys_common::backtrace::__rust_end_short_backtrace::h6c6853376cf416d1
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:137:18
  15:     0x7fcad0d684d2 - rust_begin_unwind
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:575:5
  16:     0x7fcad0dc4c43 - core::panicking::panic_fmt::hfd9e949092070b66
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/panicking.rs:64:14
  17:     0x7fcad35fd6cb - <rustc_errors[1b8cd632e3edc426]::emitter::EmitterWriter as rustc_errors[1b8cd632e3edc426]::translation::Translate>::translate_message
  18:     0x7fcad3607199 - <rustc_errors[1b8cd632e3edc426]::emitter::EmitterWriter>::emit_message_default::{closure#0}
  19:     0x7fcad35f4001 - <rustc_errors[1b8cd632e3edc426]::emitter::EmitterWriter as rustc_errors[1b8cd632e3edc426]::emitter::Emitter>::emit_diagnostic
  20:     0x7fcad35f2280 - <rustc_errors[1b8cd632e3edc426]::json::Diagnostic>::from_errors_diagnostic
  21:     0x7fcad35f1bac - <rustc_errors[1b8cd632e3edc426]::json::JsonEmitter as rustc_errors[1b8cd632e3edc426]::emitter::Emitter>::emit_diagnostic
  22:     0x7fcad2de0abe - <rustc_errors[1b8cd632e3edc426]::HandlerInner>::emit_diagnostic
  23:     0x7fcad2de0471 - <rustc_errors[1b8cd632e3edc426]::Handler>::emit_diagnostic
  24:     0x7fcad2d9dcad - <rustc_errors[1b8cd632e3edc426]::ErrorGuaranteed as rustc_errors[1b8cd632e3edc426]::diagnostic_builder::EmissionGuarantee>::diagnostic_builder_emit_producing_guarantee
  25:     0x7fcad3f075fd - <rustc_session[d01ee0491e5e5048]::parse::ParseSess>::emit_err::<rustc_codegen_ssa[46b0157ab6912f6]::errors::AppleSdkRootError>
  26:     0x7fcad375e289 - rustc_codegen_ssa[46b0157ab6912f6]::back::link::linker_with_args
  27:     0x7fcad373ba43 - rustc_codegen_ssa[46b0157ab6912f6]::back::link::link_natively
  28:     0x7fcad3736205 - rustc_codegen_ssa[46b0157ab6912f6]::back::link::link_binary
  29:     0x7fcad3734f04 - <rustc_codegen_llvm[f337fa1086678a42]::LlvmCodegenBackend as rustc_codegen_ssa[46b0157ab6912f6]::traits::backend::CodegenBackend>::link
  30:     0x7fcad3231c5b - <rustc_interface[1d25fa3620f328b6]::queries::Linker>::link
  31:     0x7fcad321b04b - rustc_span[5737ed96bfbdbd37]::with_source_map::<core[e12cfea94acfcb96]::result::Result<(), rustc_errors[1b8cd632e3edc426]::ErrorGuaranteed>, rustc_interface[1d25fa3620f328b6]::interface::run_compiler<core[e12cfea94acfcb96]::result::Result<(), rustc_errors[1b8cd632e3edc426]::ErrorGuaranteed>, rustc_driver[faf1f11f94aaf6ff]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  32:     0x7fcad321aa65 - <scoped_tls[85a67c9db469d989]::ScopedKey<rustc_span[5737ed96bfbdbd37]::SessionGlobals>>::set::<rustc_interface[1d25fa3620f328b6]::interface::run_compiler<core[e12cfea94acfcb96]::result::Result<(), rustc_errors[1b8cd632e3edc426]::ErrorGuaranteed>, rustc_driver[faf1f11f94aaf6ff]::run_compiler::{closure#1}>::{closure#0}, core[e12cfea94acfcb96]::result::Result<(), rustc_errors[1b8cd632e3edc426]::ErrorGuaranteed>>
  33:     0x7fcad321a052 - std[3da7f01c8c2aa3e3]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[1d25fa3620f328b6]::util::run_in_thread_pool_with_globals<rustc_interface[1d25fa3620f328b6]::interface::run_compiler<core[e12cfea94acfcb96]::result::Result<(), rustc_errors[1b8cd632e3edc426]::ErrorGuaranteed>, rustc_driver[faf1f11f94aaf6ff]::run_compiler::{closure#1}>::{closure#0}, core[e12cfea94acfcb96]::result::Result<(), rustc_errors[1b8cd632e3edc426]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e12cfea94acfcb96]::result::Result<(), rustc_errors[1b8cd632e3edc426]::ErrorGuaranteed>>
  34:     0x7fcad391ebea - <<std[3da7f01c8c2aa3e3]::thread::Builder>::spawn_unchecked_<rustc_interface[1d25fa3620f328b6]::util::run_in_thread_pool_with_globals<rustc_interface[1d25fa3620f328b6]::interface::run_compiler<core[e12cfea94acfcb96]::result::Result<(), rustc_errors[1b8cd632e3edc426]::ErrorGuaranteed>, rustc_driver[faf1f11f94aaf6ff]::run_compiler::{closure#1}>::{closure#0}, core[e12cfea94acfcb96]::result::Result<(), rustc_errors[1b8cd632e3edc426]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e12cfea94acfcb96]::result::Result<(), rustc_errors[1b8cd632e3edc426]::ErrorGuaranteed>>::{closure#1} as core[e12cfea94acfcb96]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  35:     0x7fcad0d72803 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha93239d92e7b610d
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/alloc/src/boxed.rs:2000:9
  36:     0x7fcad0d72803 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hebda57b0236de612
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/alloc/src/boxed.rs:2000:9
  37:     0x7fcad0d72803 - std::sys::unix::thread::Thread::new::thread_start::h1541b4390bbc26ca
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys/unix/thread.rs:108:17
  38:     0x7fcad0b058fd - <unknown>
  39:     0x7fcad0b87d20 - <unknown>
  40:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: 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: rustc 1.67.0 (fc594f156 2023-01-24) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C linker-flavor=ld64.lld -C linker=/usr/bin/ld64.lld -C incremental=[REDACTED]

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

query stack during panic:
end of query stack

Anything else?

I encountered this when cross compiling from Linux to macOS. Setting $SDKROOT to some path that does exist but isn't a valid macOS SDK gives the expected linker errors of not-found libraries and undefined symbols.

The correct linker errors, which occur with `SDKROOT=/usr` (or any other path that exists) error: linking with `/usr/bin/ld64.lld` failed: exit status: 1 | = note: "/usr/bin/ld64.lld" "-flavor" "darwin" "-arch" "x86_64" "-platform_version" "macos" "10.7" "10.7" "/tmp/rustcmRdv6R/symbols.o" "/home/qyriad/code/hello/target/x86_64-apple-darwin/debug/deps/hello-7ed2cd3132e5ea0d.26g0geex1k13oru9.rcgu.o" "/home/qyriad/code/hello/target/x86_64-apple-darwin/debug/deps/hello-7ed2cd3132e5ea0d.2kfapquck9om5nbv.rcgu.o" "/home/qyriad/code/hello/target/x86_64-apple-darwin/debug/deps/hello-7ed2cd3132e5ea0d.2t3gdrcxwz5f2emf.rcgu.o" "/home/qyriad/code/hello/target/x86_64-apple-darwin/debug/deps/hello-7ed2cd3132e5ea0d.3lx1xqdx4bz34wy1.rcgu.o" "/home/qyriad/code/hello/target/x86_64-apple-darwin/debug/deps/hello-7ed2cd3132e5ea0d.3zkhvxoukuri2hzc.rcgu.o" "/home/qyriad/code/hello/target/x86_64-apple-darwin/debug/deps/hello-7ed2cd3132e5ea0d.czomv88vqwv63hy.rcgu.o" "/home/qyriad/code/hello/target/x86_64-apple-darwin/debug/deps/hello-7ed2cd3132e5ea0d.4xpuzhu0nabigv2g.rcgu.o" "-L" "/home/qyriad/code/hello/target/x86_64-apple-darwin/debug/deps" "-L" "/home/qyriad/code/hello/target/debug/deps" "-L" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-5398d4db8ed2ff6f.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libobject-478a76a3581fca81.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libmemchr-6876f637b366443d.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-539c7e906abde336.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libgimli-83399a3f8aaf8f32.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-ffb3dc98877a45b4.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd_detect-067f58df60a72a89.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-faef232906858087.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libminiz_oxide-4f1ed014f3c75703.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libadler-749b556aef66aa6c.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-0b3b0361e5f0a714.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libunwind-72e9a1e277d7769c.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-357e8106cf3b63d5.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/liblibc-90980575ee007a80.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/liballoc-b73946858ff9839c.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-6dd5c0cef5b5f8b3.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libcore-7d2b712101daf86c.rlib" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-9b0bf4523e9805e9.rlib" "-lSystem" "-lc" "-lm" "-syslibroot" "/usr" "-L" "/home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/home/qyriad/code/hello/target/x86_64-apple-darwin/debug/deps/hello-7ed2cd3132e5ea0d" "-dead_strip" = note: ld64.lld: error: library not found for -lSystem ld64.lld: error: library not found for -lc ld64.lld: error: library not found for -lm ld64.lld: error: undefined symbol: __Unwind_Resume >>> referenced by function.rs:507 (/rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/ops/function.rs:507) >>> /home/qyriad/code/hello/target/x86_64-apple-darwin/debug/deps/hello-7ed2cd3132e5ea0d.2t3gdrcxwz5f2emf.rcgu.o:(symbol __ZN4core3ops8function6FnOnce9call_once17hf4bc1fd436eb6a1eE+0x1f) >>> referenced by function.rs:507 (library/core/src/ops/function.rs:507) >>> /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17hb84e30cb55012ce5E+0x80) >>> referenced by mod.rs:490 (library/core/src/ptr/mod.rs:490) >>> /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3ptr104drop_in_place$LT$alloc..vec..Vec$LT$$LP$usize$C$std..backtrace_rs..symbolize..gimli..Mapping$RP$$GT$$GT$17hed3f267c6b45955bE+0xd1) >>> referenced 89 more times
      ld64.lld: error: undefined symbol: _memcpy
      >>> referenced by intrinsics.rs:2433 (library/core/src/intrinsics.rs:2433)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3fmt5Write10write_char17hdfc69d6746a59f51E+0xd4)
      >>> referenced by intrinsics.rs:2433 (library/core/src/intrinsics.rs:2433)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$10write_char17h93a4c2621e683652E+0xe5)
      >>> referenced by intrinsics.rs:2433 (library/core/src/intrinsics.rs:2433)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$9write_str17h37febf5394bdf526E+0x38)
      >>> referenced 82 more times
      
      ld64.lld: error: undefined symbol: __Unwind_GetTextRelBase
      >>> referenced by gcc.rs:275 (library/std/src/personality/gcc.rs:275)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h8d16de3fdc0c0a05E+0xc)
      >>> referenced by gcc.rs:275 (library/std/src/personality/gcc.rs:275)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN3std11personality3gcc14find_eh_action28_$u7b$$u7b$closure$u7d$$u7d$17hebef1726d888f975E+0xc)
      
      ld64.lld: error: undefined symbol: __Unwind_GetDataRelBase
      >>> referenced by gcc.rs:276 (library/std/src/personality/gcc.rs:276)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17hb69dca3e57cf94bbE+0xc)
      >>> referenced by gcc.rs:276 (library/std/src/personality/gcc.rs:276)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN3std11personality3gcc14find_eh_action28_$u7b$$u7b$closure$u7d$$u7d$17hbca95bb609e12226E+0xc)
      
      ld64.lld: error: undefined symbol: _pthread_mutex_unlock
      >>> referenced by pthread_mutex.rs:112 (library/std/src/sys/unix/locks/pthread_mutex.rs:112)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3ptr175drop_in_place$LT$std..sys_common..remutex..ReentrantMutexGuard$LT$core..cell..RefCell$LT$std..io..buffered..linewriter..LineWriter$LT$std..io..stdio..StdoutRaw$GT$$GT$$GT$$GT$17h7737580f0f37fcd6E+0x2e)
      >>> referenced by pthread_mutex.rs:112 (library/std/src/sys/unix/locks/pthread_mutex.rs:112)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3ptr175drop_in_place$LT$std..sys_common..remutex..ReentrantMutexGuard$LT$core..cell..RefCell$LT$std..io..buffered..linewriter..LineWriter$LT$std..io..stdio..StdoutRaw$GT$$GT$$GT$$GT$17h7737580f0f37fcd6E+0x20)
      >>> referenced by pthread_mutex.rs:112 (library/std/src/sys/unix/locks/pthread_mutex.rs:112)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3ptr46drop_in_place$LT$std..io..stdio..StdinLock$GT$17hf0f24132fd49ff9eE+0x43)
      >>> referenced 7 more times
      
      ld64.lld: error: undefined symbol: _munmap
      >>> referenced by mmap_unix.rs:40 (library/std/src/../../backtrace/src/symbolize/gimli/mmap_unix.rs:40)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3ptr65drop_in_place$LT$std..backtrace_rs..symbolize..gimli..Mapping$GT$17hf85f5ce9a3e31452E+0xce)
      >>> referenced by mmap_unix.rs:40 (library/std/src/../../backtrace/src/symbolize/gimli/mmap_unix.rs:40)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3ptr65drop_in_place$LT$std..backtrace_rs..symbolize..gimli..Mapping$GT$17hf85f5ce9a3e31452E+0x31)
      >>> referenced by mmap_unix.rs:40 (library/std/src/../../backtrace/src/symbolize/gimli/mmap_unix.rs:40)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3ptr68drop_in_place$LT$std..backtrace_rs..symbolize..gimli..mmap..Mmap$GT$17hc7e97f0fcf430b3cE+0x6)
      >>> referenced 6 more times
      
      ld64.lld: error: undefined symbol: _pthread_rwlock_unlock
      >>> referenced by pthread_rwlock.rs:47 (library/std/src/sys/unix/locks/pthread_rwlock.rs:47)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3ptr71drop_in_place$LT$std..sync..rwlock..RwLockReadGuard$LT$$LP$$RP$$GT$$GT$17hd1e2d6a084e6fddbE+0x33)
      >>> referenced by pthread_rwlock.rs:47 (library/std/src/sys/unix/locks/pthread_rwlock.rs:47)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3ptr71drop_in_place$LT$std..sync..rwlock..RwLockReadGuard$LT$$LP$$RP$$GT$$GT$17hd1e2d6a084e6fddbE+0x1a)
      >>> referenced by pthread_rwlock.rs:47 (library/std/src/sys/unix/locks/pthread_rwlock.rs:47)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN3std3env7_var_os17h3777805ff41a36e7E+0xab)
      >>> referenced 3 more times
      
      ld64.lld: error: undefined symbol: _pthread_mutex_destroy
      >>> referenced by pthread_mutex.rs:85 (library/std/src/sys/unix/locks/pthread_mutex.rs:85)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3ptr73drop_in_place$LT$std..sys..unix..locks..pthread_mutex..AllocatedMutex$GT$17hd8239a4ac87360b9E+0x6)
      >>> referenced by pthread_mutex.rs:85 (library/std/src/sys/unix/locks/pthread_mutex.rs:85)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3ptr98drop_in_place$LT$alloc..boxed..Box$LT$std..sys..unix..locks..pthread_mutex..AllocatedMutex$GT$$GT$17hb027e78f6c4c6db8E+0xd)
      >>> referenced by pthread_mutex.rs:85 (library/std/src/sys/unix/locks/pthread_mutex.rs:85)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN5alloc4sync12Arc$LT$T$GT$9drop_slow17h1dfce2778cdf5d36E+0x6f)
      >>> referenced 1 more times
      
      ld64.lld: error: undefined symbol: _pthread_mutexattr_destroy
      >>> referenced by pthread_mutex.rs:127 (library/std/src/sys/unix/locks/pthread_mutex.rs:127)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3ptr75drop_in_place$LT$std..sys..unix..locks..pthread_mutex..PthreadMutexAttr$GT$17hca493304f47198a7E+0x6)
      >>> referenced by pthread_mutex.rs:127 (library/std/src/sys/unix/locks/pthread_mutex.rs:127)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN108_$LT$std..sys..unix..locks..pthread_mutex..AllocatedMutex$u20$as$u20$std..sys_common..lazy_box..LazyInit$GT$4init17ha3b0898f5c42f4f6E+0xdc)
      
      ld64.lld: error: undefined symbol: _pthread_rwlock_destroy
      >>> referenced by pthread_rwlock.rs:54 (library/std/src/sys/unix/locks/pthread_rwlock.rs:54)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3ptr75drop_in_place$LT$std..sys..unix..locks..pthread_rwlock..AllocatedRwLock$GT$17h7c423d2bc244a6ffE+0x6)
      >>> referenced by pthread_rwlock.rs:54 (library/std/src/sys/unix/locks/pthread_rwlock.rs:54)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN3std10sys_common8lazy_box16LazyBox$LT$T$GT$10initialize17h760b822df99198c6E+0x70)
      
      ld64.lld: error: undefined symbol: _memmove
      >>> referenced by intrinsics.rs:2519 (library/core/src/intrinsics.rs:2519)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core3ptr90drop_in_place$LT$std..io..buffered..bufwriter..BufWriter$LT$W$GT$..flush_buf..BufGuard$GT$17hcdc9da9cacd190baE+0x36)
      >>> referenced by intrinsics.rs:2519 (library/core/src/intrinsics.rs:2519)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN9addr2line16Context$LT$R$GT$11find_frames17he44479834bec168fE+0x269f)
      >>> referenced by intrinsics.rs:2519 (library/core/src/intrinsics.rs:2519)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN9addr2line16Context$LT$R$GT$11find_frames17he44479834bec168fE+0x1223)
      >>> referenced 18 more times
      
      ld64.lld: error: undefined symbol: _memcmp
      >>> referenced by cmp.rs:198 (library/core/src/slice/cmp.rs:198)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core5slice4sort12choose_pivot28_$u7b$$u7b$closure$u7d$$u7d$17h1db2e1cfbb6463b0E+0x13e)
      >>> referenced by cmp.rs:198 (library/core/src/slice/cmp.rs:198)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core5slice4sort12choose_pivot28_$u7b$$u7b$closure$u7d$$u7d$17h1db2e1cfbb6463b0E+0xda)
      >>> referenced by cmp.rs:198 (library/core/src/slice/cmp.rs:198)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN4core5slice4sort12choose_pivot28_$u7b$$u7b$closure$u7d$$u7d$17h1db2e1cfbb6463b0E+0x5a)
      >>> referenced 31 more times
      
      ld64.lld: error: undefined symbol: _pthread_mutex_trylock
      >>> referenced by pthread_mutex.rs:66 (library/std/src/sys/unix/locks/pthread_mutex.rs:66)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN5alloc4sync12Arc$LT$T$GT$9drop_slow17h1dfce2778cdf5d36E+0x17)
      >>> referenced by pthread_mutex.rs:118 (library/std/src/sys/unix/locks/pthread_mutex.rs:118)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN3std4sync4once4Once9call_once28_$u7b$$u7b$closure$u7d$$u7d$17h9c07188eab35bf0eE+0x1c2)
      >>> referenced by pthread_mutex.rs:118 (library/std/src/sys/unix/locks/pthread_mutex.rs:118)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN3std4sync4once4Once9call_once28_$u7b$$u7b$closure$u7d$$u7d$17h9c07188eab35bf0eE+0x7f)
      
      ld64.lld: error: undefined symbol: _dispatch_release
      >>> referenced by darwin.rs:128 (library/std/src/sys/unix/thread_parker/darwin.rs:128)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN5alloc4sync12Arc$LT$T$GT$9drop_slow17ha7ab73c110de5a07E+0x31)
      
      ld64.lld: error: undefined symbol: _abort
      >>> referenced by mod.rs:149 (library/std/src/sys/unix/mod.rs:149)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN3std2rt19lang_start_internal17hd56d2fa7efb2dd60E+0x570)
      >>> referenced by mod.rs:347 (library/std/src/sys/unix/mod.rs:347)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN3std3sys4unix14abort_internal17ha17a3eb079646e02E+0x5)
      
      ld64.lld: error: undefined symbol: ___error
      >>> referenced by os.rs:76 (library/std/src/sys/unix/os.rs:76)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN3std2rt19lang_start_internal17hd56d2fa7efb2dd60E+0x3a3)
      >>> referenced by os.rs:76 (library/std/src/sys/unix/os.rs:76)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN3std2rt19lang_start_internal17hd56d2fa7efb2dd60E+0x334)
      >>> referenced by os.rs:76 (library/std/src/sys/unix/os.rs:76)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN3std2rt19lang_start_internal17hd56d2fa7efb2dd60E+0xb5)
      >>> referenced 19 more times
      
      ld64.lld: error: undefined symbol: _mprotect
      >>> referenced by thread.rs:823 (library/std/src/sys/unix/thread.rs:823)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN3std2rt19lang_start_internal17hd56d2fa7efb2dd60E+0x256)
      >>> referenced by stack_overflow.rs:142 (library/std/src/sys/unix/stack_overflow.rs:142)
      >>>               /home/qyriad/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-apple-darwin/lib/libstd-c84f81b3d1a36b6e.rlib(std-c84f81b3d1a36b6e.std.0959ce86-cgu.0.rcgu.o):(symbol __ZN3std3sys4unix14stack_overflow3imp12make_handler17h50336235e5e30f96E+0x85)
      
      ld64.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)

On Rust 1.66.0, it simply emits the (non-internal) error: error: failed to get macosx SDK path: No such file or directory (os error 2), which makes sense.

I imagine this would also happen on non-cross builds targeting macOS if xcrun isn't available and $SDKROOT isn't set.

@Qyriad Qyriad 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 Jan 27, 2023
@Qyriad
Copy link
Author

Qyriad commented Jan 27, 2023

@rustbot label regression-from-stable-to-stable O-macos A-cross A-linkage

@rustbot rustbot added A-cross Area: Cross compilation A-linkage Area: linking into static, shared libraries and binaries O-macos Operating system: macOS regression-from-stable-to-stable Performance or correctness regression from one stable version to another. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Jan 27, 2023
@Noratrieb
Copy link
Member

This is an issue with a buggy translation message:

codegen_ssa_apple_sdk_error_sdk_path = failed to get {$sdk_name} SDK path: {error}

This should be {$error}, not {error}.

@Noratrieb Noratrieb added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. and removed A-linkage Area: linking into static, shared libraries and binaries O-macos Operating system: macOS A-cross Area: Cross compilation labels Jan 27, 2023
@clubby789
Copy link
Contributor

This is fixed as part of #107096

@Noratrieb
Copy link
Member

@rustbot assign @clubby789

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 27, 2023
…=compiler-errors

Detect references to non-existant messages in Fluent resources

Should help with cases like rust-lang#107091, where `{variable}` (a message reference) is accidentally typed, rather than `{$variable}` (a variable reference)

Fixes rust-lang#107370

`@rustbot` label +A-translation
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 28, 2023
…=compiler-errors

Detect references to non-existant messages in Fluent resources

Should help with cases like rust-lang#107091, where `{variable}` (a message reference) is accidentally typed, rather than `{$variable}` (a variable reference)

Fixes rust-lang#107370

``@rustbot`` label +A-translation
@bors bors closed this as completed in 53ccee0 Jan 28, 2023
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants