[beta-1.75.0] chore: bump `cargo-credential-*` crates as e58b84d broke stuff
e58b84d changed the shape of response of cargo credential protocol trait,
so credential plugins crates effectively depend on `cargo-credential@0.4.0`.
However, `cargo@0.74.0` still depends on`cargo-credential@0.3.0`.
They must depends on the same major version of `cargo-credential`
otherwise incompatible.
This PR
* bumps the version to `cargo-credential-wincred@0.4.1`
* bumps the version to `cargo-credential-macos-keychain@0.4.1`
* bumps the version to `cargo-credential-li@0.4.1`
See https://github.com/rust-lang/cargo/pull/13004 for more.
e58b84d changed the shape of response of cargo credential protocol trait,
so credential plugins crates effectively depend on `cargo-credential@0.4.0`.
However, `cargo@0.74.0` still depends on`cargo-credential@0.3.0`.
They must depends on the same major version of `cargo-credential`
otherwise incompatible.
See rust-lang/cargo#13004 for more.
[beta 1.75] Backport 1password fixes
This backports these fixes to 1.75 for the cargo-credential-1password helper. I'd like to publish these fixes and get the docs updated sooner rather than later. Unfortunately it uses an unpublished version of cargo-credential, so I can't publish directly from master.
Backports:
* #12985 — cargo-credential-1password: Add missing `--account` argument to `op signin` command
* #12986 — cargo-credential-1password: Fix README
cargo-credential-1password: Fix README
### What does this PR try to resolve?
The README.md file of the cargo-credential-1password package does not match the implemented reality (anymore?).
- `--sign-in-address` and `--email` are not actually supported by the implementation
- manually calling `op signin` appears to be unnecessary
This PR also adds configuration instructions directly to the README.md so that they show up on crates.io.
cargo-credential-1password: Add missing `--account` argument to `op signin` command
### What does this PR try to resolve?
Without this the account chooser is shown by the `op signin` command, even though the user has already specified an account via the `--account` command line argument to the `cargo-credential-1password` CLI.
Note that the `--vault` in this case does not need to be forwarded to `op`, since it is irrelevant for the `op signin` command.
### How should we test and review this PR?
- Have a 1password installation with multiple accounts
- Use `global-credential-providers = ["cargo-credential-1password --account my.1password.com"]` in the cargo config file
- Run e.g. `cargo publish`
- Notice how you are seeing an account switcher even though `--account` was used
- Apply this patch and notice that the account switcher is no longer there and the correct account is selected automatically
### Additional information
see https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/1password.20credentials.20provider
refactor(source): Prepare for new PackageIDSpec syntax
### What does this PR try to resolve?
This adds tests and refactors to prepare for #12933
### How should we test and review this PR?
### Additional information
credential: include license files in all published crates
### What does this PR try to resolve?
It appears that the addition of license files was missed when the cargo-credential* crates were added to this cargo workspace. This PR adds symbolic links to the license files so that `cargo publish` picks them up and includes the files when publishing them to crates.io (which is a requirement for both the Apache-2.0 and the MIT license).
### How should we test and review this PR?
Running `cargo package` for the cargo-credential* crates should result in a copy of the LICENSE-APACHE and LICENSE-MIT files to be included in the "packaged" files.
### Additional information
Similar changes have been pushed for other workspace members in the past, for example https://github.com/rust-lang/cargo/pull/7886
fix: preserve jobserver file descriptors on rustc invocation in `fix_exec_rustc`
Similar to #12447
Command `cargo fix` invokes `cargo rustc`. It sends environment variable which points to closed file descriptors.
This PR makes cargo compatible with https://github.com/rust-lang/rust/pull/113730.
It should be enough to have tests in rustc. It seems to be good to have more centralized way to pass jobserver.
refactor(resolver): Consolidate logic in `VersionPreferences`
### What does this PR try to resolve?
This makes customizing the resolver less intrusive by putting the logic in `VersionPreferences` and making it easy to add new priority cases to it.
In particular, this is prep for tweaking the MSRV resolver to prefer compatible versions, rather than require them.
See https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Alternative.20MSRV-aware.20resolver.20approach.3F
### How should we test and review this PR?
Each step is broken down into its own commit for easier browsing
### Additional information
refactor(toml): Simplify code to make schema split easier
### What does this PR try to resolve?
This is a follow up to #12911 and is prep for #12801.
### How should we test and review this PR?
### Additional information
Filter `cargo-credential-*` dependencies by OS
### What does this PR try to resolve?
The `cargo-credential-*` crates have OS-specific functionality, with `cfg` for an "unsupported" fallback, and these are unconditional dependencies of `cargo`. In distros like Fedora that package dependencies individually, that means these crates still have to be packaged even when they are useless on Linux. (Or else patch them out as a downstream change.) Instead, we can filter those dependencies in `Cargo.toml` and add the fallback at the point of use.
Fixes#12945.
### Additional information
We could further *remove* the `cfg`-unsupported fallbacks from the individual crates, and just have them `#![cfg(..)]` themselves globally. I haven't done that yet, because it would look like a big change for mostly just whitespace removing the nested module. I'm happy to add that if desired though.
refactor(util): Pull out `mod util_semver`
### What does this PR try to resolve?
This `mod` is a proposal for what a new package would look like. This needs to be split out so a future `util_manifest_schema` package can depend on it (#12801).
This doesn't address where `RustVersion` should live (along with `PackageIdSpec`).
### How should we test and review this PR?
### Additional information
This builds on the work from #12924 and #12926
This `mod` is a proposal for what a new package would look like.
This needs to be split out so a future `util_manifest_schema`
package can depend on it (#12801).
This doesn't address where `RustVersion` should live (along with
`PackageIdSpec`).
This builds on the work from #12924 and #12926
refactor(util): Prepare for splitting out semver logic
### What does this PR try to resolve?
Like #12924, this was cleanup I noticed as I was looking to pull out our reusable semver code for #12801
### How should we test and review this PR?
### Additional information
feat: Make browser links out of HTML file paths
This provides an alternative to `--open`, where supported.
Note: because we are relying on `supports-hyperlinks`, we are getting `FORCE_HYPERLINK` for "free". Unsure whether it and the current policy (it gets overridden by `term.hyperlinks`) is something we want. `FORCE_HYPERLINK` mirrors the npm package's behavior of the same name (see zkat/supports-hyperlinks#2) though though I also found reading of it in ohmyzsh, a go terminal library and many more places. Similarly, #12751 added indirect, undocumented support for community environment variables.
Fixes#12888
For myself, I find the trait-as-a-constructor approach of
`VersionReqExt::exact` awkward and find merging it into `VersionExt` as
`VersionExt::to_exact_req` is a bit cleaner.
For example, this would make it easier to integrate with
`PartialVersion` if we want.
fix: Report more detailed semver errors
For `cargo install` we'll now show a more specific parse error for semver, much like other parts of cargo.
This came out of my work on #12801. I was looking at what might be appropriate to put in a `cargo-util-semver` crate and realized we have the `ToSemver` trait that exists but doesn't do much, so I dropped it.