-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Alternative registries should be allowed to be local sources #17070
Copy link
Copy link
Open
Labels
A-directory-sourceArea: directory sources (vendoring)Area: directory sources (vendoring)A-local-registry-sourceArea: local registry sources (vendoring)Area: local registry sources (vendoring)C-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-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Metadata
Metadata
Assignees
Labels
A-directory-sourceArea: directory sources (vendoring)Area: directory sources (vendoring)A-local-registry-sourceArea: local registry sources (vendoring)Area: local registry sources (vendoring)C-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-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
If you have a set of crates in local registry or directory source formats that is not a direct mirror/vendor of a hosted crate repository, it's currently required to specify both an alternative registry with a placeholder index URI and source replacement to redirect the registry to the local files, e.g.:
Proposed Solution
It should be possible to directly define an alternative registry that uses a local source format, e.g.:
A related but orthogonal improvement in this space would be to automatically define a default value for
sources.{registry}.registrywhenregistries.{registry}.indexis set.Notes
Defining a registry source and defining an alternative registry have a lot of overlap. crates-io is privileged in that it's the default registry, but also that
sources.crates-io.registryis predefined, so source overriding it only requires settingsources.crates-io.replace-with, unlike for any alternative registry.Packaging Rust crates for Debian currently does so using source replacement of the crates-io registry despite also carrying (sometimes non-negligible) patches to the upstream crate sources. I'm not sure the exact reason why they do this, but reducing the overhead of properly utilizing an alternative registry seems like a good idea independent of whether Debian adopts it.