18593 Commits

Author SHA1 Message Date
bors
ee6f1c8ee8 Auto merge of #14487 - ehuss:fix-elided-lifetime, r=epage
Fix elided lifetime

This fixes an issue with the recent nightly that has added a lint (https://github.com/rust-lang/rust/pull/129207) that warns about the lack of a lifetime, which looks like:

```
warning: elided lifetime has a name
   --> src/cargo/core/workspace.rs:580:66
    |
580 |     pub fn default_members<'a>(&'a self) -> impl Iterator<Item = &Package> {
    |                            -- lifetime `'a` declared here        ^ this elided lifetime gets resolved as `'a`
    |
    = note: `#[warn(elided_named_lifetimes)]` on by default
```
2024-09-02 22:58:30 +00:00
Eric Huss
2597cdf770 Fix implicit_features_edition_2024 matching rust version
This test should not be matching the exact Rust version.
2024-09-02 15:18:01 -07:00
Eric Huss
e21f0d018e Fix elided lifetime 2024-09-02 14:52:00 -07:00
bors
cf88141806 Auto merge of #14478 - rust-lang:renovate/pasetors-0.x, r=ehuss
chore(deps): update rust crate pasetors to 0.7.0

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [pasetors](https://togithub.com/brycx/pasetors) | workspace.dependencies | minor | `0.6.8` -> `0.7.0` |

---

### Release Notes

<details>
<summary>brycx/pasetors (pasetors)</summary>

### [`v0.7.0`](https://togithub.com/brycx/pasetors/blob/HEAD/CHANGELOG.md#070)

[Compare Source](https://togithub.com/brycx/pasetors/compare/0.6.8...0.7.0)

**Date:** August 28, 2024.

-   Bump MSRV to `1.80`.
-   Updated test vectors for `v3.public`.
-   (*BREAKING*) Improved error-handling during claims validation. Added `Error::ClaimValidation(ClaimValidationError)`, where `ClaimValidationError` now further specifies the validation error ([#&#8203;131](https://togithub.com/brycx/pasetors/pull/131), credits: [`@&#8203;jpramosi](https://togithub.com/jpramosi)).`

</details>

---

### 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 was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/rust-lang/cargo).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41Ni4wIiwidXBkYXRlZEluVmVyIjoiMzguNTYuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->
2024-09-01 14:13:55 +00:00
Jonas Dohse
9391bfb34d Fix #10680, Fix #13702 2024-09-01 15:49:34 +02:00
renovate[bot]
9fcfff47ce
chore(deps): update rust crate pasetors to 0.7.0 2024-09-01 03:14:40 +00:00
renovate[bot]
ccfd6a9d68
chore(deps): update rust crate core-foundation to 0.10.0 2024-09-01 01:15:17 +00:00
Ed Page
911f5e17b6 feat(resolve): Report MSRV compatible version instead of incomptible
This expands on #14461 to where only MSRV-compatible versions are
"actionable".  MSRV-incompatible versions are therefore unstyled.

We report the MSRV needed so people can choose to unblock by updating
their MSRV.  I had wondered if we should report the the absolute latest
MSRV-incompatible version or the one with the next higher MSRV from
where the user is at.  Both are reasonable use cases, so I erred with
absolute latest version.
2024-08-30 09:40:54 -05:00
Ed Page
ded3f004a4 fix(resolve): Generalize term describing updates
`latest` was easy.  `latest compatible` was ok.  But how do I talk about
"latest compatible with your MSRV".  That gets messy.
2024-08-30 09:26:56 -05:00
Jonas Dohse
140911cc12 Add test case for feature adding with fuzzy name #10680 2024-08-30 12:16:29 +02:00
Jonas Dohse
cdab0c0058 Add test case for fuzzy package adding issue #13702 2024-08-30 12:16:29 +02:00
Joe Neeman
4110b844fb Filter package specs while packaging 2024-08-30 10:10:46 +07:00
Joe Neeman
653025fdd5 Add test for package filtering with old edition 2024-08-30 10:10:46 +07:00
Ed Page
e14f690e6e refactor(resolve): Provide full access to summary 2024-08-29 16:55:36 -05:00
bors
c1fa840a85 Auto merge of #14461 - epage:actionable, r=Muscraft
fix(resolve): With `latest` message, differentiate actionable updates

### What does this PR try to resolve?

Instead of always listing the absolutely latest version as a warning
color, we now differentiate
- compatible updates are always actionable
- incompatible, direct deps are always actionable

These get reported and made yellow while non-actionable messages are
unstyled.

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

I just used a broad stroke to say "compatible" in the message means "semver
compatible" and use `^`
- We could focus on "compatible with dependent version reqs" which is
  what will be most actionable but seeing if we can get away without
  having to track all in-coming version reqs.
- We could be more nuanced in language but the more verbose we are, the
  more we take away from higher priority messages

### Additional information

This is not intended as *the* solution for #13908 though it experiments with what to do for that.
This is prep work for improved MSRV reporting where we will
differentiate this further by only considering MSRV-compatible updates as actionable
(or rustc-compatible when not using MSRV-aware reslver).
2024-08-29 21:03:53 +00:00
bors
33714c404e Auto merge of #14467 - epage:open-pkgid, r=Muscraft
fix(pkgid): Allow open namespaces in PackageIdSpec's

### What does this PR try to resolve?

This is a part of #13576

This unblocks #14433.  We have a test to ensure you can't publish a namespaced package and the error for that is getting masked in #14433 because the package name is getting  parsed as a `PackageIdSpec` which wasn't supported until this PR.

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

### Additional information
2024-08-29 20:31:35 +00:00
Ed Page
f4c7ed1990 fix(pkgid): Allow open namespaces in PackageIdSpec's 2024-08-28 10:35:16 -05:00
Ed Page
c81e82dffb refactor(pkgid): Pull out spec parsing 2024-08-28 10:19:13 -05:00
Ed Page
00604fa152 test(pkgid): Show existing pkgid behavior 2024-08-28 10:03:37 -05:00
Ed Page
8dd37c1d22 refactor(schema): Pull out test helpers for reuse 2024-08-28 10:03:37 -05:00
bors
59ecb11a29 Auto merge of #14459 - epage:msrv-rustc, r=Muscraft
feat(resolve): Report incompatible-with-rustc when MSRV-resolver is disabled

### What does this PR try to resolve?

This builds on #14457 to report when deps are incompatible with rustc when an MSRV-aware resolver is not used.
This affects stable code.

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

### Additional information
2024-08-27 20:51:07 +00:00
Ed Page
353cd87cea fix(resolve): With latest message, differentiate actionable updates
Instead of always listing the absolute latest version as a warning
color, we now differentiate
- compatible updates are always actionable
- incompatible, direct deps are always actionable

These get reported and made yellow while non-actionable messages are
unstyled.

This is not intended as *the* solution for #13908 though it makes
improvements in that direction.
This is prep work for improved MSRV reporting where we will
differentiate this further by only considering MSRV-compatible updates as actionable
(or rustc-compatible when not using MSRV-aware reslver).

I just used a broad stroke to say "compatible" in the message means "semver
compatible" and use `^`
- We could focus on "compatible with dependent version reqs" which is
  what will be most actionable but seeing if we can get away without
  having to track all in-coming version reqs.
- We could be more nuanced in language but the more verbose we are, the
  more we take away from higher priority messages
2024-08-27 13:40:03 -05:00
Ed Page
545ca21d71 refactor(resolve): Give more details to 'report_latest' 2024-08-27 13:40:03 -05:00
Ed Page
78d67959ed refactor(resolve): Give room for more policies 2024-08-27 13:31:17 -05:00
Ed Page
c60d3175f0 refactor(resolve): Give report_latest more formatting control 2024-08-27 13:00:40 -05:00
bors
b8a4f1bc2d Auto merge of #14457 - epage:msrv, r=ehuss
fix(resolve): Report incompatible packages with precise Rust version

### What does this PR try to resolve?

In #14401, we reported about MSRV issues as if we were the resolver.  We can be smarter than that though and report precise MSRV information.  This allows us to elevate the message from color from yellow to red.

This is also prep work for telling users when a newer, MSRV-compatible version of a package is available.

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

The report function I added is a little odd because a follow up commit will update it to report when a package is incompatible with rustc when the MSRV resolver is disabled and do this on stable.

### Additional information

This builds on #14445 to improve #14401
2024-08-27 17:46:40 +00:00
bors
ef854d2f66 Auto merge of #14445 - epage:locked, r=weihanglo
fix(resolve): Dont show locking workspace members

### What does this PR try to resolve?
This is for `cargo generate-lockfile` and when syncing the lockfile with
the manifest.
We still show it for `cargo update` because of `cargo update
--workspace`.

We hacked around this previously by filtering out the `num_pkgs==1` case
for single packages but this didn't help with workspaces.

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

### Additional information

This builds on #14440
2024-08-26 22:16:00 +00:00
Ed Page
3c19a8cb7b feat(resolve): Report incompatible with rustc when MSRV-resolve disabled 2024-08-26 14:12:54 -05:00
Ed Page
3e315518c6 fix(resolve): Elevate the MSRV severity style now that its precise 2024-08-26 14:12:45 -05:00
bors
f2d1e37b56 Auto merge of #14453 - Mark-Simulacrum:debug-no-errors, r=weihanglo
Log details of failure if no errors were seen

### What does this PR try to resolve?

Crater has started (some time ago, though exact point is not known) to see failures in crates without logging an error. We're suspecting that there's something wrong in Cargo or rustc, but it's also possible that Crater itself is at fault. In any case, this should provide more details.

cc https://github.com/rust-lang/crater/issues/733

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

My hope is that this is reasonable to land without additional tests -- as-is, we expect it to never happen (there's even a debug assert later in the same code path) but it seems it *is* happening sometimes in the wild.
2024-08-26 08:48:21 +00:00
Mark Rousskov
ecfc899636 Log details of failure if no errors were seen 2024-08-25 16:03:11 -04:00
Jonathan Schwender
38d2dd6d2a
uplift windows gnullvm import libraries
Same changes as #8141, but for gnullvm.
gnullvm does not seem to be tested in CI, so tests were not adjusted.
2024-08-25 15:09:05 +08:00
bors
3d2cf56d40 Auto merge of #14436 - kornelski:where-are-the-features, r=epage
More helpful missing feature error message

The "none of the selected packages contains these features" error does not say which packages are selected, and does not say which packages do have the requested features.

If any package in the workspace has the requested feature (matching exactly), the error suggests selecting that package, instead of trying alternative spellings.
2024-08-25 01:59:10 +00:00
Kornel
e8b28cf87e
More helpful missing feature error message 2024-08-24 02:24:32 +01:00
Ed Page
437b73ceb3 fix(resolve): Report incompatible packages with precise Rust version
The nesting in `annotate_required_rust_version` might seem weird but its
for a follow up commit.
2024-08-23 16:38:07 -05:00
Ed Page
89cf552c06 test(resolve): Explicitly verify msrv report 2024-08-23 16:37:09 -05:00
Ed Page
388bb07bff refactor(resolve): Allow lookups on changes by id 2024-08-23 14:35:33 -05:00
bors
a0acc29f7b Auto merge of #14305 - linyihai:matches-prerelease-semantic, r=epage
feat: Add matches_prerelease semantic

### What does this PR try to resolve?
One implementaion for https://github.com/rust-lang/cargo/issues/13290

Thanks to `@Eh2406` feedback, a working version came out, and I think it should be able to test under the nightly feature.

This PR proposes a `matches_prerelease semantic`.

| req              | matches             | matches_prerelease     | matches_prerelease_mirror_node [<sub>2<sub>](#mirror-node) |
|------------------|---------------------|------------------------| ----------------------------------|
| `Op::Exact`      |                     |                        |                                   |
| =I.J.K           | =I.J.K              | >=I.J.K, <I.J.(K+1)-0  | >=I.J.K, <I.J.(K+1)-0             |
| =I.J             | >=I.J.0, <I.(J+1).0 | >=I.J.0, <I.(J+1).0-0  | >=I.J.0-0, <I.(J+1).0-0           |
| =I               | >=I.0.0, <(I+1).0.0 | >=I.0.0, <(I+1).0.0-0  | >=I.0.0-0, <(I+1).0.0-0           |
| `Op::Greater`    |                     |                        |                                   |
| >I.J.K           | >I.J.K              | >I.J.K                 | >I.J.K                            |
| >I.J             | >=I.(J+1).0         | >=I.(J+1).0-0          | >=I.(J+1).0-0                     |
| >I               | >=(I+1).0.0         | >=(I+1).0.0-0          | >=(I+1).0.0-0                     |
| `Op::GreaterEq`  |                     |                        |                                   |
| >=I.J.K          | >=I.J.K             | >=I.J.K                | >=I.J.K                           |
| >=I.J            | >=I.J.0             | >=I.J.0                | >=I.J.0-0                         |
| >=I              | >=I.0.0             | >=I.0.0                | >=I.0.0-0                         |
| `Op::Less`       |                     |                        |                                   |
| <I.J.K           | <I.J.K              | <I.J.K or I.J.K-0 depends [<sub>1<sub>](#op-less) | <I.J.K |
| <I.J             | <I.J.0              | <I.J.0-0               | <I.J.0-0                          |
| <I               | <I.0.0              | <I.0.0-0               | <I.0.0-0                          |
| `Op::LessEq`     |                     |                        |                                   |
| <=I.J.K          | <=I.J.K             | <=I.J.K                | <=I.J.K                           |
| <=I.J            | <I.(J+1).0          | <I.(J+1).0-0           | <I.(J+1).0-0                      |
| <=I              | <(I+1).0.0          | <(I+1).0.0-0           | <(I+1).0.0-0                      |
| `Op::Tilde`      |                     |                        |                                   |
| ~I.J.K           | >=I.J.K, <I.(J+1).0 | >=I.J.K, <I.(J+1).0-0  | >=I.J.K, <I.(J+1).0-0             |
| ~I.J             | =I.J                | >=I.J.0, <I.(J+1).0-0  | >=I.J.0, <I.(J+1).0-0             |
| ~I               | =I                  | >=I.0.0, <(I+1).0.0-0  | >=I.0.0, <(I+1).0.0-0             |
| `Op::Caret`      |                     |                        |                                   |
| ^I.J.K (for I>0) | >=I.J.K, <(I+1).0.0 | >=I.J.K, <(I+1).0.0-0  | >=I.J.K, <(I+1).0.0-0             |
| ^0.J.K (for J>0) | >=0.J.K, <0.(J+1).0 | >=0.J.K,  <0.(J+1).0-0 | >=0.J.K-0, <0.(J+1).0-0           |
| ^0.0.K           | =0.0.K              | >=0.0.K,  <0.0.(K+1)-0 | >=0.J.K-0, <0.(J+1).0-0           |
| ^I.J             | ^I.J.0              | >=I.J.0,  <(I+1).0.0-0 | >=I.J.0-0, <(I+1).0.0-0           |
| ^0.0             | =0.0                | >=0.0.0, <0.1.0-0      | >=0.0.0-0, <0.1.0-0               |
| ^I               | =I                  | >=I.0.0, <(I+1).0.0-0  | >=I.0.0-0, <(I+1).0.0-0           |
| `Op::Wildcard`   |                     |                        |                                   |
| `I.J.*`          | =I.J                | >=I.J.0, <I.(J+1).0-0  | >=I.J.0-0, <I.(J+1).0-0           |
| `I.*` or `I.*.*` | =I                  | >=I.0.0, <(I+1).0.0-0  | >=I.0.0-0, <(I+1).0.0-0           |

Notes:

<div id="op-less"></div>

- `<I.J.K`: This is equivalent to `<I.J.K-0` if no lower bound or the lower bound isn't pre-release, otherwise this is equivalent to `<I.J.K`.

<div id="mirror-node"></div>

- [matches_prerelease_mirror_node](3464fd136a) is yet another  implementation of [node semver compatibility](https://github.com/npm/node-semver?tab=readme-ov-file#semver1----the-semantic-versioner-for-npm) (with [includePrerelease=true](https://github.com/npm/node-semver?tab=readme-ov-file#functions)) test. This is extrapolated from the test cases and is not necessarily the same as the node implementation

Besides, the proposed semtantic left a [unsolved issuse ](https://github.com/dtolnay/semver/pull/321#issuecomment-2251058953), I don't have clear idea to handle it.

### How should we test and review this PR?
The tests in `src/cargo/util/semver_eval_ext.rs` are designed to reflect current semantic.

### Additional information
Migrated from https://github.com/dtolnay/semver/pull/321

TBO, this feature was not conceived in advance plus the semantic is unclear at first.  I need to experiment step by step and find out what I think makes sense.  My experiment can be seen this [comment](https://github.com/rust-lang/cargo/issues/13290#issuecomment-2250051428).
2024-08-23 15:59:34 +00:00
Ed Page
d2ec764995 fix(resolve): Dont show locking workspace members
This is for `cargo generate-lockfile` and when syncing the lockfile with
the manifest.
We still show it for `cargo update` because of `cargo update
--workspace`.

We hacked around this previously by filtering out the `num_pkgs==1` case
for single packages but this didn't help with workspaces.
2024-08-22 16:57:06 -05:00
bors
b57cdb53fb Auto merge of #14440 - epage:report, r=Muscraft
refactor(update): Prepare for smarter update messages

### What does this PR try to resolve?

This is to make it easier to
- Make #14401 path aware
- Work on #13908, depending on what is decided
- Improve the heuristics for when we show `Locking` messages

There are fixes along the way that were found by making the code more consistent in prep for consolidating it, mostly for #14401.

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

Along the way, some odd code structures are used for the sake of making the diff easier to follow.  These get cleaned up towards the end

I didn't add tests for the fixes because of the code consolidation that happens that causes us to cover more real-world scenarios with fewer tests.

### Additional information
2024-08-22 21:24:00 +00:00
Lin Yihai
bdf19e0544 feat: add upper bound semantic for Less Op 2024-08-22 10:19:06 +08:00
Lin Yihai
c4d7d7428f doc: Add mod level documents 2024-08-22 10:19:06 +08:00
Lin Yihai
7c4236ee89 feat: Add matches_prerelease semantic 2024-08-22 10:19:06 +08:00
Lin Yihai
e62c271b3f test: add more test for pre-release matches semantic 2024-08-22 10:08:36 +08:00
bors
8f40fc59fb Auto merge of #14441 - kornelski:env-leak, r=epage
Tests rely on absence of RUST_BACKTRACE

I have it set in my default environment, and it causes tests to fail
0.83.0
2024-08-21 22:37:06 +00:00
Kornel
f3c7525a61
Tests rely on absence of RUST_BACKTRACE 2024-08-21 23:12:05 +01:00
bors
7d7b932aad Auto merge of #14432 - weihanglo:target-applies-to-host, r=epage
fix: -Cmetadata includes whether extra rustflags is same as host

### What does this PR try to resolve?

Fixes #14253

The root cause is described in <https://github.com/rust-lang/cargo/issues/14253#issuecomment-2299595480>:

> `-Ztarget-applies-to-host --config target-applies-to-host=false` make it possible to build two units for the same output directory with different rustflags (one with artifact/target rustflags, one with none/host rust flags). Those flags aren't included in the `-Cmetadata` hash which is used to disambiguate different versions of crates, resulting in a conflict. The actual error being produced appears to be the result of two invocations of `rustc` racing and clobbering each other…

While we don't hash RUSTFLAGS because it may contain absolute paths that
hurts reproducibility, we track whether a unit's RUSTFLAGS is from host
config, so that we can generate a different metadata hash for runtime
and compile-time units.

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

This hack is only enabled when `target-applies-to-host=false` and when compile kind is the host platform, so the shouldn't affect any stable behavior.
2024-08-21 22:05:19 +00:00
Weihang Lo
d12c716140
fix: -Cmetadata includes whether extra rustflags is same as host
`-Ztarget-applies-to-host --config target-applies-to-host=false` make it
possible to build two units for the same output directory with different
rustflags (one with artifact/target rustflags, one with none/host rust
flags). Those flags aren't included in the `-Cmetadata` hash which is
used to disambiguate different versions of crates, resulting in a conflict.
The actual error being produced appears to be the result of two invocations
of `rustc` racing and clobbering each other.

While we don't hash RUSTFLAGS because it may contain absolute paths that
hurts reproducibility, we track whether a unit's RUSTFLAGS is from host
config, so that we can generate a different metadata hash for runtime
and compile-time units.
2024-08-22 06:02:33 +08:00
Ed Page
f8a9cdaa7e refactor(update): Consolidate status messages
This builds on the prior work to consolidate everything, simplifying the
code and making it clearer what behavior differences exist between
change kinds.
2024-08-21 15:34:36 -05:00
Weihang Lo
dba34d4552
test: show runtime-dep and build-dep collides
See rust-lang/cargo 14253
2024-08-20 21:28:41 -04:00