-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
C-bugCategory: bugCategory: bug
Description
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
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)
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
zeenix
Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bug