Skip to content
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

Allow path-specific dependencies in [dev-dependencies] #3745

Closed
lukaslueg opened this issue Feb 21, 2017 · 4 comments
Closed

Allow path-specific dependencies in [dev-dependencies] #3745

lukaslueg opened this issue Feb 21, 2017 · 4 comments
Labels
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-publish

Comments

@lukaslueg
Copy link
Contributor

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

  1. compiles the main crate first (satisfying the test-crate's dependency)
  2. the test-crate second (satisfying the dev-dependency) and
  3. executing the tests

On a normal cargo build, the path-specific dev-dependency will be ignored.

CC @alexcrichton

@alexcrichton
Copy link
Member

Yeah in general I think crates.io knows too much about dev-dependencies. I think we should be able to get by without verifying that dev-dependencies come from the same source or are present on crates.io itself.

@carols10cents carols10cents added 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-publish labels Oct 2, 2017
@lukaslueg
Copy link
Contributor Author

How to move forward here? Is it sufficient to just remove the locality check for `dev-dependency´?

@alexcrichton
Copy link
Member

Unfortunately I have not thought through what this would entail. I don't know what it would take to solve it or whether a naive solution would break other code.

@ehuss
Copy link
Contributor

ehuss commented Oct 30, 2019

I think this is now addressed by #7333. If that is incorrect, feel free to reopen.

@ehuss ehuss closed this as completed Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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-publish
Projects
None yet
Development

No branches or pull requests

4 participants