rust-lang / rust-lang/rustup

Autodetection of pre-existing Rust install should report full path it observed

Open
#1,200 0 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
22h 40m
Merged PRs (30d)
46

Description

Rustup currently refuses to install Rust if it detects a pre-existing Rust install.

However, it does not tell the user which file it found the pre-existing install; it only reports the directory where it found it. E.g.:

error: it looks like you have an existing installation of Rust at:
error: /home/pnkfelix/bin
error: rustup cannot be installed alongside Rust. Please uninstall first
error: if this is what you want, restart the installation with `-y'
error: cannot install while Rust is installed

In my own case, I was able to use strace on Linux to observe the paths it was querying, and from that, make appropriate changes to my file system. (I was using symlinks in ~/bin/, and there was still a ~/bin/cargo symlink.)

However, I would not expect an average user to resort to strace to resolve this kind of problem.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name a source file or test; begin at rustup's pre-existing-install detection and reproduce the installer error. Use the reported installation paths, including symlinks, to trace what is detected. Done means the error identifies the full file path that caused the existing-install check to fail.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.