-
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
Add a way to check for duplicate dependencies #7285
Comments
@RalfJung has used Cargo.lock for doing this but the upcoming format doesn't lend itself as nicely to detection of dupes and it was suggested by to use tooling for this instead: #7070 (comment) It would also be very helpful if you could specify a whitelist of crates that are allowed to be duplicate. Sometimes it requires major effort to deduplicate a dependency. I think servo might only switch to the builtin tool if you can specify a whitelist. cc @Eijebong |
Yeah, it's really really hard to go for 0 dupes. (try to have only one version of rand_core if you've got anything depending on rand or one version of winapi if you've got anything depending on mio...). A whitelist is needed but at least makes people aware of the fact they're duping something. It's useless without a committed lockfile though and that's something to keep in mind. |
@gnzlbg: You can use |
We created |
I'd love for us to look into moving some of |
There should be a simple way to check that there aren't any duplicate dependencies in the dependency graph, e.g., a
cargo build --unique-deps
/cargo run --unique-deps
that errors if two versions of a dependency are anywhere in the dependency graph.This would be useful for usage in CI.
What I currently do, is manually use
cargo tree
to pretty print the whole dependency tree, and manually inspect the dependencies. There should be a better way.The text was updated successfully, but these errors were encountered: