-
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
Don't downgrade on prerelease VersionReq
when update with --breaking.
#14250
Conversation
r? @weihanglo rustbot has assigned @weihanglo. Use |
e3aab3a
to
066d0fb
Compare
066d0fb
to
3973d78
Compare
This comment was marked as outdated.
This comment was marked as outdated.
3973d78
to
7bbb671
Compare
This comment was marked as outdated.
This comment was marked as outdated.
CC @torhovland I feel like one of your PRs had touched on this already but we wanted to split it out for focusing the reviews, or am I thinking of something else? |
I think these are separate issues. This one here is about The one I have encountered is about a precise version req not matching its exact version if it is a pre-release. See de1a4a2 |
99951d6
to
0bd64aa
Compare
VersionReq
when update with --breaking.
I copied the |
0bd64aa
to
1891c40
Compare
tests/testsuite/update.rs
Outdated
@@ -2616,3 +2616,39 @@ fn update_breaking_mixed_pinning_renaming() { | |||
"#]], | |||
); | |||
} | |||
|
|||
#[cargo_test] | |||
fn update_breaking_pre_release() { |
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.
From https://github.com/rust-lang/cargo/pull/14250/files#r1680348122:
The
update --breaking
had filtered theprerelease
version to update to. So here equals to no upgrade to prerelease also. :/
Since that is the case, we might want to have UI tests for
2.0.0-beta.22
is available, but2.0.0-beta.21
won't upgrade to it.2.0.0
is available, but2.0.0-beta.21
won't upgrade to it.3.0.0
is available, and2.0.0-beta.21
will upgrade to it.
We should document the first two as an unresolved issue. That is something we want to support, especially the second one.
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.
Added update_breaking_pre_release_upgrade
to reflect the current behavior.
2.0.0 is available, but 2.0.0-beta.21 won't upgrade to it.
This case out of my expection, it seems need to support.
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.
Task added: #12425 (comment).
1891c40
to
bc38ae0
Compare
bc38ae0
to
9e2701a
Compare
While there are still some edge cases having to be supported, we shouldn't block this from fixing wrong downgrades. Thank you for the contribution! @bors r+ |
☀️ Test successful - checks-actions |
Update cargo 14 commits in 5f6b9a92201d78af75dc24f14662c3e2dacbbbe1..b5d44db1daf0469b227a6211b987162a39a54730 2024-07-19 18:09:17 +0000 to 2024-07-26 21:27:12 +0000 - Package workspaces (rust-lang/cargo#13947) - test: migrate messages to snapbox (rust-lang/cargo#14242) - chore: Update dependencies (rust-lang/cargo#14299) - fix: remove rustc probe for `--check-cfg` support (rust-lang/cargo#14302) - Misc test clean up (rust-lang/cargo#14297) - Don't downgrade on prerelease `VersionReq` when update with --breaking. (rust-lang/cargo#14250) - test: Migrate some json tests to snapbox (rust-lang/cargo#14293) - Revert "fix: Ensure dep/feature activates the dependency on 2024" (rust-lang/cargo#14295) - chore: bump cargo-test-support to 0.4.0 (rust-lang/cargo#14286) - Bump to 0.83.0; update changelog (rust-lang/cargo#14285) - Improved error message when `update --breaking` invalid spec. (rust-lang/cargo#14279) - docs(test): Expand documentation of cargo-test-support (rust-lang/cargo#14272) - test: Fix some test based on rustc version (rust-lang/cargo#14282) - Use `Rc` instead of `Arc` for storing rustflags (rust-lang/cargo#14273) r? ghost
Update cargo 14 commits in 5f6b9a92201d78af75dc24f14662c3e2dacbbbe1..b5d44db1daf0469b227a6211b987162a39a54730 2024-07-19 18:09:17 +0000 to 2024-07-26 21:27:12 +0000 - Package workspaces (rust-lang/cargo#13947) - test: migrate messages to snapbox (rust-lang/cargo#14242) - chore: Update dependencies (rust-lang/cargo#14299) - fix: remove rustc probe for `--check-cfg` support (rust-lang/cargo#14302) - Misc test clean up (rust-lang/cargo#14297) - Don't downgrade on prerelease `VersionReq` when update with --breaking. (rust-lang/cargo#14250) - test: Migrate some json tests to snapbox (rust-lang/cargo#14293) - Revert "fix: Ensure dep/feature activates the dependency on 2024" (rust-lang/cargo#14295) - chore: bump cargo-test-support to 0.4.0 (rust-lang/cargo#14286) - Bump to 0.83.0; update changelog (rust-lang/cargo#14285) - Improved error message when `update --breaking` invalid spec. (rust-lang/cargo#14279) - docs(test): Expand documentation of cargo-test-support (rust-lang/cargo#14272) - test: Fix some test based on rustc version (rust-lang/cargo#14282) - Use `Rc` instead of `Arc` for storing rustflags (rust-lang/cargo#14273) r? ghost
Update cargo 14 commits in 5f6b9a92201d78af75dc24f14662c3e2dacbbbe1..b5d44db1daf0469b227a6211b987162a39a54730 2024-07-19 18:09:17 +0000 to 2024-07-26 21:27:12 +0000 - Package workspaces (rust-lang/cargo#13947) - test: migrate messages to snapbox (rust-lang/cargo#14242) - chore: Update dependencies (rust-lang/cargo#14299) - fix: remove rustc probe for `--check-cfg` support (rust-lang/cargo#14302) - Misc test clean up (rust-lang/cargo#14297) - Don't downgrade on prerelease `VersionReq` when update with --breaking. (rust-lang/cargo#14250) - test: Migrate some json tests to snapbox (rust-lang/cargo#14293) - Revert "fix: Ensure dep/feature activates the dependency on 2024" (rust-lang/cargo#14295) - chore: bump cargo-test-support to 0.4.0 (rust-lang/cargo#14286) - Bump to 0.83.0; update changelog (rust-lang/cargo#14285) - Improved error message when `update --breaking` invalid spec. (rust-lang/cargo#14279) - docs(test): Expand documentation of cargo-test-support (rust-lang/cargo#14272) - test: Fix some test based on rustc version (rust-lang/cargo#14282) - Use `Rc` instead of `Arc` for storing rustflags (rust-lang/cargo#14273) r? ghost
What does this PR try to resolve?
Do nothing with prerelease when update with
--breaking
.Fixes #14178
How should we test and review this PR?
Previous commit add a test, next commit to fix and update.
Additional information