spotifyd icon indicating copy to clipboard operation
spotifyd copied to clipboard

Librespot fails to compile on 32-bit Debian

Open bphermansson opened this issue 6 years ago • 15 comments

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

bphermansson avatar May 13 '20 17:05 bphermansson

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.

buck10 avatar May 14 '20 11:05 buck10

Thanks, that seems to work.

bphermansson avatar May 15 '20 05:05 bphermansson

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.

cansi avatar May 25 '20 12:05 cansi

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

jessebarton avatar Jun 01 '20 01:06 jessebarton

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.

mainrs avatar Jun 11 '20 22:06 mainrs

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.

cansi avatar Jun 12 '20 13:06 cansi

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

mainrs avatar Jun 12 '20 18:06 mainrs

@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.

cansi avatar Jun 12 '20 19:06 cansi

Just redone it: same error.

cansi avatar Jun 12 '20 19:06 cansi

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..

ashthespy avatar Jun 13 '20 22:06 ashthespy

Oh ye, try to do it with cargo run/build --locked. This respects the lockfile.

mainrs avatar Jun 15 '20 16:06 mainrs

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..

ashthespy avatar Jun 15 '20 16:06 ashthespy

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.

mainrs avatar Jun 15 '20 18:06 mainrs

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.

buck10 avatar Jun 17 '20 00:06 buck10

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 :)

mainrs avatar Jul 11 '20 08:07 mainrs