[GH-ISSUE #460] cannot build ncspot with cargo #289

Closed
opened 2026-02-27 19:29:50 +03:00 by kerem · 5 comments
Owner

Originally created by @dmaglio on GitHub (Apr 13, 2020).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/460

   Compiling librespot-protocol v0.1.1
error[E0308]: mismatched types
  --> /home/davidemaglio/.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/davidemaglio/.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`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `ncspot v0.1.3`, intermediate artifacts can be found at `/tmp/cargo-installbsLCky`

Caused by:
  build failed

Originally created by @dmaglio on GitHub (Apr 13, 2020). Original GitHub issue: https://github.com/librespot-org/librespot/issues/460 ``` Compiling librespot-protocol v0.1.1 error[E0308]: mismatched types --> /home/davidemaglio/.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/davidemaglio/.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`. warning: build failed, waiting for other jobs to finish... error: failed to compile `ncspot v0.1.3`, intermediate artifacts can be found at `/tmp/cargo-installbsLCky` Caused by: build failed ```
kerem 2026-02-27 19:29:50 +03:00
Author
Owner

@ghost commented on GitHub (Apr 15, 2020):

Same here.

$ cargo install librespot
...
   Compiling librespot-protocol v0.1.1
error[E0308]: mismatched types
  --> /home/me/.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/me/.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`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `librespot v0.1.1`, intermediate artifacts can be found at `/tmp/cargo-installhkxtbM`

Caused by:
  build failed

$ rustc --version
rustc 1.42.0 (b8cedc004 2020-03-09)
<!-- gh-comment-id:613902498 --> @ghost commented on GitHub (Apr 15, 2020): Same here. $ cargo install librespot ... Compiling librespot-protocol v0.1.1 error[E0308]: mismatched types --> /home/me/.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/me/.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`. warning: build failed, waiting for other jobs to finish... error: failed to compile `librespot v0.1.1`, intermediate artifacts can be found at `/tmp/cargo-installhkxtbM` Caused by: build failed --- $ rustc --version rustc 1.42.0 (b8cedc004 2020-03-09)
Author
Owner

@otceliker commented on GitHub (Apr 15, 2020):

Had the same problem. Cloning the ncspot repository and compiling with cargo build --release solved it for me, if it helps.

<!-- gh-comment-id:614002557 --> @otceliker commented on GitHub (Apr 15, 2020): Had the same problem. Cloning the ncspot repository and compiling with `cargo build --release` solved it for me, if it helps.
Author
Owner

@ghost commented on GitHub (Apr 15, 2020):

You're right @otceliker, this worked. Thank you for the hint.

<!-- gh-comment-id:614067075 --> @ghost commented on GitHub (Apr 15, 2020): You're right @otceliker, this worked. Thank you for the hint.
Author
Owner

@ashthespy commented on GitHub (Apr 17, 2020):

Any other crate that uses librespot-protocol will run into this issue, as we don't pin our version, and https://github.com/stepancheg/rust-protobuf/pull/406 breaks our parsing..

<!-- gh-comment-id:615395986 --> @ashthespy commented on GitHub (Apr 17, 2020): Any other crate that uses `librespot-protocol` will run into this issue, as we don't pin our version, and https://github.com/stepancheg/rust-protobuf/pull/406 breaks our parsing..
Author
Owner

@Johannesd3 commented on GitHub (May 4, 2021):

Seems it was fixed by e97911e3cf 8 months ago. We could remove the version restriction again.

<!-- gh-comment-id:831878007 --> @Johannesd3 commented on GitHub (May 4, 2021): Seems it was fixed by e97911e3cfcb85b524e844d0ef5417bbee1e4970 8 months ago. We could remove the version restriction again.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#289
No description provided.