Commit graph

16702 commits

Author SHA1 Message Date
Ed Page
4c3b0ade3d refactor(shell): Group by type 2024-02-20 16:42:00 -06:00
Ed Page
e5fd597015 Revert "refactor(cli): Lazily do first-pass config loading"
This reverts commit eda1652b40.
2024-02-20 16:41:59 -06:00
Ed Page
84348548d9 refactor(cli): Switch '-C' to using 'reload_rooted_at' 2024-02-20 16:38:56 -06:00
bors
3fcbf73c5c Auto merge of #13466 - ehuss:more-redundant-use, r=weihanglo
Fix more redundant imports.

The latest nightly has started warning about redundant imports. This removes those warnings.

Presumably these were casualties of merging between #13464 and #13409.
2024-02-20 20:48:17 +00:00
Eric Huss
b59333a316 Fix more redundant imports. 2024-02-20 12:29:06 -08:00
bors
64ccff290f Auto merge of #13465 - epage:delete, r=weihanglo
test: Remove empty snapshots

Inspired by #13461
2024-02-20 20:12:08 +00:00
Ed Page
ac453f1c37 test: Remove empty snapshots for UI tests 2024-02-20 13:29:09 -06:00
bors
762c7d8a00 Auto merge of #13409 - Muscraft:rename-config, r=epage
chore: Rename `Config` to `GlobalContext`

This PR :
- renames `Config` to `GlobalContext`
  - it also renames its references to `gctx` (including lifetimes)
  - This was done to reflect better what it really is at this point
- renames (and moves) `core::compiler::context::Context` to `core::compiler::build_runner::BuildRunner`
  - [Suggested here](https://github.com/rust-lang/cargo/pull/13409#issuecomment-1930958847)

I believe I got all references to `Config` removed, Everything is on `GlobalContext`, but I could've missed renaming a variable or lifetime somewhere. I tried to find all references to `config: &GlobalContext` and rename them and I think I did so successfully. I also renamed all `'cfg`  to `'gctx`.

Note: I explicitly did not rename any files or paths as I was unsure about the best way to do this.

### How to Review this PR
Take your time (and many breaks)!

I am sorry.

I am also sorry for the very brief description, looking at words and thinking about them has become hard... I need to not look at words for a while...

<hr>

As a complete side note, I honestly don't know if `config`, `Config`, `ctx`, or `Context` are really words at this point.
2024-02-20 19:20:33 +00:00
Ed Page
2e878a4c38 test: Remove empty snapshots for help 2024-02-20 13:05:16 -06:00
Scott Schafer
118afd00ac
chore: Rename CompileContext to BuildRunner 2024-02-20 11:55:18 -07:00
Scott Schafer
305efa63cc
chore: Rename Config to GlobalContext 2024-02-20 11:55:15 -07:00
bors
3209eaebae Auto merge of #13464 - ehuss:redundant-use, r=epage
Fix redundant imports.

The latest nightly has started warning about redundant imports. This removes those warnings.
2024-02-20 18:04:09 +00:00
Eric Huss
daa884169c Fix redundant imports. 2024-02-20 09:57:03 -08:00
bors
e7ff7a6618 Auto merge of #12861 - weihanglo:msrv-aware-lockfile, r=ehuss
feat: respect `rust-version` when generating lockfile
2024-02-19 19:05:03 +00:00
bors
5c9ebe18e6 Auto merge of #13459 - weihanglo:ci-tool, r=epage
chore(ci): bump CI tools

### What does this PR try to resolve?

This bumps cargo-semver-checks to 0.29.0 and mdbook to 0.4.37. Both are significant releases but supposed not to affect anything in rust-lang/cargo.

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

Wait for CI green.

### Additional information
<!-- homu-ignore:end -->
2024-02-19 17:44:17 +00:00
Weihang Lo
b36f34ff53
chore(ci): cargo-semver-checks to 0.29.0 2024-02-19 11:42:29 -05:00
Weihang Lo
9859f6e5cf
chore(ci): mdbook to 0.4.37 2024-02-19 11:42:26 -05:00
bors
7b7af3077b Auto merge of #13455 - surechen:for_rustc_117772, r=weihanglo
Remove unnecessary `use` statement in metabuild

Check this situation in PR [#117772](https://github.com/rust-lang/rust/pull/117772)  in rustc.

This blocks the merge of that PR. Details in [CI log](https://github.com/rust-lang-ci/rust/actions/runs/7886502990/job/21519873414).

```bash
2024-02-13T13:22:45.9857459Z failures:
2024-02-13T13:22:45.9857706Z
2024-02-13T13:22:45.9858644Z ---- metabuild::metabuild_fresh stdout ----
2024-02-13T13:22:45.9881590Z running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo check -vv`
2024-02-13T13:22:45.9883611Z running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo check -vv`
2024-02-13T13:22:45.9884693Z thread 'metabuild::metabuild_fresh' panicked at tests/testsuite/metabuild.rs:284:10:
2024-02-13T13:22:45.9885493Z �[1m�[31merror�[0m�[1m:�[0m test failed, to rerun pass `--test testsuite`
2024-02-13T13:22:45.9885887Z
2024-02-13T13:22:45.9886990Z test failed running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo check -vv`
2024-02-13T13:22:45.9888275Z error: stderr did not match:
2024-02-13T13:22:45.9888777Z 1   1            Fresh mb [..]
2024-02-13T13:22:45.9889189Z     2    +warning: the item `mb` is imported redundantly
2024-02-13T13:22:45.9889820Z     3    + --> target/.metabuild/metabuild-foo-0e2ce73c8cda338a.rs:1:5
2024-02-13T13:22:45.9890297Z     4    +  |
2024-02-13T13:22:45.9890545Z     5    +1 | use mb;
2024-02-13T13:22:45.9890899Z     6    +  |     ^^ the item `mb` is already defined here
2024-02-13T13:22:45.9891299Z     7    +  |
2024-02-13T13:22:45.9891623Z     8    +  = note: `#[warn(unused_imports)]` on by default
2024-02-13T13:22:45.9927602Z     9    +
2024-02-13T13:22:45.9928248Z     10   +warning: `foo` (build script) generated 1 warning
2024-02-13T13:22:45.9930583Z 2   11           Fresh foo [..]
2024-02-13T13:22:45.9931176Z 3   12        Finished `dev` profile [..]
2024-02-13T13:22:45.9931653Z
2024-02-13T13:22:45.9931665Z
2024-02-13T13:22:45.9932104Z other output:
2024-02-13T13:22:45.9932291Z
2024-02-13T13:22:45.9932297Z
2024-02-13T13:22:45.9932309Z
2024-02-13T13:22:45.9932316Z
2024-02-13T13:22:45.9932417Z failures:
2024-02-13T13:22:45.9932695Z     metabuild::metabuild_fresh

```
2024-02-17 14:13:00 +00:00
surechen
8100d27551 Remove unnecessary use mb; in metebuild.
Check this in PR #117772 in rustc.
2024-02-17 17:19:10 +08:00
bors
9090349adc Auto merge of #13441 - epage:snapbox, r=Muscraft
chore: Update snapbox
2024-02-16 16:56:57 +00:00
Ed Page
9f31f8c675 chore: Update snapbox 2024-02-16 10:27:48 -06:00
Ed Page
eab2f93453 test: Ensure snapbox works until CARGO_RUSTC_CURRENT_DIR is stabilized
Snapbox's polyfill for `CARGO_RUSTC_CURRENT_DIR` looks for the furthest
away `Cargo.toml`.
That works in our repo but won't work as a submodule in rustc.
This uses the `config.toml` hack for setting the variable.

I verified
- Without this, the polyfill is used
- With this, it is used
- Without this on nightly, the official `CARGO_RUSTC_CURRENT_DIR` is
  used
2024-02-16 10:27:48 -06:00
Weihang Lo
b82910fdba
docs(lockfile): make bullet points for version history 2024-02-16 10:07:06 -05:00
Weihang Lo
cd7cca369e
refactor: don't derive Default for ResolveVersion
This prevents a misuse of it.
2024-02-16 10:06:32 -05:00
Weihang Lo
9ae485df28
test(lockfile): v4 isn't the default for rust-version 1.77 2024-02-16 10:06:32 -05:00
Weihang Lo
fb95ac4887
feat: respect rust-version when generating lockfile
Respect `package.rust-version` when generating lockfile, so that
a package with an old MSRV will never get an incompatible lockfile,
even when using the latest Cargo.

Users are still able to edit the `version` field in the lockfile
manually, if they intend to switch to a specific lockfile version.
2024-02-16 10:06:00 -05:00
Weihang Lo
92b82d6134
test: demonstrate old lockfile compat matrix 2024-02-16 10:05:59 -05:00
Weihang Lo
7b0919399d
feat(cargo-util-schemas): TryFrom<PartialVersion> for RustVersion 2024-02-16 10:05:59 -05:00
Weihang Lo
10b8e7bdac
refactor: always get max rust-version from workspace 2024-02-16 10:05:59 -05:00
bors
8ad0e18b54 Auto merge of #13449 - Xeonacid:openssl, r=epage
chore(deps): update openssl to 3.2.1 again

https://github.com/rust-lang/cargo/pull/13159 had updated to 3.2.0 and https://github.com/rust-lang/cargo/pull/13179 reverted to 1.1.1 for riscv64 build.

riscv64 build issue fixed and released in openssl-src 300.2.3+3.2.1: https://github.com/alexcrichton/openssl-src-rs/pull/230

Update to 3.2.1 from 3.2.0 should be safe.
2024-02-16 14:51:43 +00:00
bors
63581b3fde Auto merge of #13448 - epage:test, r=weihanglo
fix(test): Suggest `--` for libtest arguments

We already do this so long as the argument doesn't look like a `cargo test` argument (e.g. `--show-output`)
but `--ignored` looks like `--ignore-rust-version` do the the suggestion algorithms prefix checks.

Before
```
error: unexpected argument '--ignored' found

  tip: a similar argument exists: '--ignore-rust-version'

Usage: cargo test --ignore-rust-version [TESTNAME] [-- [ARGS]...]

For more information, try '--help'.
```
After
```
error: unexpected argument '--ignored' found

  tip: a similar argument exists: '--ignore-rust-version'
  tip: to pass '--ignored' as a value, use '-- --ignored'

Usage: cargo test --ignore-rust-version [TESTNAME] [-- [ARGS]...]

For more information, try '--help'.
```

This was fixed in clap-rs/clap#5356 and we just need to update to take advantage of it.

Fixes #12494
2024-02-16 13:53:15 +00:00
Xeonacid
37df88f0c9
chore(deps): update openssl to 3.2.1 again
https://github.com/rust-lang/cargo/pull/13159 had updated to 3.2.0 and https://github.com/rust-lang/cargo/pull/13179 reverted to 1.1.1 for riscv64 build.

riscv64 build issue fixed and released in openssl-src 300.2.3+3.2.1: https://github.com/alexcrichton/openssl-src-rs/pull/230

Update to 3.2.1 from 3.2.0 should be safe.

Signed-off-by: Xeonacid <xeonacid@hit.edu.cn>
2024-02-16 21:49:04 +08:00
Ed Page
6f93fa701e fix(test): Suggest -- for libtest arguments
We already do this so long as the argument doesn't look like a
`cargo test` argument (e.g. `--show-output`)
but `--ignored` looks like `--ignore-rust-version` do the the suggestion
algorithms prefix checks.

Before
```
error: unexpected argument '--ignored' found

  tip: a similar argument exists: '--ignore-rust-version'

Usage: cargo test --ignore-rust-version [TESTNAME] [-- [ARGS]...]

For more information, try '--help'.
```
After
```
error: unexpected argument '--ignored' found

  tip: a similar argument exists: '--ignore-rust-version'
  tip: to pass '--ignored' as a value, use '-- --ignored'

Usage: cargo test --ignore-rust-version [TESTNAME] [-- [ARGS]...]

For more information, try '--help'.
```

Fixes #12494
2024-02-16 07:11:12 -06:00
bors
57d14e4784 Auto merge of #13442 - epage:msrv, r=weihanglo
chore(ci): Drop MSRV:1 patch field

This was missed when I did MSRV:3

This make it less annoying for people to keep up on every patch with their own MSRVs.
2024-02-15 19:50:53 +00:00
bors
4506d41f14 Auto merge of #13446 - epage:add-period, r=arlosi
fix(add): Remove inconsistent period

Don't see this in other status messages, so removing it
2024-02-15 19:18:10 +00:00
bors
30addeaa90 Auto merge of #13434 - epage:add-features, r=weihanglo
fix(add): Ensure users know a feature is being created

Inspired by #13430 and #13411
2024-02-15 18:29:11 +00:00
bors
acc054c91d Auto merge of #13444 - ehuss:fix-custom-target, r=epage
Update tests for changes in latest nightly

There were two changes that has caused nightly tests to start failing:
* LLVM was updated, and that caused a change in the expected data layout for the target. (https://github.com/rust-lang/rust/pull/120055 update to LLVM 18)
* https://github.com/rust-lang/rust/pull/121049 Do not point at `#[allow(_)]` as the reason for compat lint triggering. The test was looking for the `unused_variables` note, which is no longer printed.
2024-02-15 17:46:50 +00:00
Eric Huss
52d2303dd0 Update future-incompat output test for latest nightly. 2024-02-15 09:36:40 -08:00
Eric Huss
d3c2a7723f Update target data layout for LLVM update. 2024-02-15 08:47:26 -08:00
Ed Page
22e1f9f124 chore(ci): Drop MSRV:1 patch field
This was missed when I did MSRV:3

This make it less annoying for people to keep up on every patch with
their own MSRVs.
2024-02-15 10:03:56 -06:00
bors
9d23d30943 Auto merge of #13436 - ehuss:clarify-build-script-metadata, r=epage
docs: Minor clarification of build script metadata.

This adds a minor clarification to the build script docs around links metadata. "As mentioned above in the output format" didn't really clue me in to what section it was talking about, or clearly tell me how to set the metadata.
2024-02-12 23:43:32 +00:00
Eric Huss
2630813d15 docs: Minor clarification of build script metadata. 2024-02-12 15:31:03 -08:00
bors
10a7f20ba0 Auto merge of #13435 - ehuss:fix-old-cargos, r=epage
Fix old_cargos tests

Some of these tests have bitrotted a bit since they aren't enabled by default. The issues are:

* Change to `config` to `config.toml` shouldn't have been made to this test since old cargos can't read config.toml.
* Cargo's own `Carog.toml` now using dotted keys breaks parsing on some old versions, ignore them.
* `cargo pkgid` is now emitting a different format.
* #13085 changed how packages are published in the testsuite to correctly include the `[features]` table in the generated `Cargo.toml`. This exposed an oversight in the `old_cargos::new_features` test wasn't actually testing things correctly. It now correctly illustrates the errors received in older versions. I have a vague memory of this, but I don't remember why it was done this way.
* #10907 changed the default config to use `[registries]` instead of `[source]` to implement source replacement of crates.io. Older versions can't handle that.

Some of these tests probably should just be deleted, since I don't think they are really bringing much value. Or at least they should have some floor that they won't test under. However, I'm not quite ready to do that.
2024-02-12 19:11:12 +00:00
Eric Huss
01d8a2d815 Fix old_cargos tests 2024-02-12 10:41:34 -08:00
bors
e4d67863fa Auto merge of #13433 - arlosi:builtin-replacement-messages, r=epage
Fix confusing error messages for sparse index replaced source

The built-in sparse crates.io index `index.crates.io` is implemented in Cargo using source replacement.

When an error occurs downloading from the sparse index, the message includes text that looks like the user configured source replacement, even when they did not.

This change extends the special case for the built-in replacement of crates.io to include all the error messages for source replacement in addition the the description special case.
2024-02-12 17:11:04 +00:00
Ed Page
bdc4e8ded0 fix(add): Remove inconsistent period
Don't see this in other status messages, so removing it
2024-02-12 11:06:04 -06:00
Ed Page
dbdebc378a fix(add): Ensure users know a feature is being created
Inspired by #13430 and #13411
2024-02-12 11:05:32 -06:00
Arlo Siemsen
dbd7c989a7 Fix confusing error messages for sparse index replaced source 2024-02-12 10:59:05 -06:00
bors
06a19e6725 Auto merge of #13429 - ehuss:edition-2024-lint, r=epage
Enable edition migration for 2024

This enables `cargo fix --edition` to migrate to the 2024 edition. The lint group is now available in rustc.
2024-02-10 21:45:15 +00:00
Eric Huss
fa7ec127ff Enable edition migration for 2024 2024-02-10 13:38:54 -08:00