Skip to content

The presence of a sparse-registry feature flag causes cargo publish to fail with "cross-registry dependencies are not permitted" #10828

@bstrie

Description

@bstrie

Problem

I have a repo where I'm trying out the new sparse-registry support (specifically, I'm passing the flag via the [unstable] table in .cargo/config). While attempting to do cargo publish, I get extremely cryptic server-side errors:

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.

Suffice to say, serde is not hosted on another registry, and manually inspecting the to-be-uploaded crate package confirms that nothing is out of the ordinary. (Serde is just one example; depending on the crate being uploaded, the specific crate that crates.io claims to be choking on will vary.) Removing the sparse-registry key fixes the issue (as does using any version of Cargo that doesn't support sparse-registry).

Tested on Cargo 2022-06-23 and 2022-07-03.

Version

cargo 1.64.0-nightly (a5e08c470 2022-06-23)
release: 1.64.0-nightly
commit-hash: a5e08c4703f202e30cdaf80ca3e7c00baa59c496
commit-date: 2022-06-23
host: x86_64-unknown-linux-gnu
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.83.1-DEV (sys:0.4.55+curl-7.83.1 vendored ssl:OpenSSL/1.1.1n)
os: Pop!_OS 22.04 (jammy) [64-bit]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions