-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(resolve): Direct people to working around less optimal MSRV-resolver results #14543
base: master
Are you sure you want to change the base?
Conversation
tests/testsuite/workspaces.rs
Outdated
[ADDING] dep1 v0.1.3 (available: v0.1.8) | ||
[NOTE] 1 package may have a higher, compatible versions. To update it, run `cargo update <name> --precise <version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an example of where it might show up for a non-MSRV case (and the suggested action will fail)
@joshtriplett this is a first pass at supporting a summary message and what wording we might use. |
☔ The latest upstream changes (presumably #14568) made this pull request unmergeable. Please resolve the merge conflicts. |
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
…lver results In discussing rust-lang#14414, the general problem of the resolver picking a version older than a package needs for its MSRV (or lack of one) because of the MSRV of other packages came up. This tries to patch over that problem by telling users that a dependency might be able to be newer than the resolver selected. The message is fairly generic and might be misread to be about any MSRV update which an MSRV `fallback` strategy allows, which would make the count off. The reason it is so generic is we don't know with precision why it was held back - Direct dependents may have a non-semver upper bound on the version as we aren't trying to unify the version requirements across direct dependents at this time - A dependency could have removed a feature without making a breaking change - This seems like it should instead be an error but thats a conversation for another day - ~~The user enabled `-Zminimal-versions`~~ - This is now detected and the message skipped Note: separate from this, we may also print the status suffix for this case if the package was not selected for update (e.g. passing `--workspace`).
[LOCKING] 9 packages to latest Rust 1.60.0 compatible versions | ||
[ADDING] dep-only-high-incompatible v1.75.0 (requires Rust 1.75.0) | ||
[ADDING] dep-only-low-incompatible v1.75.0 (requires Rust 1.75.0) | ||
[ADDING] dep-only-high-compatible v1.55.0 (available: v1.65.0) | ||
[ADDING] dep-only-high-incompatible v1.55.0 (available: v1.75.0, requires Rust 1.75.0) | ||
[ADDING] dep-only-low-incompatible v1.55.0 (available: v1.75.0, requires Rust 1.75.0) | ||
[ADDING] dep-only-unset-compatible v1.55.0 (available: v1.75.0) | ||
[ADDING] dep-only-unset-incompatible v1.2345.0 (requires Rust 1.2345.0) | ||
[ADDING] dep-shared-incompatible v1.75.0 (requires Rust 1.75.0) | ||
[NOTE] 2 packages may have a higher, compatible version. To update them, run `cargo update <name> --precise <version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, this message is vague to the point of being unhelpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case where we're already showing verbose messages about all the individual crates, I agree. Could we show it only if there are messages about possible upgrades that we're currently hiding because of the verbosity level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats sounding like the message we already have
"pass `--verbose` to see {unchanged_behind} unchanged dependencies behind latest"
What does this PR try to resolve?
In discussing #14414, the general problem of the resolver picking a
version older than a package needs for its MSRV (or lack of one) because of the MSRV of
other packages came up.
This tries to patch over that problem by telling users that a dependency
might be able to be newer than the resolver selected.
The message is fairly generic and might be misread to be about any MSRV
update which an MSRV
fallback
strategy allows, which would make thecount off.
The reason it is so generic is we don't know with precision why it was
held back
we aren't trying to unify the version requirements across direct
dependents at this time
change
conversation for another day
The user enabled-Zminimal-versions
Note: separate from this, we may also print the status suffix for this
case if the package was not selected for update (e.g. passing
--workspace
).How should we test and review this PR?
Additional information