-
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
Fix publishing to crates.io with -Z sparse-registry #10831
Conversation
Is there any way to add a test for this? |
I don't know of a way to test it as is. The tests for publishing to crates.io actually do include the problematic If we want to be able to test it, then we need to make a breaking change such that publishing to replaced crates.io doesn't include the |
@bors r+ The general problem is part of rust-lang/rfcs#3289 but this can be a one off. |
☀️ Test successful - checks-actions |
…79e13a071ad4b17435bd6bfa4c 2022-07-03 13:41:11 +0000 to 2022-07-09 14:48:50 +0000 - Mention `[patch]` config in "Overriding Dependencies" (rust-lang/cargo#10836) - Update terminal-width flag. (rust-lang/cargo#10833) - Refactor check_yanked to avoid some duplication (rust-lang/cargo#10835) - Fix publishing to crates.io with -Z sparse-registry (rust-lang/cargo#10831) - Make `is_yanked` return `Poll<>` (rust-lang/cargo#10830) - Fix corrupted git checkout recovery. (rust-lang/cargo#10829) - add a cache for discovered workspace roots (rust-lang/cargo#10776)
Update cargo 7 commits in c0bbd42ce5e83fe2a93e817c3f9b955492d3130a..b1dd22e668af5279e13a071ad4b17435bd6bfa4c 2022-07-03 13:41:11 +0000 to 2022-07-09 14:48:50 +0000 - Mention `[patch]` config in "Overriding Dependencies" (rust-lang/cargo#10836) - Update terminal-width flag. (rust-lang/cargo#10833) - Refactor check_yanked to avoid some duplication (rust-lang/cargo#10835) - Fix publishing to crates.io with -Z sparse-registry (rust-lang/cargo#10831) - Make `is_yanked` return `Poll<>` (rust-lang/cargo#10830) - Fix corrupted git checkout recovery. (rust-lang/cargo#10829) - add a cache for discovered workspace roots (rust-lang/cargo#10776)
Dropping |
Attempting to publish a crate to crates.io with
-Z sparse-registry
failed with the following error:The check in
registry.rs
dep_registry_id != registry_id
caused thepublish
operation include the crates.io index url in the HTTP request because the id was replaced. The crates.io API seems to require that theregistry
field is not present.This change fixes the issue by making the
registry
function return the non-replaced crates.iosource_id
only for this case. Other replacement indices of crates.io continue to include the registry URL when publishing.Tested manually by publishing
arlosi-cargo-test
to crates.io with-Z sparse-registry
Fixes #10828
r? @Eh2406