librespot-org / librespot

Open Source Spotify client library
MIT License
4.8k stars 602 forks source link

Cannot compile librespot #1173

Closed jmennecart closed 1 year ago

jmennecart commented 1 year ago

Hello,

I'mctrying to compile librespot without success. Each time an error occurs. I tryied to delete all files and get again, same problem.

Compile directive is :
cargo build --release --no-default-features

and the result : Compiling librespot-protocol v0.5.0-dev (/home/airplay/librespot/protocol) /home/airplay/.rustup/toolchains/stable-arm-unknown-linux-gnueabihf/bin/../lib/librustc_driver-d9d4471c0634a852.so(+0x7eb198)[0xaf4c7198] /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer+0x0)[0xaea17900] error: could not compile librespot-protocol (lib)

Caused by: process didn't exit successfully: rustc --crate-name librespot_protocol --edition=2021 protocol/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=237 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=83bf54a3d67a6e87 -C extra-filename=-83bf54a3d67a6e87 --out-dir /home/airplay/librespot/target/release/deps -L dependency=/home/airplay/librespot/target/release/deps --extern protobuf=/home/airplay/librespot/target/release/deps/libprotobuf-0485858edd1ca021.rmeta (signal: 11, SIGSEGV: invalid memory reference)

any ideas ? Thanks in advance

roderickvd commented 1 year ago

Don't know.

jmennecart commented 1 year ago

Hi roderickvd Thanks for your reply.

  1. Yes, an error happens also when I compile with default features but the error is different
  2. Yes, the environment is clean, I downloaded the git project in a new directory
  3. Yes, I just installed Rust from the official site before compiling the project
  4. No, I did the compilation directly on the raspberry (pi zero w) that will embed librespot, it took approximately 12 hours
roderickvd commented 1 year ago

Bullet 4 may be it. I think the kernel tends to kill long-running, non-responsive processes. If that’s a parallel compilation process, well, then there goes your reference.

You may want to try having only a single job (I think -j1 or otherwise in .cargo/config) or try cross-compiling on another host.

jmennecart commented 1 year ago

Thanks for you advice. I compiled it on a raspberry pi 4 with success. Many thanks