rust-lang / cargo

The Rust package manager
https://doc.rust-lang.org/cargo
Apache License 2.0
12.49k stars 2.37k forks source link

cargo-credential-libsecret v0.3.2 and friends depends on cargo-credential v0.4 #13002

Closed lu-zero closed 9 months ago

lu-zero commented 9 months ago

Problem

And this breaks cargo v0.74.0

├── cargo v0.74.0
│   ├── anyhow v1.0.75
│   ├── base64 v0.21.5
│   ├── bytesize v1.3.0
│   ├── cargo-credential v0.3.0
│   ├── cargo-credential-libsecret v0.3.2
│   │   ├── anyhow v1.0.75
│   │   ├── cargo-credential v0.4.1
│   │   │   ├── anyhow v1.0.75
│   │   │   ├── libc v0.2.150
│   │   │   ├── serde v1.0.192 (*)
│   │   │   ├── serde_json v1.0.108 (*)
│   │   │   ├── thiserror v1.0.50 (*)
│   │   │   └── time v0.3.30 (*)
│   │   └── libloading v0.8.1
│   │       └── cfg-if v1.0.0
│   ├── cargo-credential-macos-keychain v0.3.1
│   │   ├── cargo-credential v0.4.1 (*)
│   │   └── security-framework v2.9.2
│   │       ├── bitflags v1.3.2
│   │       ├── core-foundation v0.9.3
│   │       │   ├── core-foundation-sys v0.8.4
│   │       │   └── libc v0.2.150
│   │       ├── core-foundation-sys v0.8.4
│   │       ├── libc v0.2.150
│   │       └── security-framework-sys v2.9.1
│   │           ├── core-foundation-sys v0.8.4
│   │           └── libc v0.2.150
│   ├── cargo-credential-wincred v0.3.1
│   │   └── cargo-credential v0.4.1 (*)

And this break building:

rror[E0277]: the trait bound `LibSecretCredential: cargo_credential::Credential` is not satisfied
   --> /Users/lu_zero/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-0.74.0/src/cargo/util/auth/mod.rs:455:45
    |
455 |           let provider: Box<dyn Credential> = match process {
    |  _____________________________________________^
456 | |             "cargo:token" => Box::new(TokenCredential::new(config)),
457 | |             "cargo:paseto" => Box::new(PasetoCredential::new(config)),
458 | |             "cargo:token-from-stdout" => Box::new(BasicProcessCredential {}),
...   |
462 | |             process => Box::new(CredentialProcessCredential::new(process)),
463 | |         };
    | |_________^ the trait `cargo_credential::Credential` is not implemented for `LibSecretCredential`
    |
help: trait impl with same name found
   --> /Users/lu_zero/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-credential-0.4.1/src/lib.rs:61:1
    |
61  | impl Credential for UnsupportedCredential {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `cargo_credential` are being used?
    = help: the following other types implement trait `cargo_credential::Credential`:
              UnsupportedCredential
              BasicProcessCredential
              PasetoCredential<'a>
              CredentialProcessCredential
              TokenCredential<'a>
    = note: required for the cast from `std::boxed::Box<LibSecretCredential>` to `std::boxed::Box<dyn cargo_credential::Credential>`

error[E0277]: the trait bound `MacKeychain: cargo_credential::Credential` is not satisfied
   --> /Users/lu_zero/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-0.74.0/src/cargo/util/auth/mod.rs:455:45
    |
455 |           let provider: Box<dyn Credential> = match process {
    |  _____________________________________________^
456 | |             "cargo:token" => Box::new(TokenCredential::new(config)),
457 | |             "cargo:paseto" => Box::new(PasetoCredential::new(config)),
458 | |             "cargo:token-from-stdout" => Box::new(BasicProcessCredential {}),
...   |
462 | |             process => Box::new(CredentialProcessCredential::new(process)),
463 | |         };
    | |_________^ the trait `cargo_credential::Credential` is not implemented for `MacKeychain`
    |
help: trait impl with same name found
   --> /Users/lu_zero/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-credential-macos-keychain-0.3.1/src/lib.rs:20:5
    |
20  |     impl Credential for MacKeychain {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `cargo_credential` are being used?
    = help: the following other types implement trait `cargo_credential::Credential`:
              UnsupportedCredential
              BasicProcessCredential
              PasetoCredential<'a>
              CredentialProcessCredential
              TokenCredential<'a>
    = note: required for the cast from `std::boxed::Box<MacKeychain>` to `std::boxed::Box<dyn cargo_credential::Credential>`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `cargo` (lib) due to 2 previous errors

Steps

Try building something that uses cargo as library crate.

Possible Solution(s)

yank the crates and republish them as 0.4, make the newer cargo depend on them.

Notes

No response

Version

No response

nehalem501 commented 9 months ago

I have the same issue building on Linux.

error[E0277]: the trait bound `MacKeychain: cargo_credential::Credential` is not satisfied
   --> /home/tomek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-0.74.0/src/cargo/util/auth/mod.rs:455:45
    |
455 |           let provider: Box<dyn Credential> = match process {
    |  _____________________________________________^
456 | |             "cargo:token" => Box::new(TokenCredential::new(config)),
457 | |             "cargo:paseto" => Box::new(PasetoCredential::new(config)),
458 | |             "cargo:token-from-stdout" => Box::new(BasicProcessCredential {}),
...   |
462 | |             process => Box::new(CredentialProcessCredential::new(process)),
463 | |         };
    | |_________^ the trait `cargo_credential::Credential` is not implemented for `MacKeychain`
    |
help: trait impl with same name found
   --> /home/tomek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-credential-0.4.1/src/lib.rs:61:1
    |
61  | impl Credential for UnsupportedCredential {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `cargo_credential` are being used?
    = help: the following other types implement trait `cargo_credential::Credential`:
              UnsupportedCredential
              BasicProcessCredential
              PasetoCredential<'a>
              CredentialProcessCredential
              TokenCredential<'a>
    = note: required for the cast from `std::boxed::Box<MacKeychain>` to `std::boxed::Box<dyn cargo_credential::Credential>`

error[E0277]: the trait bound `LibSecretCredential: cargo_credential::Credential` is not satisfied
   --> /home/tomek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-0.74.0/src/cargo/util/auth/mod.rs:455:45
    |
455 |           let provider: Box<dyn Credential> = match process {
    |  _____________________________________________^
456 | |             "cargo:token" => Box::new(TokenCredential::new(config)),
457 | |             "cargo:paseto" => Box::new(PasetoCredential::new(config)),
458 | |             "cargo:token-from-stdout" => Box::new(BasicProcessCredential {}),
...   |
462 | |             process => Box::new(CredentialProcessCredential::new(process)),
463 | |         };
    | |_________^ the trait `cargo_credential::Credential` is not implemented for `LibSecretCredential`
    |
help: trait impl with same name found
   --> /home/tomek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-credential-libsecret-0.3.2/src/lib.rs:104:5
    |
104 |     impl Credential for LibSecretCredential {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `cargo_credential` are being used?
    = help: the following other types implement trait `cargo_credential::Credential`:
              UnsupportedCredential
              BasicProcessCredential
              PasetoCredential<'a>
              CredentialProcessCredential
              TokenCredential<'a>
    = note: required for the cast from `std::boxed::Box<LibSecretCredential>` to `std::boxed::Box<dyn cargo_credential::Credential>`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `cargo` (lib) due to 2 previous errors
weihanglo commented 9 months ago

Hey all. Thanks for the help from the infra team, broken versions should have been yanked. Please let us know if the issue still persists.

Here are the new good versions:

Here are bad yanked versions:

ehuss commented 9 months ago

I'm going to close, as I believe this is resolved now.