aome510 / spotify-player

A Spotify player in the terminal with full feature parity
MIT License
3.54k stars 152 forks source link

Compilation error with `cargo install` #560

Closed Caleb9 closed 1 month ago

Caleb9 commented 1 month ago

Describe the bug

There seems to be a compilation error on 32bit ARMv7l with Rust 1.80.1

To Reproduce cargo install spotify_player --no-default-features --features alsa-backend

Log and backtrace

   Compiling spotify_player v0.19.1
error[E0308]: `match` arms have incompatible types
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/spotify_player-0.19.1/src/state/model.rs:259:25
    |
257 |               let id = match track.linked_from {
    |  ______________________-
258 | |                 Some(d) => d.id,
    | |                            ---- this is found to be of type `std::option::Option<rspotify::rspotify_model::TrackId<'_>>`
259 | |                 None => track.id?,
    | |                         ^^^^^^^^^ expected `Option<TrackId<'_>>`, found `TrackId<'_>`
260 | |             };
    | |_____________- `match` arms have incompatible types
    |
    = note: expected enum `std::option::Option<rspotify::rspotify_model::TrackId<'_>>`
             found struct `rspotify::rspotify_model::TrackId<'_>`
help: try wrapping the expression in `Some`
    |
259 |                 None => Some(track.id?),
    |                         +++++         +

error[E0308]: `match` arms have incompatible types
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/spotify_player-0.19.1/src/state/model.rs:280:25
    |
278 |               let id = match track.linked_from {
    |  ______________________-
279 | |                 Some(d) => d.id,
    | |                            ---- this is found to be of type `std::option::Option<rspotify::rspotify_model::TrackId<'_>>`
280 | |                 None => track.id?,
    | |                         ^^^^^^^^^ expected `Option<TrackId<'_>>`, found `TrackId<'_>`
281 | |             };
    | |_____________- `match` arms have incompatible types
    |
    = note: expected enum `std::option::Option<rspotify::rspotify_model::TrackId<'_>>`
             found struct `rspotify::rspotify_model::TrackId<'_>`
help: try wrapping the expression in `Some`
    |
280 |                 None => Some(track.id?),
    |                         +++++         +

For more information about this error, try `rustc --explain E0308`.
error: could not compile `spotify_player` (bin "spotify_player") due to 2 previous errors
error: failed to compile `spotify_player v0.19.1`, intermediate artifacts can be found at `/tmp/cargo-installaOU53A`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Environment

aome510 commented 1 month ago

Can you try again with —locked? More details https://doc.rust-lang.org/cargo/commands/cargo-install.html#dealing-with-the-lockfile

Caleb9 commented 1 month ago

Can you try again with —locked? More details https://doc.rust-lang.org/cargo/commands/cargo-install.html#dealing-with-the-lockfile

Yup, that did it. Awesome, thanks. I learned something new about cargo today :).