You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #14569 - epage:msrv-max, r=weihanglo
fix(resolve): Improve multi-MSRV workspaces
### What does this PR try to resolve?
We do this by resolving for a package version that is compatible
with the most number of MSRVs within a workspace.
If a version requirement is just right, every package will get the
highest MSRV-compatible dependency.
If its too high, packages will get MSRV-incompatible dependency
versions.
This will happen regardless of what we do due to the nature of
`"fallback"`.
If its too low, packages with higher MSRVs will get older-than-necessary
dependency versions.
This is similar to the "some with and without MSRV" workspaces.
When locking dependencies, we do report to users when newer MSRV/SemVer
compatible dependencies are available to help guide them to upgrading if
desired.
Fixes#14414
### How should we test and review this PR?
Is this the right behavior?
- This feature is unstable and letting people try it is one way to determine that
- A concern was raised within the Cargo team about new users with workspace member MSRVs all set to latest having someone ask them to lower an MSRV and them dealing with staler-than-required dependencies
- At this point, there seems to be agreement on #14414 being a problem, the resolver magically fixing this is unlikely to happen for the foreseeable future, and this does fix it with the potential for user confusion. From my understanding of those conversations, they are mostly in the area of UX, like with #14543. Rather than blocking on that discussion, this moves forward with the implementation.
### Additional information
Copy file name to clipboardExpand all lines: src/doc/src/reference/unstable.md
+3-1
Original file line number
Diff line number
Diff line change
@@ -348,7 +348,9 @@ This was stabilized in 1.79 in [#13608](https://github.com/rust-lang/cargo/pull/
348
348
-`package.edition = "2024"` (only in workspace root)
349
349
350
350
The resolver will prefer dependencies with a `package.rust-version` that is the same or older than your project's MSRV.
351
-
Your project's MSRV is determined by taking the lowest `package.rust-version` set among your workspace members.
351
+
As the resolver is unable to determine which workspace members will eventually
352
+
depend on a package when it is being selected, we prioritize versions based on
353
+
how many workspace member MSRVs they are compatible with.
352
354
If there is no MSRV set then your toolchain version will be used, allowing it to pick up the toolchain version from pinned in rustup (e.g. `rust-toolchain.toml`).
0 commit comments