Cyclic dev-dependencies can cause confusing errors #6765
Labels
A-build-execution
Area: anything dealing with executing the compiler
A-dev-dependencies
Area: [dev-dependencies]
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Command-test
S-needs-team-input
Status: Needs input from team on whether/how to proceed.
Describe the problem you are trying to solve
Cargo detects cyclic dependencies, but allows crates to depends on each other in [dev-dependencies]. This can lead to a confusing error message
Here is a minimal repro: https://github.com/mikhailOK/bad-cargo-cyclic-dependency
Two crates, crate1 and crate2
crate2 depends on crate1, but crate1 has crate2 in [dev-dependencies]
crate1/src/lib.rs:
crate2/src/lib.rs:
cargo test -p crate1 fails with a compilation error:
Describe the solution you'd like
My question is, is there a valid use case for this kind of cyclic dependencies?
If there isn't, can this case be a cargo error?
Notes
The text was updated successfully, but these errors were encountered: