EmbarkStudios / cargo-deny

❌ Cargo plugin for linting your dependencies 🦀
http://embark.rs
Apache License 2.0
1.62k stars 80 forks source link

Bug: `cargo install cargo-deny` fails to compile cargo deny #637

Closed tim3z closed 3 months ago

tim3z commented 3 months ago

Describe the bug

Since roughly today (2024-03-21) our CI/CD pipelines (ubuntu-based docker images) started failing while trying to install cargo-deny. The problem is also reproducible on macos-based developer machines. We're using the latest stable rust version (rustc 1.76.0 (07dca489a 2024-02-04) at the time of writing). The compilation of cargo deny fails with the following errors:

error[E0308]: arguments to this function are incorrect
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-deny-0.14.17/src/advisories/helpers/db.rs:259:30
    |
259 |         let remote_head_id = tame_index::utils::git::write_fetch_head(&repo, &outcome, &remote)
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -----  --------  ------- expected `tame_index::external::gix::Remote<'_>`, found `gix::Remote<'_>`
    |                                                                       |      |
    |                                                                       |      expected `tame_index::external::gix::remote::fetch::Outcome`, found `gix::remote::fetch::Outcome`
    |                                                                       expected `&Repository`, found `&CommitAutoRollback<'_>`
    |
    = note: expected reference `&tame_index::external::gix::Repository`
               found reference `&gix::config::CommitAutoRollback<'_>`
    = note: `gix::remote::fetch::Outcome` and `tame_index::external::gix::remote::fetch::Outcome` have similar names, but are actually distinct types
note: `gix::remote::fetch::Outcome` is defined in crate `gix`
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-0.60.0/src/remote/connection/fetch/mod.rs:72:1
    |
72  | pub struct Outcome {
    | ^^^^^^^^^^^^^^^^^^
note: `tame_index::external::gix::remote::fetch::Outcome` is defined in crate `gix`
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-0.61.0/src/remote/connection/fetch/mod.rs:72:1
    |
72  | pub struct Outcome {
    | ^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `gix` are being used?
    = note: `gix::Remote<'_>` and `tame_index::external::gix::Remote<'_>` have similar names, but are actually distinct types
note: `gix::Remote<'_>` is defined in crate `gix`
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-0.60.0/src/types.rs:200:1
    |
200 | pub struct Remote<'repo> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^
note: `tame_index::external::gix::Remote<'_>` is defined in crate `gix`
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-0.61.0/src/types.rs:200:1
    |
200 | pub struct Remote<'repo> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `gix` are being used?
note: function defined here
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tame-index-0.9.9/src/utils/git.rs:27:8
    |
27  | pub fn write_fetch_head(
    |        ^^^^^^^^^^^^^^^^

error[E0308]: arguments to this function are incorrect
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-deny-0.14.17/src/advisories/helpers/db.rs:444:9
    |
444 |         tame_index::utils::git::write_fetch_head(
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
445 |             &repo,
    |             ----- expected `tame_index::external::gix::Repository`, found `gix::Repository`
446 |             &fetch_outcome,
    |             -------------- expected `tame_index::external::gix::remote::fetch::Outcome`, found `gix::remote::fetch::Outcome`
447 |             &repo.find_remote("origin").unwrap(),
    |             ------------------------------------ expected `tame_index::external::gix::Remote<'_>`, found `gix::Remote<'_>`
    |
    = note: `gix::Repository` and `tame_index::external::gix::Repository` have similar names, but are actually distinct types
note: `gix::Repository` is defined in crate `gix`
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-0.60.0/src/types.rs:144:1
    |
144 | pub struct Repository {
    | ^^^^^^^^^^^^^^^^^^^^^
note: `tame_index::external::gix::Repository` is defined in crate `gix`
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-0.61.0/src/types.rs:144:1
    |
144 | pub struct Repository {
    | ^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `gix` are being used?
    = note: `gix::remote::fetch::Outcome` and `tame_index::external::gix::remote::fetch::Outcome` have similar names, but are actually distinct types
note: `gix::remote::fetch::Outcome` is defined in crate `gix`
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-0.60.0/src/remote/connection/fetch/mod.rs:72:1
    |
72  | pub struct Outcome {
    | ^^^^^^^^^^^^^^^^^^
note: `tame_index::external::gix::remote::fetch::Outcome` is defined in crate `gix`
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-0.61.0/src/remote/connection/fetch/mod.rs:72:1
    |
72  | pub struct Outcome {
    | ^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `gix` are being used?
    = note: `gix::Remote<'_>` and `tame_index::external::gix::Remote<'_>` have similar names, but are actually distinct types
note: `gix::Remote<'_>` is defined in crate `gix`
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-0.60.0/src/types.rs:200:1
    |
200 | pub struct Remote<'repo> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^
note: `tame_index::external::gix::Remote<'_>` is defined in crate `gix`
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-0.61.0/src/types.rs:200:1
    |
200 | pub struct Remote<'repo> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `gix` are being used?
note: function defined here
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tame-index-0.9.9/src/utils/git.rs:27:8
    |
27  | pub fn write_fetch_head(
    |        ^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `cargo-deny` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-deny v0.14.17`, intermediate artifacts can be found at `/var/folders/8g/m8579q3n0tv3dr2nt39t8j8r0000gp/T/cargo-installhAQpce`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

To reproduce

cargo install cargo-deny

cargo-deny version

unspecified -> 0.14.17

What OS were you running cargo-deny on?

MacOS

Additional context

No response

Jake-Shadle commented 3 months ago

Please use --locked when using cargo install.