Skip to content
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

Teach cargo that crates.io has two equivalent indexes. #10722

Closed
Eh2406 opened this issue Jun 2, 2022 · 0 comments · Fixed by #10725
Closed

Teach cargo that crates.io has two equivalent indexes. #10722

Eh2406 opened this issue Jun 2, 2022 · 0 comments · Fixed by #10725

Comments

@Eh2406
Copy link
Contributor

Eh2406 commented Jun 2, 2022

So I think the next piece of code for helping with stabilization has to do with teaching cargo that the two URLs registry+https://github.com/rust-lang/crates.io-index and sparse+https://index.crates.io/ are equivalent. Specifically making sure that lock files only show one even if both are available, and that you can successfully publish with either configured.

Testing with a .cargo/config.toml of:

[source.crates-io]
replace-with = "crates-io-http"

[source.crates-io-http]
registry = "sparse+https://index.crates.io/"

and it generates a lock file that has:

[[package]]
name = "serde"
version = "1.0.137"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1"

So I don't think this is going to be super difficult. What I want is for cargo to act as if that override was set if -Z http-registry is passed (and no explicit override was set).

We may end up fixing the issue with publishing where there's a replacement as we work on this, but I think this will end up being implemented through a somewhat different code path. It will do the same thing as having a replacement, but it will not be implemented as literally a replacement. (Or if it is, cargo will know this one special and to treat it differently.)

cc: #9069

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant