rust-lang / rust-lang/rustup

cargo list should not show components that are not installed

Open
#1,514 3 comments 1 reaction 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 component add clippy-preview --toolchain nightly
$ cargo +stable list | grep clippy
clippy

This happens because rustup places cargo-clippy (as a symlink to rustup) in ~/.cargo/bin, or elsewhere in the user's $PATH. Which in turn is what clippy uses to determine what extensions are installed for listing with cargo list. I'm not entirely sure how to fix this, since it's pretty reasonable for cargo to search the user's $PATH. Perhaps cargo needs to have some way of detecting that it's running under rustup, and to know to really discover whether a given component is installed or not?

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

Reproduce the example using rustup component add clippy-preview --toolchain nightly and cargo +stable list, then inspect how cargo-clippy in ~/.cargo/bin or the user's PATH is discovered. Done means cargo list no longer reports components that are not installed for the selected toolchain, while still listing installed components.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.