Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Exit with an error when duplicates are found #87

Open
sanxiyn opened this issue Jan 3, 2020 · 1 comment
Open

Exit with an error when duplicates are found #87

sanxiyn opened this issue Jan 3, 2020 · 1 comment

Comments

@sanxiyn
Copy link

sanxiyn commented Jan 3, 2020

I want to use cargo tree -d in a CI. It would be nice if cargo-tree exit with success (exit code 0) when there are no duplicates and exit with failure (exit code 1) when duplicates are found.

@joshtriplett
Copy link

We discussed this a bit in the cargo team meeting today. We'd love to have an option for a "gentler" version of this, which doesn't fail unless you can actually fix the problem without having to fix your dependencies. The algorithm would be "pretend that all of your direct declared dependencies (and also dependencies from crates in your workspace or that use path dependencies) that use ~ (semver compatible) used >= instead, resolve dependencies accordingly, and if that would eliminate a duplicate, report it as a failure".

That way, you don't get a CI failure for something that you can't actually fix yourself by just fixing your Cargo.toml.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants