`rustup self uninstall --no-modify-path` is leaving dangling source line in rc files

Ouverte
#5,221 6 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@jrdevadattan y travaille déjà.

Depuis le 26/11/2026.

  • #5268 par @jrdevadattan — ouverte

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
58/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
rust
Domaine
cli

Piste de recherche

Start by tracing the Unix uninstall path for rustup self uninstall --no-modify-path and how it handles the CARGO_HOME/env script and shell rc entries. Reproduce the reported warning after uninstalling with that option, then check whether keeping the env script resolves it without changing default uninstall behavior. Done means the rc file no longer sources a missing script.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug
Verification
Problem

Due to our current uninstallation policy, by default, we're adding a line in user's rc file for sourcing a env script implement the auto PATH adding upon normal installation with modify path.

However, the current uninstallatio by default removes all of the files in CARGO_HOME and RUSTUP_HOME, causing uninstallation with rustup self uninstall --no-modify-path leaving behind a source cmd for sourcing nothing.

Steps
  1. Install rustup with modify path on any Unix os.
  2. Uninstall rustup with rustup self uninstall --no-modify-path.

If you're using bash/zsh/ash, this would immediately causing a warn like this:
source:xxx: no such file or directory: cargo_home/env

Possible Solution(s)

Keep the env script upon rustup self uninstall --no-modify-path.

Notes

No response

Rustup version
rustup 1.29.3 (2026-11-11)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: the currently active `rustc` version is `rustc 1.100.0 (0ef1bc386 2026-11-09)`
Installed toolchains
Not related.
OS version
Any Unix OS.
Langage dominant
Rust
Étoiles
7.1k
Forks
1.1k
Merge moyen
16 h 36 min
PR mergées (30 j)
54

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de rust-lang/rustup

Toutes les issues de rust-lang/rustup

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.