Skip to content

fix(dist): fix unexpected downgrades without --allow-downgrade - #5023

Open
rami3l wants to merge 9 commits into
rust-lang:mainfrom
rami3l:fix/upgrade-false-positive
Open

fix(dist): fix unexpected downgrades without --allow-downgrade#5023
rami3l wants to merge 9 commits into
rust-lang:mainfrom
rami3l:fix/upgrade-false-positive

Conversation

@rami3l

@rami3l rami3l commented Aug 19, 2026

Copy link
Copy Markdown
Member

Closes #5003.

Normally, when a toolchain is updated, the manifest date of the toolchain to be installed is compared to the current manifest date, so that --allow-downgrade can reject or allow potential downgrades accordingly.

However, there is a bug in the existing logic in that the comparison is performed only after the target toolchain is installed, which has effectively blocked all effects of --allow-downgrade until the backtracking1 has started, which is unfortunately never the case except for certain nightly builds. This seems to be the root cause of #5003.

This PR fixes this issue by comparing the manifest dates before the target toolchain is installed.

Footnotes

  1. Rustup backtracks to older manifests to meet all component requirements. This is necessary because certain nightlies are allowed to not have the complete set of components.

@rami3l
rami3l force-pushed the fix/upgrade-false-positive branch 2 times, most recently from 7518b22 to d32943e Compare August 19, 2026 10:14
Comment thread src/dist/mod.rs Outdated
@rami3l
rami3l force-pushed the fix/upgrade-false-positive branch 8 times, most recently from e98f0b6 to 7bd3251 Compare August 19, 2026 17:16
@rami3l
rami3l marked this pull request as ready for review August 19, 2026 17:23
Comment thread src/dist/manifestation/tests.rs
@rami3l
rami3l force-pushed the fix/upgrade-false-positive branch from eb59f3f to 0b5207e Compare August 25, 2026 22:01
@rustbot

rustbot commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rami3l
rami3l force-pushed the fix/upgrade-false-positive branch from 0b5207e to 8d875d4 Compare August 26, 2026 10:03
@rami3l
rami3l force-pushed the fix/upgrade-false-positive branch from 8d875d4 to 6fddede Compare August 26, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rustup update should not downgrade toolchains

2 participants