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

Installing cranelift error (mac m1) #89201

Closed
joshuef opened this issue Sep 23, 2021 · 7 comments
Closed

Installing cranelift error (mac m1) #89201

joshuef opened this issue Sep 23, 2021 · 7 comments
Labels
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.

Comments

@joshuef
Copy link

joshuef commented Sep 23, 2021

i was trying to install cranelift as per: https://github.com/bjorn3/rustc_codegen_cranelift/tree/61667dedf55e3e5aa584f7ae2bd0471336b92ce9

running y.rs I get:

RUST_BACKTRACE=1 ./y.rs prepare # download and patch sysroot src and install hyperfine for benchmarking
[BUILD] y.rs
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: "Provided allocation has wrong size for slot count 131072"', compiler/rustc_metadata/src/rmeta/decoder.rs:263:29
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: rustc_metadata::rmeta::decoder::CrateMetadata::new
   4: rustc_metadata::creader::CrateLoader::maybe_resolve_crate
   5: rustc_metadata::creader::CrateLoader::maybe_resolve_crate
   6: rustc_metadata::creader::CrateLoader::process_extern_crate
   7: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast::visit::Visitor>::visit_item
   8: rustc_ast::visit::walk_item
   9: <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor as rustc_ast::visit::Visitor>::visit_item
  10: rustc_expand::expand::AstFragment::visit_with
  11: rustc_resolve::macros::<impl rustc_expand::base::ResolverExpand for rustc_resolve::Resolver>::visit_ast_fragment_with_placeholders
  12: rustc_expand::expand::MacroExpander::collect_invocations
  13: rustc_expand::expand::MacroExpander::fully_expand_fragment
  14: rustc_expand::expand::MacroExpander::expand_crate
  15: rustc_session::utils::<impl rustc_session::session::Session>::time
  16: rustc_interface::passes::configure_and_expand
  17: rustc_interface::queries::Queries::expansion
  18: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  19: rustc_span::with_source_map
  20: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.57.0-nightly (aa8f2d432 2021-09-18) running on aarch64-apple-darwin

query stack during panic:
end of query stack```

(originally this was during the `info: installing component 'rustfmt'` step)
@joshuef joshuef 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 Sep 23, 2021
@Urgau
Copy link
Member

Urgau commented Sep 23, 2021

cc #89085; there was a issue preventing all builds from happening on Mac M1 with some nighties builds and it looks like the nightly used (nightly-2021-09-19) by y.rs is in fact one of them. You could try to set the nightly to channel = "nightly-2021-09-21" in the rust-toolchain file.

cc @bjorn3

@joshuef
Copy link
Author

joshuef commented Sep 24, 2021

tried that, but no joy:

[BUILD] y.rs
info: syncing channel updates for 'nightly-2021-09-21-aarch64-apple-darwin'
error: no release found for 'nightly-2021-09-21'

using nightly-2021-09-22 has gotten me past the prepare stage (and on to build issues, which appear to be more about the nightly used than anything compiler) eg.

error[E0599]: no function or associated item named `of_instance` found for struct `FnAbi` in the current scope
  --> src/base.rs:65:29
   |
65 |         fn_abi: Some(FnAbi::of_instance(&RevealAllLayoutCx(tcx), instance, &[])),
   |                             ^^^^^^^^^^^ function or associated item not found in `FnAbi<'_, _>

Thanks for the help @Urgau

@bjorn3
Copy link
Member

bjorn3 commented Sep 24, 2021

@joshuef I will update cg_clif for the latest nightly later today.

@bjorn3
Copy link
Member

bjorn3 commented Sep 24, 2021

Looks like #89092 is still in the bors queue, so I will wait with updating until it is merged to avoid accidentally messing up git subtree.

@bjorn3
Copy link
Member

bjorn3 commented Sep 27, 2021

Updated in bjorn3/rustc_codegen_cranelift@9e48f99. @joshuef does it work now?

@bjorn3
Copy link
Member

bjorn3 commented Sep 30, 2021

I expect this to be fixed now. If it doesn't please comment so that this issue can be re-opened.

@bjorn3 bjorn3 closed this as completed Sep 30, 2021
@joshuef
Copy link
Author

joshuef commented Oct 4, 2021

Yes, sorry, that's it sorted now 🎉 thanks so much 👍

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. 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.
Projects
None yet
Development

No branches or pull requests

3 participants