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

"path" dev-dependencies withou "version" are silently dropped #8268

Closed
ignatenkobrain opened this issue May 22, 2020 · 2 comments
Closed

"path" dev-dependencies withou "version" are silently dropped #8268

ignatenkobrain opened this issue May 22, 2020 · 2 comments
Labels
C-bug Category: bug

Comments

@ignatenkobrain
Copy link
Contributor

Problem
The zvariant crate, when downloaded from crates.io fails on cargo test because of unresolved imports to zvariant_derive. Turns out that cargo automatically strips dev-dependencies that have path, but do not have version. I believe that when there are both, cargo keeps the dependency, but strips path. I did not test it with dependency (non-dev one) since I don't know some easy way to reproduce it but I believe that cargo used to reject those at some point.

Steps

  1. curl -sL https://crates.io/api/v1/crates/zvariant/2.0.0/download#/zvariant-2.0.0.crate | tar -xzO 'zvariant-2.0.0/Cargo.toml' | grep zvariant_derive
(no output)
  1. curl -sL https://crates.io/api/v1/crates/zvariant/2.0.0/download#/zvariant-2.0.0.crate | tar -xzO 'zvariant-2.0.0/Cargo.toml.orig' | grep zvariant_derive
zvariant_derive = { path = "../zvariant_derive" }

Possible Solution(s)
I think such crates should be prohibited from publishing and giving a hint that specifying version should fix the problem.

Notes

Output of cargo version:

cargo 1.43.0 (3532cf738 2020-03-17)

installed via rustup.

cc @zeenix

@ignatenkobrain ignatenkobrain added the C-bug Category: bug label May 22, 2020
@ehuss
Copy link
Contributor

ehuss commented May 22, 2020

This is intentional (see #7333). The package will need to specify the version for it to work. This will also be addressed by rust-lang/rfcs#2906 which will automatically inject the version.

@ehuss ehuss closed this as completed May 22, 2020
@ignatenkobrain
Copy link
Contributor Author

@ehuss 😞 since that is making distributions maintainer’s life more complicated :/ Hope that linked RFC will be solved soon.

emmanueltouzery pushed a commit to emmanueltouzery/zbus that referenced this issue Nov 6, 2020
It should not have been really allowed to release on crates.io without
this.

References: rust-lang/cargo#8268
Signed-off-by: Igor Raits <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants