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

Offen
#5,221 6 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@jrdevadattan arbeitet bereits daran.

Seit 26.11.2026.

  • #5268 von @jrdevadattan — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
58/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
rust
Bereich
cli

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.
Vorherrschende Sprache
Rust
Sterne
7.1k
Forks
1.1k
Ø Merge
16 Std. 36 Min.
Gemergte PRs (30 T.)
54

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus rust-lang/rustup

Alle Issues in rust-lang/rustup

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.