Discrepancy in dependency specification with multiple locations #13279
Labels
A-crate-dependencies
Area: [dependencies] of any kind
C-bug
Category: bug
S-triage
Status: This issue is waiting on initial triage.
Problem
In the Cargo manifest, you can specify a dependency as a path/git and a version (See Multiple locations). Naturally, when specifying path+version you can add the registry used to pull the dep when publishing. But when using git+version you can't specify a registry; cargo reports the following:
dependency [..] specification is ambiguous. Only one of `git` or `registry` is allowed.
The aforementioned docs state:
Maybe this is a wording issue in docs, but I read "when published to a registry like crates.io" as "you can specify a registry here". After all, why does it make sense for path dependencies but not git dependencies? Unless it's referring to Source replacement, in which case the phrasing is arguable misleading.
Steps
dep = { version = "...", git = "...", registry = "..." }
cargo check
Possible Solution(s)
Allow specifying an alternative registry when using git+version locations.
Notes
No response
Version
The text was updated successfully, but these errors were encountered: