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

cargo install fails because of semver types #229

Closed
IGI-111 opened this issue Jul 21, 2020 · 4 comments · Fixed by #233
Closed

cargo install fails because of semver types #229

IGI-111 opened this issue Jul 21, 2020 · 4 comments · Fixed by #233
Labels
bug Something isn't working

Comments

@IGI-111
Copy link

IGI-111 commented Jul 21, 2020

Describe the bug
cargo install cargo-deny fails with the following:

$ cargo install cargo-deny
    Updating crates.io index
  Installing cargo-deny v0.7.0
   Compiling autocfg v1.0.0
   Compiling libc v0.2.73
   Compiling proc-macro2 v1.0.19
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.35
   Compiling serde_derive v1.0.114
   Compiling serde v1.0.114
   Compiling cfg-if v0.1.10
   Compiling pkg-config v0.3.18
   Compiling lazy_static v1.4.0
   Compiling maybe-uninit v2.0.0
   Compiling either v1.5.3
   Compiling version_check v0.9.2
   Compiling ryu v1.0.5
   Compiling glob v0.3.0
   Compiling tinyvec v0.3.3
   Compiling bitflags v1.2.1
   Compiling serde_json v1.0.56
   Compiling matches v0.1.8
   Compiling log v0.4.11
   Compiling memchr v2.3.3
   Compiling scopeguard v1.1.0
   Compiling semver-parser v0.7.0
   Compiling itoa v0.4.6
   Compiling unicode-width v0.1.8
   Compiling byteorder v1.3.4
   Compiling percent-encoding v2.1.0
   Compiling rayon-core v1.7.1
   Compiling target-lexicon v0.11.0
   Compiling gimli v0.22.0
   Compiling adler v0.2.3
   Compiling failure_derive v0.1.8
   Compiling smallvec v1.4.1
   Compiling regex-syntax v0.6.18
   Compiling openssl-probe v0.1.2
   Compiling rustc-demangle v0.1.16
   Compiling unicode-segmentation v1.6.0
   Compiling object v0.20.0
   Compiling termcolor v1.1.0
   Compiling home v0.5.3
   Compiling vec_map v0.8.2
   Compiling anyhow v1.0.31
   Compiling fixedbitset v0.2.0
   Compiling strsim v0.8.0
   Compiling ansi_term v0.11.0
   Compiling radium v0.3.0
   Compiling semver-parser v0.9.0
   Compiling ansi_term v0.12.1
   Compiling twox-hash v1.5.0
   Compiling thread_local v1.0.1
   Compiling itertools v0.9.0
   Compiling unicode-normalization v0.1.13
   Compiling unicode-bidi v0.3.4
   Compiling textwrap v0.11.0
   Compiling crossbeam-utils v0.7.2
   Compiling memoffset v0.5.5
   Compiling num-traits v0.2.12
   Compiling crossbeam-epoch v0.8.2
   Compiling hashbrown v0.8.1
   Compiling num-integer v0.1.43
   Compiling indexmap v1.5.0
   Compiling rayon v1.3.1
   Compiling miniz_oxide v0.4.0
   Compiling proc-macro-error-attr v1.0.3
   Compiling proc-macro-error v1.0.3
   Compiling heck v0.3.1
   Compiling codespan-reporting v0.9.5
   Compiling bitvec v0.17.4
   Compiling addr2line v0.13.0
   Compiling idna v0.2.0
   Compiling codespan v0.9.5
   Compiling quote v1.0.7
   Compiling jobserver v0.1.21
   Compiling num_cpus v1.13.0
   Compiling atty v0.2.14
   Compiling backtrace v0.3.50
   Compiling time v0.1.43
   Compiling fern v0.6.0
   Compiling aho-corasick v0.7.13
   Compiling url v2.1.1
   Compiling cfg-expr v0.4.1
   Compiling cc v1.0.58
   Compiling clap v2.33.1
   Compiling crossbeam-queue v0.2.3
   Compiling crossbeam-channel v0.4.2
   Compiling regex v1.3.9
   Compiling rmp v0.8.9
   Compiling openssl-src v111.10.2+1.1.1g
   Compiling crossbeam-deque v0.7.3
   Compiling petgraph v0.5.1
   Compiling crossbeam v0.7.3
   Compiling spdx v0.3.4
   Compiling syn-mid v0.5.0
   Compiling synstructure v0.12.4
   Compiling openssl-sys v0.9.58
   Compiling libz-sys v1.0.25
   Compiling libssh2-sys v0.2.18
   Compiling libgit2-sys v0.12.8+1.0.1
   Compiling zstd-sys v1.4.17+zstd.1.4.5
   Compiling thiserror-impl v1.0.20
   Compiling structopt-derive v0.4.8
   Compiling failure v0.1.8
   Compiling thiserror v1.0.20
   Compiling structopt v0.3.15
   Compiling zstd-safe v2.0.5+zstd.1.4.5
   Compiling zstd v0.5.3+zstd.1.4.5
   Compiling semver v0.10.0
   Compiling hex v0.4.2
   Compiling semver v0.9.0
   Compiling toml v0.5.6
   Compiling smol_str v0.1.16
   Compiling rmp-serde v0.13.7
   Compiling platforms v0.2.1
   Compiling cvss v1.0.0
   Compiling chrono v0.4.13
   Compiling cargo_metadata v0.10.1
   Compiling askalono v0.4.2
   Compiling cargo-lock v4.0.1
   Compiling krates v0.3.1
   Compiling git2 v0.13.7
   Compiling crates-index v0.15.0
   Compiling rustsec v0.21.0
   Compiling cargo-deny v0.7.0
error[E0053]: method `version` has an incompatible type for trait
   --> /home/jsaffi/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-deny-0.7.0/src/lib.rs:187:5
    |
187 |     fn version(&self) -> &semver::Version {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `krates::semver::Version`, found struct `semver::Version`
    |
    = note: expected fn pointer `fn(&Krate) -> &krates::semver::Version`
               found fn pointer `fn(&Krate) -> &semver::Version`
    = note: perhaps two different versions of crate `semver` are being used?

error[E0308]: mismatched types
   --> /home/jsaffi/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-deny-0.7.0/src/lib.rs:197:22
    |
197 |             version: pkg.version,
    |                      ^^^^^^^^^^^ expected struct `semver::Version`, found struct `krates::semver::Version`
    |
    = note: perhaps two different versions of crate `semver` are being used?

error[E0308]: mismatched types
   --> /home/jsaffi/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-deny-0.7.0/src/bans/mod.rs:100:67
    |
100 |             for krate in krates.search_matches(&ts.value.id.name, &ts.value.id.version) {
    |                                                                   ^^^^^^^^^^^^^^^^^^^^ expected struct `krates::semver::VersionReq`, found struct `semver::VersionReq`
    |
    = note: expected reference `&krates::semver::VersionReq`
               found reference `&semver::VersionReq`
    = note: perhaps two different versions of crate `semver` are being used?

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0053, E0308.
For more information about an error, try `rustc --explain E0053`.
error: could not compile `cargo-deny`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-deny v0.7.0`, intermediate artifacts can be found at `/tmp/cargo-installx1u3fT`

Caused by:
  build failed


To Reproduce
Just run cargo install cargo-deny although I suspect this might be platform specific or something.

Expected behavior
It should compile and install.

Device:

  • OS: Ubuntu 18.04.4 LTS
  • rustc 1.46.0-nightly (346aec9b0 2020-07-11)
@IGI-111 IGI-111 added the bug Something isn't working label Jul 21, 2020
@Jake-Shadle
Copy link
Member

I just pushed version 0.7.1 that fixes this issue, sorry about that.

@mxpv
Copy link

mxpv commented Jul 28, 2020

@Jake-Shadle seems to be still happening with 0.7.1

❯ cargo install --force cargo-deny
    Updating crates.io index
  Installing cargo-deny v0.7.1
   Compiling autocfg v1.0.0
   Compiling libc v0.2.73
   Compiling proc-macro2 v1.0.19
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.36
   Compiling serde_derive v1.0.114
   Compiling serde v1.0.114
   Compiling cfg-if v0.1.10
   Compiling pkg-config v0.3.18
   Compiling lazy_static v1.4.0
   Compiling maybe-uninit v2.0.0
   Compiling either v1.5.3
   Compiling tinyvec v0.3.3
   Compiling glob v0.3.0
   Compiling ryu v1.0.5
   Compiling version_check v0.9.2
   Compiling serde_json v1.0.57
   Compiling bitflags v1.2.1
   Compiling matches v0.1.8
   Compiling log v0.4.11
   Compiling semver-parser v0.7.0
   Compiling itoa v0.4.6
   Compiling memchr v2.3.3
   Compiling scopeguard v1.1.0
   Compiling percent-encoding v2.1.0
   Compiling unicode-width v0.1.8
   Compiling rayon-core v1.7.1
   Compiling byteorder v1.3.4
   Compiling gimli v0.22.0
   Compiling adler v0.2.3
   Compiling target-lexicon v0.11.0
   Compiling failure_derive v0.1.8
   Compiling unicode-segmentation v1.6.0
   Compiling smallvec v1.4.1
   Compiling object v0.20.0
   Compiling regex-syntax v0.6.18
   Compiling rustc-demangle v0.1.16
   Compiling fixedbitset v0.2.0
   Compiling ansi_term v0.11.0
   Compiling vec_map v0.8.2
   Compiling anyhow v1.0.32
   Compiling termcolor v1.1.0
   Compiling strsim v0.8.0
   Compiling home v0.5.3
   Compiling radium v0.3.0
   Compiling semver-parser v0.9.0
   Compiling ansi_term v0.12.1
   Compiling twox-hash v1.5.0
   Compiling thread_local v1.0.1
   Compiling itertools v0.9.0
   Compiling unicode-bidi v0.3.4
   Compiling semver v0.10.0
   Compiling unicode-normalization v0.1.13
   Compiling textwrap v0.11.0
   Compiling miniz_oxide v0.4.0
   Compiling heck v0.3.1
   Compiling codespan-reporting v0.9.5
   Compiling crossbeam-utils v0.7.2
   Compiling memoffset v0.5.5
   Compiling num-traits v0.2.12
   Compiling crossbeam-epoch v0.8.2
   Compiling hashbrown v0.8.1
   Compiling num-integer v0.1.43
   Compiling indexmap v1.5.0
   Compiling rayon v1.3.1
   Compiling proc-macro-error-attr v1.0.3
   Compiling proc-macro-error v1.0.3
   Compiling bitvec v0.17.4
   Compiling idna v0.2.0
   Compiling codespan v0.9.5
   Compiling fern v0.6.0
   Compiling aho-corasick v0.7.13
   Compiling quote v1.0.7
   Compiling jobserver v0.1.21
   Compiling num_cpus v1.13.0
   Compiling atty v0.2.14
   Compiling time v0.1.43
   Compiling addr2line v0.13.0
   Compiling url v2.1.1
   Compiling cfg-expr v0.4.1
   Compiling cc v1.0.58
   Compiling crossbeam-queue v0.2.3
   Compiling crossbeam-channel v0.4.3
   Compiling clap v2.33.1
   Compiling regex v1.3.9
   Compiling backtrace v0.3.50
   Compiling crossbeam-deque v0.7.3
   Compiling openssl-src v111.10.2+1.1.1g
   Compiling rmp v0.8.9
   Compiling petgraph v0.5.1
   Compiling crossbeam v0.7.3
   Compiling spdx v0.3.4
   Compiling libz-sys v1.0.25
   Compiling openssl-sys v0.9.58
   Compiling libssh2-sys v0.2.18
   Compiling zstd-sys v1.4.17+zstd.1.4.5
   Compiling libgit2-sys v0.12.9+1.0.1
   Compiling syn-mid v0.5.0
   Compiling synstructure v0.12.4
   Compiling thiserror-impl v1.0.20
   Compiling failure v0.1.8
   Compiling structopt-derive v0.4.8
   Compiling thiserror v1.0.20
   Compiling zstd-safe v2.0.5+zstd.1.4.5
   Compiling zstd v0.5.3+zstd.1.4.5
   Compiling structopt v0.3.15
   Compiling semver v0.9.0
   Compiling smol_str v0.1.16
   Compiling hex v0.4.2
   Compiling toml v0.5.6
   Compiling cvss v1.0.0
   Compiling rmp-serde v0.13.7
   Compiling chrono v0.4.13
   Compiling platforms v0.2.1
   Compiling cargo-lock v4.0.1
   Compiling cargo_metadata v0.10.0
   Compiling askalono v0.4.2
   Compiling git2 v0.13.8
   Compiling krates v0.3.1
error[E0308]: mismatched types
   --> /Users/mxpv/.cargo/registry/src/github.com-1ecc6299db9ec823/krates-0.3.1/src/lib.rs:250:9
    |
250 |         &self.version
    |         ^^^^^^^^^^^^^ expected struct `semver::version::Version`, found a different struct `semver::version::Version`
    |
    = note: expected reference `&semver::version::Version` (struct `semver::version::Version`)
               found reference `&semver::version::Version` (struct `semver::version::Version`)
    = note: perhaps two different versions of crate `semver` are being used?

error[E0277]: can't compare `semver::version::Version` with `semver::version::Version`
  --> /Users/mxpv/.cargo/registry/src/github.com-1ecc6299db9ec823/krates-0.3.1/src/pkgspec.rs:21:21
   |
21 |             if vers != &krate.version {
   |                     ^^ no implementation for `semver::version::Version == semver::version::Version`
   |
   = help: the trait `std::cmp::PartialEq<semver::version::Version>` is not implemented for `semver::version::Version`
   = note: required because of the requirements on the impl of `std::cmp::PartialEq<&semver::version::Version>` for `&semver::version::Version`

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `krates`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-deny v0.7.1`, intermediate artifacts can be found at `/var/folders/nx/lmjd5hsx3r3gwyr3tgw14q140000gn/T/cargo-installGXNFDQ`

Caused by:
  build failed

❯ rustc --version
rustc 1.45.0 (5c1f21c3b 2020-07-13)

@Jake-Shadle Jake-Shadle reopened this Jul 28, 2020
@Jake-Shadle
Copy link
Member

cargo_metadata 0.10.1 was yanked which reexposed this issue, but is now blocked on oli-obk/cargo_metadata#121.

@Jake-Shadle
Copy link
Member

Though actually the easiest will just be to revert to older versions of semver/cargo_metadata until things are in a better state.

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

Successfully merging a pull request may close this issue.

3 participants