Skip to content

cargo list does not de-duplicate entries #6088

@jonhoo

Description

@jonhoo

On Arch Linux, among other distros, /bin is a symlink to /usr/bin. This makes cargo list show many components twice:

$ which -a cargo-clippy
/usr/bin/cargo-clippy
/bin/cargo-clippy
$ cargo list | grep clippy
    clippy
    clippy

It's a little unclear how to fix this though, since cargo would have to know that those two binaries are indeed the same. Resolving symlinks with readlink before de-duplicating here might be the way to go? Alternatively, maybe the list should be de-duplicated based only on the command name, and not on the full path as well. That is, make that BTreeSet a BTreeMap with name as the key. We'd still then have to resolve conflicts, but have to do that today anyway!

As an aside to this, it'd be great if cargo list showed the path of the command it'll use to execute a given component by default. This happens if --verbose is passed currently, but I'm not sure I see the reason to hide it in non-verbose output, given that the command descriptions for built-ins are always shown?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions