rust-lang / rust-lang/rustup

`rustup override` handles symlinks to directories poorly

Open
#1,138 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug E-mentor help wanted
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
22h 40m
Merged PRs (30d)
46

Description

While in most other contexts, treating symlinks to directories as directories makes sense, I don't think it does in rustup override:

  1. You can't cd into a symlink and then have rustup recognize the override, even though the symlink is in $PATH.

  2. When using rustup override list, symlinks to directories are shown as regular, and are not removed with rustup override unset --nonexistent.

  3. When using rustup override unset --path the_symlink, rustup will instead remove the override at the target of the symlink! If you set an override on a project, then rename the project and symlink the old location to the new directory, it's not possible via rustup to remove the old override - and trying to do so will actually remove the override for the new directory!

I feel like having either 1. or 2. working well would be alright, but 3. should probably be addressed regardless.

Thoughts?

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

Start by reproducing the three reported cases with rustup override list, rustup override unset --nonexistent, and rustup override unset --path the_symlink. Trace the override path handling for symlinks to directories, with priority on preventing unset --path from removing the target directory's override. Done means the reported symlink behavior is corrected and covered by appropriate tests.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.