Commit Graph

15493 Commits

Author SHA1 Message Date
bors 1d8b05cdd1 Auto merge of #13009 - weihanglo:rust-1.75.0-bump-credential, r=ehuss
[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.
2023-11-20 01:39:31 +00:00
Weihang Lo a821e6ffb9
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.

See rust-lang/cargo#13004 for more.
2023-11-19 11:00:55 -05:00
bors c67dced22d Auto merge of #12994 - ehuss:beta-1pass, r=weihanglo
[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
2023-11-17 04:23:22 +00:00
bors 8862fd33a0 Auto merge of #12986 - Turbo87:1password-readme, r=ehuss
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.
2023-11-16 20:09:21 -08:00
bors 3aa3b0c9b5 Auto merge of #12985 - Turbo87:fix-1password-account-usage, r=ehuss
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
2023-11-16 20:09:00 -08:00
bors 6790a51278 Auto merge of #12938 - epage:source-refactor, r=weihanglo
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
2023-11-10 17:09:35 +00:00
bors 746802cfe2 Auto merge of #12953 - decathorpe:master, r=weihanglo
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
2023-11-10 16:26:02 +00:00
Fabio Valentini a13a6905e9
credential: include license files in all published crates 2023-11-10 17:12:40 +01:00
bors 57880c222b Auto merge of #12951 - belovdv:jobserver-preserver-fd, r=weihanglo
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.
2023-11-10 13:53:09 +00:00
belovdv e84fd16caa pass jobserver on fix proxy rustc 2023-11-10 12:54:14 +03:00
bors 19a0404816 Auto merge of #12930 - epage:msrv-refactor, r=Eh2406
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
2023-11-10 01:50:13 +00:00
bors ac9d3bac2a Auto merge of #12948 - epage:toml-refactor, r=weihanglo
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
2023-11-09 23:19:31 +00:00
bors 9b2cad6a10 Auto merge of #12949 - cuviper:os-credentials, r=arlosi
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.
2023-11-09 21:35:23 +00:00
Josh Stone 1ee96328c3 Filter `cargo-credential-*` dependencies by OS 2023-11-09 10:09:00 -08:00
Ed Page eba0091649 refactor(toml): Move target name logic next to use 2023-11-09 10:56:42 -06:00
Ed Page ccccff112a refactor(toml): Move target duplicate-field logic next to use 2023-11-09 10:56:42 -06:00
Ed Page 0a6fe0abdd refactor(toml): Generalize schema abstracting over duplicate fields 2023-11-09 10:56:42 -06:00
Ed Page d87b92cce5 refactor(toml): Let schema abstract over duplicate fields 2023-11-09 10:56:42 -06:00
Ed Page 46bb8ee186 docs(cargo): Clarify sort_summaries behavior 2023-11-09 10:21:22 -06:00
Ed Page 778dc4d4b3 refactor(toml): Move target build.rs logic next to use 2023-11-08 21:56:54 -06:00
bors 1d8980511e Auto merge of #12940 - epage:semver, r=weihanglo
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
2023-11-08 20:52:56 +00:00
Ed Page 807d7ed2f0 refactor(toml): Remove unused Rc 2023-11-08 14:22:52 -06:00
Ed Page 2a314c7642 refactor(toml): Pull out profile name validation
It now lives with other name validation logic.
2023-11-08 13:25:55 -06:00
Ed Page 90e2995eb1 refactor(toml): Reduce visibility
This will make it clearer what each piece of logic belongs to
2023-11-08 13:16:44 -06:00
Ed Page e3eda30926 refactor(config): Pull in toml parse wrapper 2023-11-08 13:14:37 -06:00
Ed Page 2b2502f7fc refactor(util): Pull out `mod util_semver`
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
2023-11-08 12:08:04 -06:00
bors 2ef56214b3 Auto merge of #12939 - hi-rustin:rustin-patch-feature-msg, r=epage
Fix the invalidate feature name message
2023-11-08 17:15:01 +00:00
bors 8cf7143664 Auto merge of #12926 - epage:exact, r=Eh2406
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
2023-11-08 16:35:53 +00:00
bors b0650089e3 Auto merge of #12889 - epage:hyperlink, r=weihanglo
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
2023-11-08 15:47:34 +00:00
hi-rustin 976835d045 Update the test for the msg change
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-11-08 23:40:24 +08:00
hi-rustin 039178fdb7 Fix the invalidate feature name message
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-11-08 23:36:15 +08:00
Ed Page 9f511b6903 refactor(source): Pull out git ref logic 2023-11-08 08:57:35 -06:00
Ed Page e948bbb5e4 refactor(source): Pull out protocol logic 2023-11-08 08:57:35 -06:00
Ed Page 55fb612e45 refactor(spec): Make it easier to add more matches 2023-11-08 08:57:35 -06:00
Ed Page 91d6ecc634 test(spec): Verify all examples 2023-11-08 08:57:23 -06:00
bors fed84e0e1e Auto merge of #12928 - hi-rustin:rustin-patch-feature-name, r=epage
Do not allow empty feature name
2023-11-08 14:56:21 +00:00
hi-rustin d61816465f Add test for empty feature name
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-11-08 22:52:35 +08:00
hi-rustin dd3f434d0d Do not allow empty feature name
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-11-08 22:52:35 +08:00
Ed Page cf6d5b32f7 refactor(util): Align VersionExt, PartialVersion naming 2023-11-08 08:49:10 -06:00
Ed Page a1886c620e refactor(util): Unify VersionExt, VersionReqExt
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.
2023-11-08 08:49:09 -06:00
bors 42702651d2 Auto merge of #12934 - weihanglo:fix-timings, r=epage
fix(timings): unnecessary backslash when error happens
2023-11-08 12:19:39 +00:00
bors 7046d992f9 Auto merge of #12924 - epage:to_semver, r=weihanglo
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.
2023-11-08 03:24:57 +00:00
Weihang Lo 5949868343
fix(timings): unnecessary backslash when error happens 2023-11-07 22:06:35 -05:00
Ed Page 1b1055067d refactor(resolver): Allow scaling number of sort cases 2023-11-07 20:39:35 -06:00
Ed Page 0f1c9dfd23 test(resolver): Add MSRV pref test 2023-11-07 20:39:35 -06:00
Ed Page 6bfc32a15e refactor(resolver): Pull MSRV handling to VersionPreferences 2023-11-07 20:39:35 -06:00
Ed Page bf2987b09b refactor(resolver): Track minimal-versions in VersionPreferences
This had repurcussions on direct-minimal-versions as it before relied on
the ordering parameter to `sort_sumarries`.
2023-11-07 20:39:35 -06:00
Ed Page 3cdddbf033 test(resolver): Improve failure output 2023-11-07 20:39:35 -06:00
Ed Page c4685c7b78 test(spec): Check matches with URLs 2023-11-07 16:49:45 -06:00
Ed Page 6fb8bc169f test(spec): Ensure we can parse what we render 2023-11-07 16:49:45 -06:00