Confusing "toolchain does not support components" message when it's not installed
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 22h 40m
- Merged PRs (30d)
- 46
Description
When a toolchain specified in rust-toolchain file is not installed, the output is as follows:
$ cargo clippy
error: process didn't exit successfully: `rustc -vV` (exit code: 1)
--- stderr
error: 'rustc' is not installed for the toolchain '1.40.0-x86_64-unknown-linux-gnu'
To install, run `rustup component add rustc --toolchain 1.40.0-x86_64-unknown-linux-gnu`
Following the suggestion doesn't help:
$ rustup component add rustc --toolchain 1.40.0-x86_64-unknown-linux-gnu
error: toolchain '1.40.0-x86_64-unknown-linux-gnu' does not support components
The correct suggestion would be rustup install 1.40.0, which helps.
$ rustup --version
rustup 1.20.2 (2019-10-16)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the rustc -vV failure path triggered by an uninstalled toolchain, then inspect how rustup constructs the suggested component command. Reproduce with a rust-toolchain file and cargo clippy; done means the output recommends rustup install 1.40.0 instead of rustup component add.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100