rust-lang / rust-lang/rustup

Trying to use a component that is not installed runs for about a second before reporting an error

Open
#4,355 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Verification
Problem

I run into this all the time because my editor runs rustfmt --version on save to initialize the rust.vim extension's rustfmt support. If I am in a project that has set a toolchain override that doesn't have rustfmt, this makes vim hang for a second when I try to write-quit.

Steps
$ rustup component remove rustfmt
$ time rustfmt
Possible Solution(s)

No response

Notes

No response

Rustup version
rustup 1.28.2 (e4f3ad6f8 2025-04-28)
Installed toolchains
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/ben/.rustup

installed toolchains
--------------------
stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (active, default)
nightly-2025-05-22-x86_64-unknown-linux-gnu
nightly-2025-05-23-x86_64-unknown-linux-gnu
0c33fe2c3d3eecadd17a84b110bb067288a64f1c
2d5ffc513f1c56b7bc95bacb2519705096e8cc2b
45b94dd98018f2609b43a8d8e08ec5432b9e0647
55dc6112586ae887a7811648b0a8a05e1ac90162
6e23095adf9209614a45f7f75fea36dad7b92afb
8c46fcbb191b4a054f15dac8d411078faa679379
master-stage1
miri
stage1
stage2

active toolchain
----------------
name: nightly-x86_64-unknown-linux-gnu
active because: it's the default toolchain
installed targets:
  x86_64-unknown-linux-gnu
OS version
Linux archlinux 6.14.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 29 May 2025 21:42:15 +0000 x86_64 GNU/Linux

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 reported rustup component remove rustfmt and time rustfmt commands with the listed toolchain setup, then trace the missing-component lookup and its error path. Done means invoking an uninstalled component reports the error without the roughly one-second delay; the issue names no source file or test to begin from.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.