910 Commits

Author SHA1 Message Date
Ed Page
047c1fe9d0 refactor(toml): Rely on resolved categories 2024-03-28 13:33:23 -05:00
Ed Page
258d8447a9 refactor(toml): Rely on resolved keywords 2024-03-28 13:33:23 -05:00
Ed Page
d435d0e72a refactor(toml): Rely on resolved readme 2024-03-28 13:33:23 -05:00
Ed Page
c62a559d82 refactor(toml): Rely on resolved documentation 2024-03-28 13:33:23 -05:00
Ed Page
5b5f64460b refactor(toml): Rely on resolved homepage 2024-03-28 13:33:23 -05:00
Ed Page
f96638ea3b refactor(toml): Rely on resolved description 2024-03-28 13:33:23 -05:00
Ed Page
102b5890be refactor(toml): Rely on resolved edition
Returning a `&String` is unusual but this keeps things easier on both
sides.
2024-03-28 13:33:23 -05:00
Ed Page
b3183596cc refactor(toml): Rely on resolved rust-version
This also removes duplicated inheritance and one of them specifying the
wrong field.
2024-03-28 13:33:23 -05:00
Ed Page
6ad976912d refactor(toml): Rely on resolved version 2024-03-28 13:33:23 -05:00
Paul Mabileau
f422e96b31
Docs(crates/cargo-test-*): Add external usage warning
As discussed in #10147.

Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2024-03-26 11:17:34 +01:00
Paul Mabileau
6f581e9056
Chore(xtask-bump-check): Exclude cargo-test-* to make corresponding CI check pass
Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2024-03-26 11:17:34 +01:00
Paul Mabileau
2879fc0d60
Chore(cargo-test-*/Cargo.toml): Bump MSRVs to make corresponding CI check pass
Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2024-03-26 11:16:12 +01:00
Paul Mabileau
d691d034c7
Chore(cargo-test-*/Cargo.toml): Bump versions to make ci/validate-version-bump.sh pass
Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2024-03-26 11:14:14 +01:00
Paul Mabileau
f9b5702755
Chore(cargo-test-*/Cargo.toml): Standardize basic fields for publication
Marks the crates as publishable.

Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2024-03-26 11:11:51 +01:00
Paul Mabileau
80300763b1
Chore(cargo-test-*): Add license file links
Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2024-03-26 11:09:32 +01:00
Ed Page
451babb370 chore: Bump versions 2024-03-25 14:13:38 -05:00
renovate[bot]
ccc31b4ddf chore(deps): update msrv 2024-03-25 14:13:38 -05:00
Ed Page
4ab2797f36 feat(lock): Print lockfile changes on all commands 2024-03-12 13:39:56 -05:00
bors
d438c80c45 Auto merge of #13603 - epage:toml3, r=weihanglo
refactor(toml): Expose surce/spans for VirtualManifests

### What does this PR try to resolve?

This is a follow up to #13593, expanding support from `Manifest` to `VirtualManifest` as well.

This also does other clean up along the way in preparation for making a more explicit `resolve_toml` phase.

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

### Additional information
2024-03-19 16:11:22 +00:00
Martin Robinson
8fa25ba41d chore: Fix minor grammar nit in command-line help
A *very* minor grammar correction. "Require" used in this way is
typically followed by the infinitive.
2024-03-18 14:32:28 +01:00
Ed Page
8152bfbb5e refactor(core): Expose all of the variants of VirtualManifests 2024-03-15 21:14:50 -05:00
bors
2fe739fcf1 Auto merge of #13591 - epage:namespace, r=weihanglo
feat: Add 'open-namespaces' feature

### What does this PR try to resolve?

This is a step towards #13576

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

### Additional information
2024-03-15 21:39:18 +00:00
Ed Page
9ea3f260a8 feat(toml): Add support for open namespaces 2024-03-15 12:54:05 -05:00
Ed Page
ff454fd452 refactor(toml): Consolidate how we track unused keys
This makes it act more like everything else, making this easier to
evolve over time.
2024-03-15 12:00:06 -05:00
Ed Page
c272cd7e37 refactor(toml): Resolve toml_edit deprecations 2024-03-15 12:00:06 -05:00
Ed Page
b321285501 refactor(schema): Decouple forms of name validation 2024-03-15 11:49:07 -05:00
LuuuX
fb616a0f69 fix: bump check error 2024-03-14 21:28:14 +08:00
Ed Page
134ed93f60 fix: Consistently compare MSRVs
We used several strategies
- Relying in `impl Ord for RustVersion`
- Converting to version requirements
  - Decrementing a version

This consolidates around one strategy: `RustVersion::is_compatible_with`
- Ensure the comparisons have the same behavior
- Centralize knowledge of how to handle pre-release rustc
- Losslessly allow comparing with either rustc or workspace msrv
2024-03-05 10:59:08 -06:00
Ed Page
46584a4d6b refactor(schema): Pull RustVersion out into a mod 2024-03-04 16:45:58 -06:00
Ed Page
a980eed118 refactor(schema): Make manifest its own directory 2024-03-04 16:44:05 -06:00
Bryan Garza
604d2e40e2 chore: update pulldown-cmark to 0.10.0
Fixes: https://github.com/rust-lang/cargo/issues/13509
2024-03-04 20:14:44 +00:00
Ed Page
67b5aa4205 refactor(context): Rename config mod to context 2024-02-29 16:08:08 -06:00
Ed Page
14646e6af6 test: Make edition explicit on packages 2024-02-22 11:37:03 -06:00
Weihang Lo
d090365234
refactor: rename non-global context _gctx to _ctx 2024-02-23 15:30:44 -05:00
Ed Page
b14a70fe09 test(cli): Verify terminal styling
This uses a new feature from snapbox that let's us render terminal
styling in SVG files.  This let's us see / visualize ANSI escape codes,
including in github's UI (will render images, including side-by-side
images for diffs).
2024-02-21 20:20:41 -06:00
bors
e08a81333c Auto merge of #13281 - LuuuXXX:issue-10729, r=epage
fix(add): Improve error when adding registry packages while vendored

### **What does this PR try to resolve?**

When a vendored directory is established, cargo add no longer adds new packages. Instead, it tries to translate a package name into a package that already exists in the vendored directory.
[More details](https://github.com/rust-lang/cargo/issues/10729#issue-1260548746)

Since `@epage` has done most of the work, here I do the rest of the finishing work.

Improves the error from #10729

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

The implementation procedure is as follows:
https://github.com/rust-lang/cargo/issues/10729#issuecomment-1191633351

Test steps:
1. Try to get an arbitrary crate and execute `cargo vendor` command.
2. Configure the vendor directory in .cargo/config.toml.
3. Add `alter-registry` to the config.toml file.
```
[registries]
alter-registry= { index = "XXX" }
```
4. run the same `cargo add` command.
```
cargo add another-crate --registry alter-registry
```
2024-02-22 17:28:17 +00:00
LuuuX
640c0774da Rename Fuzzy to Alternatives 2024-02-22 14:08:46 +08:00
LuuuX
a31184b9eb Added QueryKind::Normalized, and used it in cargo-add 2024-02-22 13:36:28 +08:00
bors
cafbc12bd9 Auto merge of #13467 - ehuss:global-tracker-old-cargo, r=weihanglo
Add global_cache_tracker stability tests.

This adds some tests to ensure that the database used in the global cache tracker stays compatible across versions. These tests work by using rustup to run both the current cargo and the stable cargo, and verifying that when switching versions, everything works as expected.

These tests will be ignored on developer environments if they don't have rustup, or don't have the stable toolchain installed. It does assume that "stable" is at least 1.76. It is required for the tests to run in CI, but will be disabled in rust-lang/rust since it does not have rustup.

I'm not expecting too much trouble with these tests, but if they become too fiddly or broken, they can always be changed or removed.

The support code for running "cargo +stable" is very basic right now. If we expand to add similar tests in the future, then I think we could consider adding support functions (such as [`tc_process`](64ccff290f/tests/testsuite/old_cargos.rs (L21-L36))) to make it easier or more reliable.
2024-02-21 21:32:07 +00:00
Eric Huss
a82794ec4a Fix path issues for running rustup wrapper on Windows.
Cargo likes to modify PATH, which circumvents the ability to choose the
correct "cargo" executable to run on Windows (because Windows uses PATH
for both binary and shared library searching).
2024-02-20 16:27:04 -08:00
Eric Huss
ccaa118d27 Add workaround for RUSTUP_WINDOWS_PATH_ADD_BIN.
On Windows, rustup has an issue with recursive cargo invocations. This
commit can be removed once
https://github.com/rust-lang/rustup/issues/3036 is resolved.
2024-02-20 13:24:50 -08:00
Eric Huss
8bb62310e5 cargo_test CI macro: add requires_rustup_stable
This adds the `requires_rustup_stable` option to the cargo_test macro to
require `rustup` to exist, and for the `stable` toolchain to be
installed.

It is required that stable be installed in Cargo's CI. On a developer
machine, the tests will be ignored if rustup is not installed. It will
also be ignored on rust-lang/rust's CI since it does not have rustup.
2024-02-20 12:36:03 -08:00
Eric Huss
f9ba89b0cd Add Execs::args
This adds the `Execs::args` method which forwards to
`ProcessBuilder::args` to specify multiple command arguments at once.
2024-02-20 12:33:32 -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
2e878a4c38 test: Remove empty snapshots for help 2024-02-20 13:05:16 -06:00
Scott Schafer
305efa63cc
chore: Rename Config to GlobalContext 2024-02-20 11:55:15 -07: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
Ed Page
9f31f8c675 chore: Update snapbox 2024-02-16 10:27:48 -06: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