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

Compilation failed: thread 'rustc' panicked at 'Failed to get crate data for crate179' #37

Closed
xJonathanLEI opened this issue Jun 3, 2021 · 3 comments

Comments

@xJonathanLEI
Copy link

Platform

Linux 65fe86937035 5.4.0-73-generic #82-Ubuntu SMP Wed Apr 14 17:39:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux`

Description

I'm trying to cross-compile a Rust application that depends on ethers-rs with the help of rust-musl-cross. However, compilation fails and after some debugging, I found ethers-rs to be the one causing the error.

I'm not opening this issue on ethers-rs as that library can be compiled outside rust-musl-cross without issues.

Steps to Reproduce

Create a Dockerfile anywhere with the following content:

FROM messense/rust-musl-cross:x86_64-musl

RUN git clone https://github.com/gakonst/ethers-rs && \
    cd ethers-rs && \
    cargo build

Run:

$ docker build .

Expected Result

Compilation succeeds.

Actual Result

Compilation fails with:

   Compiling ethers-contract-abigen v0.2.2 (/home/rust/src/ethers-rs/ethers-contract/ethers-contract-abigen)
   Compiling ethers-providers v0.2.2 (/home/rust/src/ethers-rs/ethers-providers)
   Compiling ethers-contract-derive v0.2.2 (/home/rust/src/ethers-rs/ethers-contract/ethers-contract-derive)
   Compiling ethers-contract v0.2.2 (/home/rust/src/ethers-rs/ethers-contract)
thread 'rustc' panicked at 'Failed to get crate data for crate179', compiler/rustc_metadata/src/creader.rs:136:32
note: run with `RUST_BACKTRACE=1` environment variable to display a 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.52.1 (9bc8c42bb 2021-05-09) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C linker=x86_64-unknown-linux-musl-gcc -C incremental --crate-type lib

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

query stack during panic:
end of query stack
error: could not compile `ethers-contract`

To learn more, run the command again with --verbose.
@messense
Copy link
Member

messense commented Jun 3, 2021

Might be an upstream rustc issue, see rust-lang/rust#56935 and rust-lang/rust#85386

@xJonathanLEI
Copy link
Author

Thank for the quick reply! Taking a look at the referenced issues now.

@xJonathanLEI
Copy link
Author

Strangely enough, adding the following to my Cargo.toml solves the issue.

openssl = { version = "0.10.34", features = ["vendored"] }

Turns out it's related to OpenSSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants