Skip to content

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

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

fix(dist): fix unexpected downgrades without --allow-downgrade#5023
rami3l wants to merge 8 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 4 times, most recently from 45026fa to 2f746ae Compare August 19, 2026 16:11
@rami3l
rami3l force-pushed the fix/upgrade-false-positive branch 3 times, most recently from e1c820f to c6c7e48 Compare August 19, 2026 17:07
@rami3l
rami3l force-pushed the fix/upgrade-false-positive branch 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
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

1 participant