Conversation
Cloud0310
force-pushed
the
uninstall-refactor
branch
from
September 24, 2026 18:19
e787528 to
6afe8ea
Compare
Contributor
Author
|
@ChrisDenton I am thinking your previous suggestion upon using |
Collaborator
|
☔ The latest upstream changes (possibly #5106) made this pull request unmergeable. Please resolve the merge conflicts. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
This PR fixes the PID reuse race described here:
rustup/src/cli/self_update/windows.rs
Lines 441 to 444 in 4d24845
Method
spawn_with_parent_handleto launch a subprocess with an inherited handle to its parent process.RUSTUP_PARENT_HANDLEenvironment variable so the subprocess can wait for its parent to exit.Compatibility
Older rustup versions do not pass a parent process handle value when launching the self-updater.
So the original
wait_for_parentimplementation is renamed aswait_for_parent_legacyand used whenRUSTUP_PARENT_HANDLEis absent.Tests
Add
self_replace_waits_for_legacy_parentto simulate an older launcher starting the new updater without passing a parent handle, covering compatibility with older rustup versions that use the old parent PID protocol.