Open d-e-s-o opened 3 years ago
Uhm. Figured out a solution. Using https://github.com/rust-lang/crates.io-index
instead of https://github.com/rust-lang/crates.io-index.git
does the trick. I think this UX really could be improved.
Updated the title to reflect the issue. While I mention crates.io-index.git
the problem likely applies to all registries. Not sure if there is a way to "canonicalize" a URL. Feel free to close otherwise.
Please have a look at this workspace containing a binary
mybin
, a librarymylib
, and a local registry.mybin
depends onmylib
.Here is the kicker:
mybin
also depends on acrates.io
published crate (uid
) and so doesmylib
. In order to make this work I need to set"registry":"https://github.com/rust-lang/crates.io-index.git"
for theuid
dependency in the index entry formylib
.When I build I get:
That's the typical version mismatch error and we can see where it comes from:
uid
is taken from bothcrates.io
andhttps://github.com/rust-lang/crates.io-index.git
.So why did I specify
https://github.com/rust-lang/crates.io-index.git
as the registry to begin with? Becausecrates.io
(orcrates-io
) does not work:For some reason now
mylib
(???) would not be found.So my question is why is
crates.io
seemingly not recognized properly for the registry key for dependencies? https://doc.rust-lang.org/cargo/reference/registries.html#index-formatI think we probably should special case it there or, alternatively, dedup
https://github.com/rust-lang/crates.io-index.git
tocrates.io
(the standard registry).Notes
Output of
cargo version
: