Commit graph

17607 commits

Author SHA1 Message Date
Tor Hovland b95fb6e2bf refactor: cargo_generate_lockfile -> cargo_update. 2024-06-05 11:54:51 +02:00
bors 4b681c7338 Auto merge of #13980 - epage:compare, r=hi-rustin
refactor: Transition direct assertions from cargo-test-support to snapbox

### What does this PR try to resolve?

Cargo has a bespoke testing framework for functional tests
- Extra stuff for us to maintain
- Don't leverage benefits from contributions related to other projects
- Less incentive to be thoroughly documented

UI tests are written using snapbox.  The latest release of snapbox (#13963) was geared at supporting cargo's needs in the hope that we can consolidate on testing frameworks.

Besides having a single set of semantics, benefits we'd gain include
- Updating of test snapshots
- Fancier redacting of test output (e.g. #13973)

This is the first incremental step in this direction.  This replaces direct assertions with snapbox assertions.  This still leaves all of the CLI output assertions. These will be done incrementally.

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

### Additional information
2024-06-02 14:48:01 +00:00
bors 721cd55bf6 Auto merge of #14000 - linyihai:fix-env-prefix, r=weihanglo
Fix: Skip deserialization of unrelated fields with overlapping name

### What does this PR try to resolve?

Split from https://github.com/rust-lang/cargo/pull/13687#discussion_r1622694446

This fixes the overlap of environment variable names:

> For example, when env_key is UNSTABLE_GITOXIDE_FETCH
and field_key is UNSTABLE_GIT, the field shouldn't be
added because `unstable.gitoxide.fetch` doesn't
belong to `unstable.git` struct.

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

Updates of test cases `struct_with_overlapping_inner_struct_and_defaults` can be used to compare changes before and after changes

### Additional information
r? weihanglo and very appreciate your more optimized code
2024-06-01 13:24:23 +00:00
Lin Yihai d347704b1a Fix: Skip deserialization of unrelated fields with overlapping name 2024-06-01 13:25:49 +08:00
bors 52ebc6a39f Auto merge of #13996 - rust-lang:renovate/alpine-3.x, r=weihanglo
chore(deps): update alpine docker tag to v3.20

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| alpine | final | minor | `3.19` -> `3.20` |

---

### Configuration

📅 **Schedule**: Branch creation - "before 5am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/rust-lang/cargo).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNzcuOCIsInVwZGF0ZWRJblZlciI6IjM3LjM3Ny44IiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->
2024-06-01 01:47:36 +00:00
renovate[bot] a2e32f2493
chore(deps): update alpine docker tag to v3.20 2024-06-01 00:52:26 +00:00
bors 7a6fad0984 Auto merge of #13992 - epage:config, r=weihanglo
fix(config): Ensure `--config net.git-fetch-with-cli=true` is respected

### What does this PR try to resolve?

#13479 changed the global context initialization order so that command line stuff is processed after we read some config.
This had a side effect of breaking `--config net.git-fetch-with-cli=true`.
I reverted the change to restore support for `--config`.

Fixes #13991

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

### Additional information

This reverts commit f525e1f383.

This removes color control from warnings for unstable features.
For some reason this removed color support from `cargo -Zhelp` in the
tests but I can't reproduce it locally.

The most important thing was getting the config fix in.
There are two follow ups
- Can we have the config working *and* color?
- Why did this fail for this field and not the others we already had
  tests for?

I ran out my immediate time box for looking into these.
2024-05-31 22:26:03 +00:00
Ed Page 4ce2b61f2a Revert "fix(context): Configure Shell before emitting messages"
This reverts commit f525e1f383.

This removes color control from warnings for unstable features.
For some reason this removed color support from `cargo -Zhelp` in the
tests but I can't reproduce it locally.

The most important thing was getting the config fix in.
There are two follow ups
- Can we have the config working *and* color?
- Why did this fail for this field and not the others we already had
  tests for?

I ran out my immediate time box for looking into these.

Fixes #13991
2024-05-31 14:56:18 -05:00
Ed Page c0a79574ef test(config): Show current git-fetch-with-cli behavior 2024-05-31 14:56:12 -05:00
bors 9ba3894b16 Auto merge of #13990 - riley-williams:doc-outdated-libcurl-url, r=epage
Fix libcurl proxy documentation link

### What does this PR try to resolve?

Fixes a broken link to the libcurl proxy documentation by updating it with new location.
2024-05-31 17:27:05 +00:00
Riley Williams 0bdfae1c43
Update url to new libcurl proxy doc location 2024-05-31 12:58:50 -04:00
bors d04355a8c4 Auto merge of #13987 - epage:new, r=ehuss
fix(new): Dont say were adding to a workspace when a regular package is in root

Fixes #13985
2024-05-31 16:39:32 +00:00
bors ef56deb268 Auto merge of #13970 - weihanglo:libgit2@1.8.0, r=ehuss
fix: adjust custom err from cert-check due to libgit2 1.8 change
2024-05-31 15:33:28 +00:00
bors 4a86f6f34d Auto merge of #13989 - epage:target-sort, r=weihanglo
fix(toml): Ensure targets are in a deterministic order

### What does this PR try to resolve?

With #13713, we enumerate all targets in `Cargo.toml` on `cargo publish` and `cargo vendor`.
However, the order of the targets is non-determistic. This can be annoying for comparing the published `Cargo.toml` across releases but even worse is the churn it causes for `cargo vendor`.

So we sort all the targets during publish.
This keeps costs minimal with the following risks
- If the non-determinism shows up in a way that affects developers during development
- If there is a reason the user wants to control target order for explicit targets

Fixes #13988

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

As for writing of tests, I'm unsure why none of our existing tests failed which makes it unclear to me what would be needed to write a test for this.

### Additional information
2024-05-31 15:02:05 +00:00
Ed Page 40b9fec255 fix(toml): Ensure targets are in a deterministic order
With #13713, we enumerate all targets in `Cargo.toml` on `cargo publish`
and `cargo vendor`.
However, the order of the targets is non-determistic.
This can be annoying for comparing the published `Cargo.toml` across releases but even
worse is the churn it causes for `cargo vendor`.

So we sort all the targets during publish.
This keeps costs minimal with the following risks
- If the non-determinism shows up in a way that affects developers
  during development
- If there is a reason the user wants to control target order for
  explicit targets

Fixes #13988
2024-05-31 09:18:57 -05:00
Weihang Lo 0978162ebe
fix: adjust custom err from cert-check due to libgit2 1.8 change
libgit2 disallows overriding errors from certificate check since v1.8.0,
so we store the error additionally and unwrap it later.

See 9a9f220119
2024-05-31 00:39:30 -04:00
Ed Page 26c1678ad2 fix(new): Dont say were adding to a workspace when a regular package is in root
Fixes #13985
2024-05-30 13:27:12 -05:00
bors 94aa7fb132 Auto merge of #13984 - weihanglo:cargo-package, r=epage
doc(cargo-package): explain no guarantee of vcs provenance
2024-05-30 15:11:52 +00:00
Weihang Lo 22185e14fa
doc(cargo-package): explain no guarantee of vcs provenance 2024-05-30 09:46:23 -04:00
bors 0b72605141 Auto merge of #13982 - VitalikButerinEth:master, r=hi-rustin
chore: fix some comments
2024-05-30 12:50:08 +00:00
VitalikButerinEth d3e05d588e chore: fix some comments
Signed-off-by: VitalikButerinEth <csyingyu@126.com>
2024-05-30 16:28:40 +08:00
Ed Page 995746b937 refactor: Port from matches_contains to assert_e2e 2024-05-29 14:08:10 -05:00
Ed Page eee1053384 refactor: Port from matches_unordered to assert_e2e 2024-05-29 14:08:10 -05:00
Ed Page 3054936cab refactor: Port from assert_matches_exact to assert_e2e
This leaves off `validate_crate_contents` as that would be an effort on
its own
2024-05-29 14:08:10 -05:00
Ed Page fe5c2d393a refactor(test): Pull out end-to-end literal redactions 2024-05-29 14:08:10 -05:00
Ed Page ea36ed09f3 refactor(test): Share redactions between ui and e2e 2024-05-29 14:08:10 -05:00
Ed Page 94119af2a5 docs(test): Clarify role of assert_ui 2024-05-29 14:08:10 -05:00
Ed Page f22c43b87d fix(test)!: Hide API that isnt used by Cargo 2024-05-29 14:08:10 -05:00
Ed Page 995c2b75ee chore: Upgrade to snapbox 0.6.7
This comes with improved redacting on mismatches which will provide
more focused assertions and there will be less need for intervention on
snapshot updates.

This also gives more flexibility with placeholders
2024-05-29 14:07:15 -05:00
bors 2c8d176e60 Auto merge of #13974 - weihanglo:precise-yank, r=arlosi
feat: stabilize `cargo update --precise <yanked>`

### What does this PR try to resolve?

Stabilize `cargo update --precise <yanked>`.

The cargo team has discussed the stabilization in the meeting today.
The interface of this is quite small and not as controversial as `--precise <pre-release>`,
since there is no version requirement operators involved.
We'd like to move forward and stabilize this part.

Note that `--precise <yanked>` allows using yanked version only for the specified package,
We leave the cascading allowing yanked versions (e.g. <https://github.com/rust-lang/cargo/issues/4225#issuecomment-1930353693>) as a future extension.

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

Check if any adjustment needed for warnings and CLI help text.

### Additional information

cc <https://github.com/rust-lang/cargo/issues/4225>.
2024-05-29 18:43:12 +00:00
bors cbc12a2ebe Auto merge of #13976 - heiher:master, r=weihanglo
Update openssl-src to 111.28.2+1.1.1w

### What does this PR try to resolve?

This PR is to fix the build of `loongarch64-unknown-linux-musl` target.

Update `openssl-src` from `111.28.1+1.1.1w` to `111.28.2+1.1.1w`.

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

Nothing special.

### Additional information

openssl-src diffs:  cb7b3c8862...8c19f63843
2024-05-29 12:28:59 +00:00
WANG Rui e57b6ab573 Update openssl-src to 111.28.2+1.1.1w 2024-05-29 11:59:16 +08:00
bors 431db31d0d Auto merge of #13958 - Urgau:check-cfg-config-fingerprint, r=epage
Include `lints.rust.unexpected_cfgs.check-cfg` in the fingerprint

### What does this PR try to resolve?

When changing the `--check-cfg` args in the `lints.rust.unexpected_cfgs.check-cfg` lint config, the build should be restarted as the arguments we pass to the compiler change, and they can change the diagnostics output by generating new or removing some `unexpected_cfgs` warning(s).

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

Look at the before and after test (separate commit).

### Additional information

Similar to https://github.com/rust-lang/cargo/pull/13012 which did that for the declared features.
Contrary to that PR, I didn't add a new `DirtyReason` variant, since even the `[lints]` table didn't get one.

r? `@epage`
2024-05-28 18:17:31 +00:00
Urgau dfb69e6076 Include lints.rust.unexpected_cfgs.check-cfg into the fingerprint 2024-05-28 20:02:47 +02:00
Weihang Lo a076f7921b
feat: stabilize cargo update --precise <yanked> 2024-05-28 13:13:56 -04:00
bors 2415192bcd Auto merge of #13973 - epage:elapsed, r=weihanglo
feat(test): Auto-redact elapsed time

By making this a redaction,
it automatically gets applied when generating the snapshot,
removing these extra steps
(that you likely only discover after the fact and have to debug)
2024-05-28 17:06:13 +00:00
bors 11d0002ea0 Auto merge of #13963 - epage:snapbox, r=weihanglo
chore: Update to snapbox 0.6

### What does this PR try to resolve?

This unblocks regex redactions which will help with `Finished in 3.45s` messages as well as maybe switching away from `compare.rs` generally.

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

### Additional information
2024-05-28 03:48:38 +00:00
Ed Page 5ea1c8fea9 feat(test): Auto-redact elapsed time 2024-05-27 21:27:25 -05:00
Ed Page 9af864ee55 refactor: Resolve deprecations 2024-05-27 21:27:03 -05:00
Ed Page eafc743c0d chore: Update to snapbox 0.6
We needed to tweak the redactions because snapbox no longer normalizes
slashes on redactions unless the data type is a `PathBuf`.
2024-05-27 21:26:20 -05:00
Ed Page 0bd034cd06 refactor(test): Split up calls by type 2024-05-27 21:24:43 -05:00
Ed Page 4a6f25c112 refactor: Resolve snapbox deprecations 2024-05-27 10:28:13 -05:00
bors 95eeafa3ba Auto merge of #13969 - weihanglo:full-commit-sha, r=epage
fix: check if rev is full commit sha for github fast path
2024-05-27 14:19:11 +00:00
Weihang Lo 26c88db051
fix: check if rev is full commit sha for github fast path 2024-05-27 09:56:49 -04:00
bors 37e5f13989 Auto merge of #13964 - surechen:fix_for_lint_copy_drop, r=weihanglo
test: switch from `drop` to `let _` due to nightly rustc change

Fix test error in https://github.com/rust-lang/rust/pull/125533
As lint dropping_copy_types will give suggsetion in this situation.(Changed in https://github.com/rust-lang/rust/pull/125433)
r? `@weihanglo`
2024-05-25 16:10:38 +00:00
surechen 1c8da38a5c Fix test error in https://github.com/rust-lang/rust/pull/125533
As lint dropping_copy_types will give suggsetion in this
situation.(Changed in https://github.com/rust-lang/rust/pull/125433)
2024-05-25 23:49:13 +08:00
Ed Page 602f2f2e21 chore: Upgrade to snapbox 0.5.14 2024-05-24 14:55:47 -05:00
Ed Page fc733032b3 chore: Bump cargo-credential 2024-05-24 14:55:42 -05:00
Urgau 3ca2120180 Add test for check-cfg config fingerprint not changing 2024-05-24 20:46:24 +02:00
bors a8d72c675e Auto merge of #13956 - linyihai:missing-fields, r=weihanglo
Improve error description when deserializing partial field struct

### What does this PR try to resolve?

Fixes #13688

### How should we test and review this PR?
one commit add test, one commit fixed and update the test.

### Additional information
2024-05-24 03:34:17 +00:00