-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
A-crate-dependenciesArea: [dependencies] of any kindArea: [dependencies] of any kindA-registriesArea: registriesArea: registriesC-bugCategory: bugCategory: bugS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Description
Problem
When moving crates to registries that were previously depended on via Git, adding a registry
definition to a local dependency causes dependents to attempt to pull the registry, rather than ignoring it and using the local path.
Steps
- crate-a containing:
$ cat Cargo.toml [package] name = "crate-a" version = "0.1.0" edition = "2021" [dependencies] some-crate = { path = "../some-crate", registry = "x", version = "0.1" }
- crate-b containing:
$ cat Cargo.toml [package] name = "crate-b" version = "0.1.0" edition = "2021" [dependencies] crate-a = { git = "https://git.x.com/path/to/crate-a" }
- Attempting to compile
crate-b
attempts to pull thex
registry rather than ignoring it since it is overridden by the relative path.
When combined with #12271, this prevents any sort of slow migration to registries -- requiring a big bang update to all crates which is untenable for any mid to large sized organisation.
Possible Solution(s)
When depending on a crate using { git = "https://git.x.com/path/to/repo" }
, the local dependency should be preferred over the one in the registry.
Notes
No response
Version
No response
robjtede and mattcl
Metadata
Metadata
Assignees
Labels
A-crate-dependenciesArea: [dependencies] of any kindArea: [dependencies] of any kindA-registriesArea: registriesArea: registriesC-bugCategory: bugCategory: bugS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.