-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
A-dev-dependenciesArea: [dev-dependencies]Area: [dev-dependencies]C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-publish
Description
Cargo currently refuses any Cargo.toml
that includes a path-specific dependency. This is overly zealous, as crates.io could allow dev-dependencies
to be path-specific: These never get touched while cargo builds something from crates.io.
A use case for a path-specific dev-dependency
is a test-crate for integration tests, breaking a dependency cycle where the main crate dev-depends on a test-crate (as a path-specific dev-dependency
) and the test-crate depends on the main-crate (as a normal dependency
). Cargo actually does that right thing on cargo test
and
- compiles the main crate first (satisfying the test-crate's
dependency
) - the test-crate second (satisfying the
dev-dependency
) and - executing the tests
On a normal cargo build
, the path-specific dev-dependency
will be ignored.
Metadata
Metadata
Assignees
Labels
A-dev-dependenciesArea: [dev-dependencies]Area: [dev-dependencies]C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-publish