Librespot fails to compile on 32-bit Debian
I fail to compile spotifyd-0.2.24 on a 32-bit machine with Debian 10.3:
cargo install --path .
Installing spotifyd v0.2.24 (/home/patrik/Downloads/spotifyd-0.2.24)
Updating crates.io index
...
Compiling librespot-protocol v0.1.1
error[E0308]: mismatched types
--> /home/patrik/.cargo/registry/src/github.com-1ecc6299db9ec823/librespot-protocol-0.1.1/build.rs:45:39
|
45 | let p = parse_and_typecheck(&["proto"], &[src]).expect("protoc");
| ^^^^^^^ expected struct `std::path::Path`, found `str`
|
= note: expected reference `&std::path::Path`
found reference `&'static str`
error[E0308]: mismatched types
--> /home/patrik/.cargo/registry/src/github.com-1ecc6299db9ec823/librespot-protocol-0.1.1/build.rs:45:51
|
45 | let p = parse_and_typecheck(&["proto"], &[src]).expect("protoc");
| ^^^ expected struct `std::path::Path`, found struct `std::string::String`
|
= note: expected reference `&std::path::Path`
found reference `&std::string::String`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0308`.
error: could not compile `librespot-protocol`.
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `spotifyd v0.2.24 (/home/patrik/Downloads/spotifyd-0.2.24)`, intermediate artifacts can be found at `/home/patrik/Downloads/spotifyd-0.2.24/target`
Caused by:
build failed
Seems related to https://github.com/librespot-org/librespot/issues/460
I see the same issue with Ubuntu 20.04 when trying to build and install, but compiling the application with 'cargo build --release' works. The resulting spotifyd executable in target/release can then be copied to your bin directory to install it.
Thanks, that seems to work.
Same behaviour on Debian 10 64bit. The daemon is working fine after the build command, although I haven't copied the binaries anywhere in my PATH. I'm wondering why the (second) compilation of the install command fails, and why it is needed in the first place.
I'm also having the same issue on OpenBSD 6.7 everything else seems to build fine except for this one dep, I'm using cargo build --release --no-default-features --features portaudio_backend
Probably an outdated compiler version that the OS ships with or has in its repo. Try to use the one provided by https://rustup.rs
Nvm. It might be a minor version change messing around as well. I need to investigate this but we are waiting anyway for a new librespot version that fixes the protobuf definitions. So this will be tackled down in the same swoop.
Personally I've tried to compile it with the latest version of Rust installed with rustup, so I'm pretty sure I used the best version in town, still: the build command succedes, while the install command fails.
The install command is not part of spotifyd though. They might have changed something on cargo's side. Maybe you're missing folder rights as well. @cansi
@SirWindfield understood. I don't think I've tried to install it with root privileges now that you mention it... I'll try again soon.
Just redone it: same error.
Personally I've tried to compile it with the latest version of Rust installed with rustup, so I'm pretty sure I used the best version in town, still: the build command succedes, while the install command fails.
cargo install doesn't respect a packages Cargo.lock will pull dependencies based on semver. This causes issues, as it ends up pulling
the latest version of protobuf-pure that unfortunately included a breaking change as a minor version bump..
Oh ye, try to do it with cargo run/build --locked. This respects the lockfile.
Oh ye, try to do it with
cargo run/build --locked. This respects the lockfile.
cargo build will use a lockfile if already preset, else create one on the first run. Since this repo has Cargo.lock is checked in, it should respects it, without the explicit --locked flag. (I think?)
still: the build command succedes, while the install command fails.
This is probably why cargo build succeeds but cargo install fails..
Hopefully one of the other Librespot maintainers steps in soon, I am a bit disinclined messing with the master branch..
For reference: https://github.com/rust-lang/cargo/issues/7169
And I didn't actually know that build does use the file by default, TIL.
I can confirm that issuing
cargo install --path . --locked
builds and installs spotifyd. I am building with the latest rust version 1.44.0 and Ubuntu 20.04.
Perhaps the README.md file could be updated to clarify the command needed to install the package.
I'll close and mark the issue as advice. The wiki overall needs a little bit more love and most of the stuff inside the readme can be ported over to de-clutter it a little bit :)