-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce dl
key to allow per-crate download links
#10484
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) soon. Please see the contribution instructions for more information. |
025e843
to
9e10fe3
Compare
I am not yet speaking for the team. I do not know what design work the Cargo Team will need before this will be excepted. One thing this will need is to be added to documentation. That will need to include: "Where can it be set?" and "What can it be set to?" |
9e10fe3
to
195b689
Compare
Thanks @Eh2406, added some documentation around this configuration value to the book. |
195b689
to
819f138
Compare
☔ The latest upstream changes (presumably #10470) made this pull request unmergeable. Please resolve the merge conflicts. |
This change allows the registry to override its own global `dl` key defined in the root config.json for each package version.
819f138
to
3fc27b2
Compare
Rebased, would appreciate your thoughts on this @ehuss, thanks in advance! |
@w4 I'm curious if you have any more details on how this would be used. If you could share, I'm interested in which 3rd party 'generic' registries are requesting this change? Is there a reason why the existing system of constructing download URLs isn't flexible enough? Why would some crates need to be downloaded from a different location? Also, I'm working on implementing rust-lang/rfcs#3139 which adds authentication support for registries when downloading crates. With the RFC implemented, if the registry sets If each crate crate had an individually configurable download URL as requested here, it greatly increases the number of places the token could be sent. Would we still want the authentication token always sent? Would we need that to be configurable as well? |
Hey @arlosi, GitLab's the one I'm dealing with, I did try to implement a change in their API to support the looking up crates by
For context, here's what I'm working on: https://github.com/w4/gitlab-cargo-shim, I've not publicised it at all thus far as it's in a less-than-ideal state where either Cargo or GitLab needs to be patched. Thanks |
Two questions,
|
A group is essentially GitLab vernacular for what GitHub calls an organisation (ie. rust-lang). It's very likely GitLab will need this, or the lookup by hash that their performance guys weren't happy with, for any usable first-class implementation. Any other approach would be a pretty massive API overhaul which, looking at their other registry implementations, is unprecedented for them. We've offered some man hours on their first-class endeavour fwiw. |
This will have interactions with lots of things. We talked it over at the Cargo Meeting yesterday, we did not think of any blockers, but did not feel confident we had enumerated all the concerns. |
I am closing to remove this from the PR queue, this is not a condemnation of your code or of the design. After an RFC discusses the design, this code may very well be acceptable. You can start an RFC discussion on https://internals.rust-lang.org/ |
This change allows the registry to override its own global
dl
key defined in the root config.json for each package version.What does this PR try to resolve?
Some third-party 'generic' registries can't (or aren't willing to) support the global 'one
dl
for everything' API that Cargo currently exposes for registries. This change allows much more flexibility by allowing the registry to return uniquedl
links for each individual package version.How should we test and review this PR?
Create a new registry with a mock
dl
in theconfig.json
and set the real link in the package version JSON line instead.