Conversation
Member
|
@Cloud0310 When stacking a PR on top of another, you should keep the top PRs as draft and wait for the prerequisites to be merged first. |
rami3l
marked this pull request as draft
September 16, 2026 18:28
Use OpenOptions and inherited stdin to manage the GC handle with standard file APIs. Keep Command alive through the existing sleep to retain the handle.
Inline the single-use ensure_empty helper and replace GcErr with an inline error. Preserve the existing directory and GC filename filter.
Attempt the existing GC self-cleanup even if waiting for the parent or removing cargo-home state fails. Preserve the original uninstall error when starting cleanup also fails; report the cleanup error when uninstalling succeeded.
Use tempfile to manage the GC path until the delete-on-close handle takes over cleanup.
Copy the executable contents into a regular temporary file so delete-on-close removes the GC copy instead of a symlink target. Close the write handle before opening the executable for reading.
Copy the running executable so GC does not depend on the installed rustup copy.
Create GC in the system temporary directory to avoid requiring write access to the parent of CARGO_HOME. Update the cleanup test to use an isolated temporary directory.
Cloud0310
force-pushed
the
windows-uninstall-gc
branch
from
September 16, 2026 19:34
60951a9 to
7194785
Compare
Collaborator
|
☔ The latest upstream changes (possibly #5091) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
Proceeding of #5088
This PR does:
CARGO_HOME.tempfileto manage the GC file and copy the running executable’s contents into it. This creates an independent executable instead of reproducing a source symlink and avoids relying on the installed rustup copy.fs::copyandutils::current_exefor copying gc program, allowing for potential copying dead symlink and being less dependent upon fixed binary path (~/.cargo/bin/rustup.exe).