Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #10831 - arlosi:sparse-publish-fix, r=Eh2406
Fix publishing to crates.io with -Z sparse-registry Attempting to publish a crate to crates.io with `-Z sparse-registry` failed with the following error: ``` error: failed to publish to registry at https://crates.io Caused by: the remote server responded with an error: Dependency `serde` is hosted on another registry. Cross-registry dependencies are not permitted on crates.io. ``` The check in `registry.rs` `dep_registry_id != registry_id` caused the `publish` operation include the crates.io index url in the HTTP request because the id was replaced. The crates.io API seems to require that the `registry` field is not present. This change fixes the issue by making the `registry` function return the non-replaced crates.io `source_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`
- Loading branch information