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

Installation fails #185

Closed
rvolgers opened this issue Jan 30, 2021 · 9 comments
Closed

Installation fails #185

rvolgers opened this issue Jan 30, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@rvolgers
Copy link

When I follow the install instructions (cargo install cargo-geiger), I get:

error[E0283]: type annotations needed
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-0.46.1/src/cargo/util/config/de.rs:471:63
    |
471 |                 seed.deserialize(Tuple2Deserializer(1i32, env.as_ref()))
    |                                                           ----^^^^^^--
    |                                                           |   |
    |                                                           |   cannot infer type for type parameter `T` declared on the trait `AsRef`
    |                                                           this method call resolves to `&T`
    |
    = note: cannot satisfy `std::string::String: AsRef<_>`
help: use the fully qualified path for the potential candidates
    |
471 |                 seed.deserialize(Tuple2Deserializer(1i32, <std::string::String as AsRef<OsStr>>::as_ref(env)))
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
471 |                 seed.deserialize(Tuple2Deserializer(1i32, <std::string::String as AsRef<std::path::Path>>::as_ref(env)))
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
471 |                 seed.deserialize(Tuple2Deserializer(1i32, <std::string::String as AsRef<str>>::as_ref(env)))
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
471 |                 seed.deserialize(Tuple2Deserializer(1i32, <std::string::String as AsRef<[u8]>>::as_ref(env)))
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0283`.
error: failed to compile `cargo-geiger v0.10.2`, intermediate artifacts can be found at `/tmp/cargo-installuJT1b6`

Caused by:
  could not compile `cargo`
@anderejd anderejd added the bug Something isn't working label Jan 31, 2021
@jmcconnell26
Copy link
Contributor

@rvolgers, this should have been resolved by #183 (which was put in place to allow us to catch issues like this). Can you let me know if you are still seeing the issue?

@rvolgers
Copy link
Author

rvolgers commented Feb 3, 2021

@jmcconnell26 Sorry, still get the same error. I also tried installing from cargo-geiger git (because I noticed the crate has not been updated for 7 months) but that failed with different compile errors (a lot of variations on error[E0453]: allow(non_upper_case_globals) incompatible with previous forbid). I even tried using both stable and nightly compilers.

@Robbepop
Copy link

Robbepop commented Feb 3, 2021

Getting the same error. Would love to be able to use cargo-geiger again.

error[E0283]: type annotations needed
   --> /home/robrob/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-0.46.1/src/cargo/util/config/de.rs:471:63
    |
471 |                 seed.deserialize(Tuple2Deserializer(1i32, env.as_ref()))
    |                                                           ----^^^^^^--
    |                                                           |   |
    |                                                           |   cannot infer type for type parameter `T` declared on the trait `AsRef`
    |                                                           this method call resolves to `&T`
    |
    = note: cannot satisfy `std::string::String: AsRef<_>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0283`.
error: failed to compile `cargo-geiger v0.10.2`, intermediate artifacts can be found at `/tmp/cargo-installxHv42Y`

Caused by:
  could not compile `cargo`

@tarcieri
Copy link
Collaborator

tarcieri commented Feb 3, 2021

I believe I've read something about this being an upstream breakage in serde, although I don't have a link offhand

@jmcconnell26
Copy link
Contributor

jmcconnell26 commented Feb 4, 2021

The issue looks to be this one serde-rs/serde#1967
The problem with v0.10.2 is that there is no restriction on the serde version used, but this issue will hopefully resolve itself once the latest version of serde is released.
The current master should build however @rvolgers (because we can restrict the version of serde to a non broken one), could you let me know what stable version of the rust compiler you tried using and I can try and replicate?

@Camille019
Copy link

The command cargo install --locked cargo-geiger fix the install issue for me.

See:
#rust-lang/cargo#9101 (comment)
#rust-lang/cargo#7169 (comment)

cargo-geiger v0.10.2
rustc 1.50.0

@ShadowJonathan
Copy link

Running with --locked generates two warnings;

warning: package `miow v0.3.5` in Cargo.lock is yanked in registry `crates.io`, consider running without --locked
warning: package `socket2 v0.3.12` in Cargo.lock is yanked in registry `crates.io`, consider running without --locked

maybe that should be looked into?

@Camille019
Copy link

The version 0.11.1 fix this install issue for me.

cargo-geiger v0.11.1
rustc 1.51.0

@anderejd
Copy link
Contributor

anderejd commented May 5, 2021

Thanks for the feedback @Camille019

Closing.

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

7 participants