17200 Commits

Author SHA1 Message Date
bors
d19d2bca88 Auto merge of #13757 - naglis:docs-update-gh-checkout-action-version, r=epage
docs: update `checkout` GitHub action version

### What does this PR try to resolve?

This PR updates the GitHub CI examples in The Cargo Book to use the latest version of the `actions/checkout` GitHub action, since using `actions/checkout@v3` (currently used in the examples) produces warnings about deprecated Node.js 16 (see also [GitHub Actions: Transitioning from Node 16 to Node 20](https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/) blog post).

Also, v4 is already used in the "Verifying `rust-version`" example:

a9f86addbc/src/doc/src/guide/continuous-integration.md (L174)
2024-04-15 14:17:30 +00:00
Naglis Jonaitis
e9c7df3d0a docs: update checkout GitHub action version
Using `actions/checkout@v3` produces warnings about deprecated Node.js
16 (see also [1]).

Also, v4 is already used in the "Verifying `rust-version`" example[2].

[1]: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/
[2]: a9f86addbc/src/doc/src/guide/continuous-integration.md (L174)
2024-04-15 15:22:57 +03:00
bors
a9f86addbc Auto merge of #13756 - dtolnay-contrib:testdoc, r=weihanglo
Recategorize cargo test's `--doc` flag under "Target Selection"

### What does this PR try to resolve?

In `cargo help test`, the `--doc` flag is listed under a section called "Target Selection" next to `--lib`, `--bin`, `--bins`, `--example`, `--examples`, `--test`, `--tests`, `--bench`, `--benches`, and `--all-targets`.

But in `cargo test --help`, it was instead listed in an "Options" section next to `--no-run`, `--message-format`, `--color`, etc, which seems less appropriate than "Target Selection".

### How should we test and review this PR?

- `cargo build --release`
- `cargo test --release --test testsuite -- cargo_test::help::case`
- `target/release/cargo test --help`
- `target/release/cargo help test` (unchanged)
2024-04-15 03:01:12 +00:00
David Tolnay
afea119dff
Recategorize cargo test's --doc flag under "Target Selection" 2024-04-14 19:11:02 -07:00
bors
07ac23a71c Auto merge of #13753 - jw013:patch-1, r=weihanglo
Reword sentence describing workspace toml for clarity

Judging by the commit history, the original sentence was written before the `[patch]` and `[profile]` sections were added and since those sections do not go underneath the workspace table the original sentence needed to be updated.
2024-04-13 22:58:47 +00:00
jw013
341a4645cc
Reword sentence describing workspace toml for clarity
Judging by the commit history, the original sentence was written before the `[patch]` and `[profile]` sections were added and since those sections do not go underneath the workspace table the original sentence needed to be updated.
2024-04-13 12:45:08 -04:00
bors
29189d9908 Auto merge of #13751 - epage:msrv-docs, r=weihanglo
docs(ref): Update unstable docs for msrv-policy
2024-04-13 13:35:46 +00:00
bors
8dd6db4f12 Auto merge of #13748 - epage:kebab, r=weihanglo
refactor(config): Consistently use kebab-case

This shouldn't change the behavior but makes it safer if
- We add new fields where it will matter
- Copy/paste these for new structs

I did not change things related to the Index because we are already stuck with that case (whether we want it or not)

Came across this when working on #13540 and almost made the mistake of copying what was already there
2024-04-13 13:04:42 +00:00
bors
48eca1b164 Auto merge of #13750 - epage:death, r=weihanglo
test: Remove add/remove death tests

Seeing recent fialures on Windows
- #13748
- #13738
- #13740

and maybe more

The test was added in #12744.  It seems of limited utility because there are innumerable ways of adding new writes that aren't atomic and we can't test for them all.
Even this case, its limited.

See also https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Flaky.20test.3A.20.20-death.3A.3Akill_cargo_add_never_corrupts_cargo/near/432979594
2024-04-12 21:16:36 +00:00
Ed Page
30efa8d9c5 test: Remove add/remove death tests
Seeing recent fialures on Windows
- #13748
- #13738
- #13740

and maybe more

The test was added in #12744.  It seems of limited utility because there
are innumerable ways of adding new writes that aren't atomic and we
can't test for them all.
Even this case, its limited.

See also https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Flaky.20test.3A.20.20-death.3A.3Akill_cargo_add_never_corrupts_cargo/near/432979594
2024-04-12 16:06:15 -05:00
bors
91796b1828 Auto merge of #13743 - epage:msrv-implicit, r=weihanglo
feat(resolve): Fallback to 'rustc -V' for MSRV resolving

### What does this PR try to resolve?

This is part of #9930 and adds a fallback if the rust-version isn't set

### How should we test and review this PR?

Tests are added in a separate commit so people can see how the behavior changed.

### Additional information
2024-04-12 20:41:25 +00:00
Ed Page
bb46cce363 refactor(config): Consistently use kebab-case
This shouldn't change the behavior but makes it safer if
- We add new fields where it will matter
- Copy/paste these for new structs

I did not change things related to the Index because we are already
stuck with that case (whether we want it or not)
2024-04-12 15:21:21 -05:00
Ed Page
079f4d12e3 docs(ref): Update unstable docs for msrv-policy 2024-04-12 15:07:13 -05:00
bors
7dc84a2d31 Auto merge of #13742 - epage:msrv-update, r=Muscraft
feat(cli): Add --ignore-rust-version to update/generate-lockfile

### What does this PR try to resolve?

This is part of #9930 and extends `--ignore-rust-version` to `cargo update` and `cargo generate-lockfile`

### How should we test and review this PR?

First commit sets up tests

### Additional information
2024-04-12 16:57:51 +00:00
bors
7ac5d58f36 Auto merge of #13735 - linyihai:package-no-match, r=epage
`cargo package -p no-exist` emitt  error when the -p `package` not found

### What does this PR try to resolve?

Fixes #13719

If `-p` is used, and the spec doesn't match any member, we emit an error  like `cargo publish -p` does.

### How should we test and review this PR?

The first commit add a test to show the issue, the next commit add the check logic to fix it.

### Additional information
2024-04-12 16:27:02 +00:00
bors
6208c52b4c Auto merge of #13741 - epage:msrv-ignore-help, r=Muscraft
fix(help): Generalize --ignore-rust-version

### What does this PR try to resolve?

This is part of #9930 and updates for the help to accommodate #13738 and adding `--ignore-rust-version` to `cargo update`  for when they are stable

This includes
- Moving `--ignore-rust-version` to be under the "Manifest options" header
- Generalizing the help description

### How should we test and review this PR?

### Additional information
2024-04-12 15:41:49 +00:00
Lin Yihai
decbadb36f fix: cargo package -p includes all packages if no match is found 2024-04-12 10:57:58 +08:00
Lin Yihai
ac7bf6eb19 test(package): cargo package -p doesnt-exist will package all packages in workspace 2024-04-12 10:57:35 +08:00
bors
7e31f62a80 Auto merge of #13744 - cuviper:ci-uncompressed, r=weihanglo
test: don't compress test registry crates

They are still nominally gzipped, but using `Compression::none()` makes
them consistent even across zlib and zlib-ng, and this fixes checksum
differences in the testsuite. There is a one-time update of all those
checksums to catch up with this change though.

r? `@weihanglo`
2024-04-11 22:48:34 +00:00
bors
c375398f3b Auto merge of #13738 - epage:msrv, r=Muscraft
feat(reslve): Respect '--ignore-rust-version'

### What does this PR try to resolve?

This is a part of #9930.

### How should we test and review this PR?

I had considered several ways of implementing this.  I first looked at passing this into `ops::resolve*`.
.This would get a bit annoying with the function signature, so I considered moving it to a builder..
Each of the entry points is slightly different with different ownership needs, making it hard to have a common abstraction.
In doing this, I noticed we currently pass some state around to the resolver via `Workspace`, so I mirrored that.

The nice thing about this location is it provides a good place to hook in config and `package.resolve` so they affect this.

### Additional information
2024-04-11 22:12:03 +00:00
Josh Stone
a70f23c50b test: don't compress test registry crates
They are still nominally gzipped, but using `Compression::none()` makes
them consistent even across zlib and zlib-ng, and this fixes checksum
differences in the testsuite. There is a one-time update of all those
checksums to catch up with this change though.
2024-04-11 14:58:42 -07:00
bors
d4672087b3 Auto merge of #13740 - Muscraft:remove-rust-2024-compat, r=epage
refactor: Remove `rust_2024_compatibility` lint group

The `rust_2024_compatibility` lint group was added as a way to be compatible with `Rust`. This group is meant to be used when switching to the 2024 edition (usually enabled by `cargo fix --edition`). Since we are not going to be interacting with `cargo fix` in the standard way to fix edition lints, this group is not needed at this time. Removing this will (slightly) reduce the complexity of working on things for the 2024 edition.
2024-04-11 21:17:17 +00:00
Scott Schafer
d77faa68af
refactor: Remove rust_2024_compatibility lint group 2024-04-11 14:36:30 -06:00
Ed Page
38718eaa93 feat(resolve): Fallback to 'rustc -V' for MSRV resolving 2024-04-11 14:40:52 -05:00
Ed Page
b7b3874d09 refactor(resolve): Make it easier to extend MSRV logic 2024-04-11 14:38:02 -05:00
Ed Page
a8e816b079 test(resolve): Show no-MSRV case 2024-04-11 14:36:50 -05:00
Ed Page
c7d89c64f1 feat(cli): Add --ignore-rust-version to update/generate-lockfile 2024-04-11 14:27:57 -05:00
Ed Page
c9de6eeeb2 test(resolve): Show update/generate-lockfile behavior 2024-04-11 14:18:10 -05:00
Ed Page
a0ba72918a fix(help): Generalize --ignore-rust-version 2024-04-11 13:45:39 -05:00
Ed Page
cd3d31b361 feat(reslve): Respect '--ignore-rust-version' 2024-04-11 12:56:53 -05:00
Ed Page
11448b44fe refactor(resolve): Abstract out MSRV policy tracking 2024-04-11 12:07:05 -05:00
Ed Page
789eda2b83 fix: Correct fn name in log statement 2024-04-11 11:40:33 -05:00
bors
74fd5bc730 Auto merge of #13731 - weihanglo:openssl, r=epage
chore: downgrade to openssl v1.1.1 (again)

Accidentally updated by <https://github.com/rust-lang/cargo/pull/13674>

See https://github.com/rust-lang/cargo/issues/13546#issuecomment-2047366361
2024-04-10 18:40:49 +00:00
Weihang Lo
686057bddd
chore: pin openssl-sys to =0.9.92 2024-04-10 13:48:46 -04:00
bors
40ce8ace29 Auto merge of #13728 - weihanglo:dedup-suggestion, r=epage
fix(cargo-fix): dont apply same suggestion twice
2024-04-10 16:50:17 +00:00
bors
e366699d7f Auto merge of #13727 - weihanglo:patch, r=epage
refactor: make `resolve_with_previous` clearer
2024-04-10 16:19:21 +00:00
Weihang Lo
95edc06e5b
fix(rustfix): dont apply same suggestion twice
This assumes that if any of the machine applicable fixes in
a diagnostic suggestion is a duplicate, we should see the
entire suggestion as a duplicate.
2024-04-10 11:54:33 -04:00
Weihang Lo
5b05a3bb5a
test(rustfix): demonstrate duplicate suggestions 2024-04-10 11:53:37 -04:00
bors
f8a73f7d7a Auto merge of #13729 - epage:slash, r=Muscraft
fix(package): Normalize paths in `Cargo.toml`

### What does this PR try to resolve?

On the surface, this resolves problems that aren't too big of a deal
- Clean up redundant information in paths (e.g. `.////.//foo.rs` being `foo.rs`) which is just visual
- Switch paths with `\` in them to `/`

However, this is prep for #13713 where these will be a much bigger deal
- If the user does `./foo.rs`, we might fail to compare that with the list of files included in the package
- We'll generate paths with `\` and need to make sure the packages can still be used on Windows

### How should we test and review this PR?

### Additional information
2024-04-10 15:49:08 +00:00
bors
f99d24fee4 Auto merge of #13732 - epage:honor, r=Muscraft
refactor: Track when MSRV is explicitly set, either way

### What does this PR try to resolve?

This will hopefully help when merging between CLI and config with #13540.

### How should we test and review this PR?

### Additional information
2024-04-10 15:18:27 +00:00
Ed Page
2e75d66c7c refactor: Track when MSRV is explicitly set, either way
This will hopefully help when merging between CLI and config with #13540.
2024-04-10 08:34:41 -05:00
Weihang Lo
399f2c765c
chore: tell renovatebot to not touch openssl (temporarily) 2024-04-10 09:29:03 -04:00
Weihang Lo
80d0d94342
doc: add commment to summary_for_patch 2024-04-10 09:00:26 -04:00
Weihang Lo
f9786711a6
refactor: unify naming of keep closure 2024-04-10 09:00:26 -04:00
Weihang Lo
1717a35d25
chore: downgrade to openssl v1.1.1 (again)
See rust-lang#13546
2024-04-10 08:44:49 -04:00
Ed Page
8b593e5ba7 fix(package): Normalize path separators
A windows user could use `\` and no Linux or Mac user could use the
package.
This normalizes the separator to what works on all platforms.
2024-04-09 21:29:08 -05:00
Ed Page
5539293cf6 fix(package): Normalize paths in published Cargo.toml
For now, this is more for visual consistency.
However, this blocks #13713 as we need to be able to make these paths
comparable to what is included in the package.
2024-04-09 20:57:25 -05:00
Ed Page
4eea907733 test(package): Show behavior with backslashes 2024-04-09 13:44:25 -05:00
Weihang Lo
57c814eeda
refactor: extract patch registration to a function 2024-04-09 14:33:49 -04:00
Weihang Lo
e55c205aed
refactor: move to_avoid closure to cargo update 2024-04-09 01:17:31 -04:00