-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cargo list does not de-duplicate entries #6088
Comments
Note: This often happens on Windows, where rustup adds the toolchain bin directory to PATH (for DLL loading). This should be a relatively simple fix, to use a BTreeMap instead of a BTreeSet here. |
@rustbot claim |
Maybe you should get my permission instead of just submitting a PR and unassigning me right away. But it's okay you can submit it. But hopefully next time you can claim early and get someone else's permission to do it after they claim. Thanks! 🤝 |
Sorry, the bot seems to have recognized the quote in my reply, please cliam again. Thanks! |
Yes I am sorry. I should have assigned it to myself when I started looking at - instead of as I was completing it. |
@rustbot claim |
Deduplicate entries in cargo --list Fixes #6088
On Arch Linux, among other distros,
/bin
is a symlink to/usr/bin
. This makescargo list
show many components twice: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 withreadlink
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 thatBTreeSet
aBTreeMap
withname
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?The text was updated successfully, but these errors were encountered: