-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed as not planned
Labels
A-gitArea: anything dealing with gitArea: anything dealing with gitC-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`S-needs-rfcStatus: Needs an RFC to make progress.Status: Needs an RFC to make progress.
Description
If 2 crates import a dependency from git and it's even a bit different cargo treats them as 2 unrelated crates.
let's say crate A has this toml:
[package]
name = "a"
version = "0.0.1"
[dependencies]
serde = { git = "https://github.com/serde-rs/serde.git", features = ["serde_derive"] }and contains this struct: #[derive(Serialize)] struct Arr([u8; 32])
crate B has this toml:
[package]
name = "b"
version = "0.0.1"
[dependencies]
a = { path = "../a" }
serde = { git = "https://github.com/serde-rs/serde.git", rev = "fd9d334", features = ["serde_derive"] }and contains this:
use a::Arr;
#[derive(Serialize)]
struct BetterArr(Arr)This will complain that Arr doesn't implement Serialize.
even though technically they point to the exact same thing.
and even if they're not pointing to the same thing I would've hoped there would be a way for me to do something similar to crate = "=1.0.1" and lock to an exact revision/tag/branch.
Thanks!
subnomo, XiangpengHao, jameshiew, WhyNotHugo and kuviman
Metadata
Metadata
Assignees
Labels
A-gitArea: anything dealing with gitArea: anything dealing with gitC-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`S-needs-rfcStatus: Needs an RFC to make progress.Status: Needs an RFC to make progress.