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

Aperta
#5,221 6 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@jrdevadattan ci sta già lavorando.

Dal 26/11/2026.

  • #5268 di @jrdevadattan — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
cli

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Rust
Stelle
7.1k
Fork
1.1k
Merge medio
16h 36m
PR unite (30g)
54

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-lang/rustup

Tutte le issue di rust-lang/rustup

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.