Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation issue: HeaderMap #343

Open
auronandace opened this issue Jun 29, 2024 · 1 comment
Open

Compilation issue: HeaderMap #343

auronandace opened this issue Jun 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@auronandace
Copy link

auronandace commented Jun 29, 2024

Environment & Versions

  • System: VoidLinux (kernel 6.6.35, alacritty 0.13.2, glibc)
  • Termusic version: 0.9.0
  • Rust version: 1.79.0

Logs:
compilation error, please see below

Description of the Problem

Failed to compile when using: cargo install termusic.
When trying to compile the following error is displayed:

error[E0308]: mismatched types
   --> /home/auronandace/.cargo/registry/src/index.crates.io-6f17d22bba15001f/termusic-playback-0.9.0/src/rusty_backend/mod.rs:656:60
    |
656 |             let client = Client::builder().default_headers(headers).build().unwrap();
    |                                            --------------- ^^^^^^^ expected `HeaderMap`, found `reqwest::header::HeaderMap`
    |                                            |
    |                                            arguments to this method are incorrect
    |
    = note: `reqwest::header::HeaderMap` and `HeaderMap` have similar names, but are actually distinct types
note: `reqwest::header::HeaderMap` is defined in crate `http`
   --> /home/auronandace/.cargo/registry/src/index.crates.io-6f17d22bba15001f/http-0.2.12/src/header/map.rs:45:1
    |
45  | pub struct HeaderMap<T = HeaderValue> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: `HeaderMap` is defined in crate `http`
   --> /home/auronandace/.cargo/registry/src/index.crates.io-6f17d22bba15001f/http-1.1.0/src/header/map.rs:45:1
    |
45  | pub struct HeaderMap<T = HeaderValue> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `http` are being used?
note: method defined here
   --> /home/auronandace/.cargo/registry/src/index.crates.io-6f17d22bba15001f/reqwest-0.12.5/src/async_impl/client.rs:826:12
    |
826 |     pub fn default_headers(mut self, headers: HeaderMap) -> ClientBuilder {
    |            ^^^^^^^^^^^^^^^

It appears to be confusing HeaderMap from versions 0.2.12 and 1.1.0 of the http crate.

It does compile fine when using cargo install --locked termusic.

@auronandace auronandace added the bug Something isn't working label Jun 29, 2024
@hasezoey
Copy link
Contributor

somewhat known issue, it is already fixed in master but no new version has been posted yet.

i recommend to directly install from git (cargo install --git https://github.com/tramhao/termusic.git, though i dont actually know if this only works for a single package or a whole workspace), or clone first and then manually install (cargo build --release && cp -f ./target/release/{termusic,termusic-server} ${CARGO_HOME}/bin/).
or if you are using arch, consider trying termusic-git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants