Fix publishing to crates.io with -Z sparse-registry#10831
Fix publishing to crates.io with -Z sparse-registry#10831bors merged 1 commit intorust-lang:masterfrom
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-registryfailed with the following error:The check in
registry.rsdep_registry_id != registry_idcaused thepublishoperation include the crates.io index url in the HTTP request because the id was replaced. The crates.io API seems to require that theregistryfield is not present.This change fixes the issue by making the
registryfunction return the non-replaced crates.iosource_idonly for this case. Other replacement indices of crates.io continue to include the registry URL when publishing.Tested manually by publishing
arlosi-cargo-testto crates.io with-Z sparse-registryFixes #10828
r? @Eh2406