Skip to content

fix: stop remove $CARGO_HOME on uninstallation#4861

Draft
Cloud0310 wants to merge 2 commits into
rust-lang:mainfrom
Cloud0310:main
Draft

fix: stop remove $CARGO_HOME on uninstallation#4861
Cloud0310 wants to merge 2 commits into
rust-lang:mainfrom
Cloud0310:main

Conversation

@Cloud0310
Copy link
Copy Markdown
Contributor

fix #285
This PR fix the cargo bin nuke and the path removing possilble toutoc issue.
Here's the implementation details:

  • compare cargo bin dir content to rustup binary, if it's a link, remove it
  • then, we remove the rustup binary, on success, we then remove the cargo bin from path

This prevents rustup self uninstall from nuking out the $CARGO_HOME/bin and possible toctou problem of removing up the path.

fix rust-lang#285
This contains:
- initial logic for detecting $CARGO_HOME/bin is empty
- refactor`delete_rustup_and_cargo_home` to `delete_rustup_bin`.
  TODOs:
- add further test
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.

Stop nuking $CARGO_HOME (~/.cargo) on rustup self uninstall

1 participant