aome510 / spotify-player

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

Cargo install issue #116

Closed Sloff closed 1 year ago

Sloff commented 1 year ago

Describe the bug Installing spotify-player via cargo gives a build error

To Reproduce Run cargo install spotify_player --features image

Expected behavior The build should happen successfully

Error message

Compiling viuer v0.6.2
   Compiling rspotify v0.11.6
   Compiling dirs-next v2.0.0
   Compiling rpassword v7.2.0
   Compiling config_parser2 v0.1.4
   Compiling librespot-connect v0.4.2
   Compiling toml v0.5.11
   Compiling lru v0.8.1
   Compiling spotify_player v0.10.0
error[E0053]: method `parse` has an incompatible type for trait
  --> /Users/sloff/.cargo/registry/src/github.com-1ecc6299db9ec823/spotify_player-0.10.0/src/config/mod.rs:20:30
   |
20 | #[derive(Debug, Deserialize, ConfigParse)]
   |                              ^^^^^^^^^^^
   |                              |
   |                              expected enum `toml::value::Value`, found enum `toml::Value`
   |                              help: change the parameter type to match the trait: `toml::value::Value`
   |
   = note: expected fn pointer `fn(&mut AppConfig, toml::value::Value) -> std::result::Result<_, _>`
              found fn pointer `fn(&mut AppConfig, toml::Value) -> std::result::Result<_, _>`
   = note: this error originates in the derive macro `ConfigParse` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0053]: method `parse` has an incompatible type for trait
  --> /Users/sloff/.cargo/registry/src/github.com-1ecc6299db9ec823/spotify_player-0.10.0/src/config/mod.rs:57:30
   |
57 | #[derive(Debug, Deserialize, ConfigParse, Clone)]
   |                              ^^^^^^^^^^^
   |                              |
   |                              expected enum `toml::value::Value`, found enum `toml::Value`
   |                              help: change the parameter type to match the trait: `toml::value::Value`
   |
   = note: expected fn pointer `fn(&mut DeviceConfig, toml::value::Value) -> std::result::Result<_, _>`
              found fn pointer `fn(&mut DeviceConfig, toml::Value) -> std::result::Result<_, _>`
   = note: this error originates in the derive macro `ConfigParse` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
  --> /Users/sloff/.cargo/registry/src/github.com-1ecc6299db9ec823/spotify_player-0.10.0/src/config/mod.rs:20:30
   |
20 | #[derive(Debug, Deserialize, ConfigParse)]
   |                              ^^^^^^^^^^^
   |                              |
   |                              expected enum `toml::value::Value`, found enum `toml::Value`
   |                              arguments to this function are incorrect
   |
   = note: enum `toml::Value` and enum `toml::value::Value` have similar names, but are actually distinct types
note: enum `toml::Value` is defined in crate `toml`
  --> /Users/sloff/.cargo/registry/src/github.com-1ecc6299db9ec823/toml-0.5.11/src/value.rs:22:1
   |
22 | pub enum Value {
   | ^^^^^^^^^^^^^^
note: enum `toml::value::Value` is defined in crate `toml`
  --> /Users/sloff/.cargo/registry/src/github.com-1ecc6299db9ec823/toml-0.7.1/src/value.rs:25:1
   |
25 | pub enum Value {
   | ^^^^^^^^^^^^^^
   = note: perhaps two different versions of crate `toml` are being used?
note: associated function defined here
  --> /Users/sloff/.cargo/registry/src/github.com-1ecc6299db9ec823/config_parser2-0.1.4/src/lib.rs:4:8
   |
4  |     fn parse(&mut self, value: toml::Value) -> Result<()>;
   |        ^^^^^
   = note: this error originates in the derive macro `ConfigParse` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
  --> /Users/sloff/.cargo/registry/src/github.com-1ecc6299db9ec823/spotify_player-0.10.0/src/config/mod.rs:57:30
   |
57 | #[derive(Debug, Deserialize, ConfigParse, Clone)]
   |                              ^^^^^^^^^^^
   |                              |
   |                              expected enum `toml::value::Value`, found enum `toml::Value`
   |                              arguments to this function are incorrect
   |
   = note: enum `toml::Value` and enum `toml::value::Value` have similar names, but are actually distinct types
note: enum `toml::Value` is defined in crate `toml`
  --> /Users/sloff/.cargo/registry/src/github.com-1ecc6299db9ec823/toml-0.5.11/src/value.rs:22:1
   |
22 | pub enum Value {
   | ^^^^^^^^^^^^^^
note: enum `toml::value::Value` is defined in crate `toml`
  --> /Users/sloff/.cargo/registry/src/github.com-1ecc6299db9ec823/toml-0.7.1/src/value.rs:25:1
   |
25 | pub enum Value {
   | ^^^^^^^^^^^^^^
   = note: perhaps two different versions of crate `toml` are being used?
note: associated function defined here
  --> /Users/sloff/.cargo/registry/src/github.com-1ecc6299db9ec823/config_parser2-0.1.4/src/lib.rs:4:8
   |
4  |     fn parse(&mut self, value: toml::Value) -> Result<()>;
   |        ^^^^^
   = note: this error originates in the derive macro `ConfigParse` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: `?` operator has incompatible types
   --> /Users/sloff/.cargo/registry/src/github.com-1ecc6299db9ec823/spotify_player-0.10.0/src/config/mod.rs:135:28
    |
135 |                 self.parse(toml::from_str::<toml::Value>(&content)?)?;
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `toml::value::Value`, found enum `toml::Value`
    |
    = note: `?` operator cannot convert from `toml::Value` to `toml::value::Value`
    = note: enum `toml::Value` and enum `toml::value::Value` have similar names, but are actually distinct types
note: enum `toml::Value` is defined in crate `toml`
   --> /Users/sloff/.cargo/registry/src/github.com-1ecc6299db9ec823/toml-0.5.11/src/value.rs:22:1
    |
22  | pub enum Value {
    | ^^^^^^^^^^^^^^
note: enum `toml::value::Value` is defined in crate `toml`
   --> /Users/sloff/.cargo/registry/src/github.com-1ecc6299db9ec823/toml-0.7.1/src/value.rs:25:1
    |
25  | pub enum Value {
    | ^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `toml` are being used?

Some errors have detailed explanations: E0053, E0308.
For more information about an error, try `rustc --explain E0053`.
error: could not compile `spotify_player` due to 5 previous errors
error: failed to compile `spotify_player v0.10.0`, intermediate artifacts can be found at `/var/folders/2y/5qx2g9s551s2tcrvmvh092d00000gn/T/cargo-installiFubNE`

Environment

Sloff commented 1 year ago

Some more context on this, I am able to use the binary for version 0.10.0, would just like to have that image feature as well

Foxtrod89 commented 1 year ago

same here

Some errors have detailed explanations: E0053, E0308.
For more information about an error, try `rustc --explain E0053`.
error: could not compile `spotify_player` due to 5 previous errors
error: failed to compile `spotify_player v0.10.0`, intermediate artifacts can be found at `/var/folders/28/74pc_73n1qqfnhwls6cm0_640000gn/T/cargo-installJLms0G`

macOS BigSur 11.6

aome510 commented 1 year ago

Hi @Foxtrod89 @Sloff, looks like this happened because of the changes I made in my other package (https://github.com/aome510/hackernews-TUI). cargo install seems to ignore Cargo.lock [1] and automatically upgrades some dependencies (config_parser).

Still, I believe this issue can be fixed by adding --locked flag, so cargo install spotify_player --features image --locked.

[1]: https://github.com/rust-lang/cargo/issues/7169

Sloff commented 1 year ago

Working with the --locked flag! Thank you!