Spotifyd / spotifyd

A spotify daemon
https://spotifyd.rs
GNU General Public License v3.0
9.89k stars 452 forks source link

does not compile on raspbian, "unstable feature" #352

Closed blaueente closed 5 years ago

blaueente commented 5 years ago

I wanted to build spotifyd with pulseaudio on a current raspbian 10 buster. rustc 1.34.2+dfsg1-1+rpi1 cargo 0.35.0-2+rpi1

both of the following attemps failed simliarly: cargo build --release --features="pulseaudio_backend" --verbose cargo build --release --verbose

The error (here from pulseaudio attempt):

     Running `rustc --crate-name rand_core /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_core-0.3.1/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C opt-level=3 --cfg 'feature="alloc"' --cfg 'feature="rand_core"' --cfg 'feature="std"' -C metadata=050ddc53f405428c -C extra-filename=-050ddc53f405428c --out-dir /home/pi/build/spotifyd/target/release/deps -L dependency=/home/pi/build/spotifyd/target/release/deps --extern rand_core=/home/pi/build/spotifyd/target/release/deps/librand_core-c9ea3792a7f84cf1.rlib --cap-lints allow`
error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
  --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/whoami-0.5.3/src/unix.rs:60:22
   |
60 |     let mut buffer = mem::MaybeUninit::<[u8; BUF_SIZE]>::uninit();
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
  --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/whoami-0.5.3/src/unix.rs:61:22
   |
61 |     let mut passwd = mem::MaybeUninit::<PassWd>::uninit();
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
  --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/whoami-0.5.3/src/unix.rs:62:23
   |
62 |     let mut _passwd = mem::MaybeUninit::<*mut PassWd>::uninit();
   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/whoami-0.5.3/src/unix.rs:157:22
    |
157 |     let mut string = mem::MaybeUninit::<[u8; 256]>::uninit();
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

   Compiling rand_jitter v0.1.4
     Running `rustc --crate-name rand_jitter /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_jitter-0.1.4/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C opt-level=3 --cfg 'feature="rand_core"' --cfg 'feature="std"' -C metadata=226b12bd24ef869a -C extra-filename=-226b12bd24ef869a --out-dir /home/pi/build/spotifyd/target/release/deps -L dependency=/home/pi/build/spotifyd/target/release/deps --extern rand_core=/home/pi/build/spotifyd/target/release/deps/librand_core-c9ea3792a7f84cf1.rlib --cap-lints allow`
error[E0599]: no function or associated item named `uninit` found for type `std::mem::MaybeUninit<[u8; 16384]>` in the current scope
  --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/whoami-0.5.3/src/unix.rs:60:58
   |
60 |     let mut buffer = mem::MaybeUninit::<[u8; BUF_SIZE]>::uninit();
   |                      ------------------------------------^^^^^^
   |                      |
   |                      function or associated item not found in `std::mem::MaybeUninit<[u8; 16384]>`

error[E0599]: no function or associated item named `uninit` found for type `std::mem::MaybeUninit<unix::PassWd>` in the current scope
  --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/whoami-0.5.3/src/unix.rs:61:50
   |
61 |     let mut passwd = mem::MaybeUninit::<PassWd>::uninit();
   |                      ----------------------------^^^^^^
   |                      |
   |                      function or associated item not found in `std::mem::MaybeUninit<unix::PassWd>`

error[E0599]: no function or associated item named `uninit` found for type `std::mem::MaybeUninit<*mut unix::PassWd>` in the current scope
  --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/whoami-0.5.3/src/unix.rs:62:56
   |
62 |     let mut _passwd = mem::MaybeUninit::<*mut PassWd>::uninit();
   |                       ---------------------------------^^^^^^
   |                       |
   |                       function or associated item not found in `std::mem::MaybeUninit<*mut unix::PassWd>`

error[E0599]: no function or associated item named `uninit` found for type `std::mem::MaybeUninit<[u8; 256]>` in the current scope
   --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/whoami-0.5.3/src/unix.rs:157:53
    |
157 |     let mut string = mem::MaybeUninit::<[u8; 256]>::uninit();
    |                      -------------------------------^^^^^^
    |                      |
    |                      function or associated item not found in `std::mem::MaybeUninit<[u8; 256]>`

error: aborting due to 8 previous errors

Some errors occurred: E0599, E0658.
For more information about an error, try `rustc --explain E0599`.
error: Could not compile `whoami`.

Caused by:
  process didn't exit successfully: `rustc --edition=2018 --crate-name whoami /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/whoami-0.5.3/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=075fcf86b0cd331e -C extra-filename=-075fcf86b0cd331e --out-dir /home/pi/build/spotifyd/target/release/deps -L dependency=/home/pi/build/spotifyd/target/release/deps --cap-lints allow` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error: build failed
mainrs commented 5 years ago

make sure to update rust to the latest stable version using

rustup self update
rustup update
blaueente commented 5 years ago

Thanks! I pinned rust 1.37 and cargo from debian testing [1] instead, as I didn't want to litter my system, and then the build went through successfully.

[1] deb http://ftp.de.debian.org/debian/ testing main contrib non-free

unmanagedtn commented 5 years ago

I solved this by running the command curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh after uninstalling rustc with apt

Think there needs to be a howto to install on debian in the wiki