Skip to content

A bug about cargo publish --workspace --registry crates-io #17196

Description

@algosul

Problem

$ cargo publish --workspace --registry crates-io
    Updating crates.io index // ***** this *****
   Packaging algosul-core v0.0.13 (/home/algosul/workspace/algosul-rs/core)
    Updating `rsproxy-sparse` index // ***** this *****
    Packaged 12 files, 51.8KiB (17.9KiB compressed)
   Packaging algosul v0.0.13 (/home/algosul/workspace/algosul-rs)
    Updating `rsproxy-sparse` index // ***** this *****
error: failed to prepare local package for uploading

Caused by:
  failed to select a version for the requirement `algosul-core = "^0.0.13"`
  candidate versions found which didn't match: 0.0.12, 0.0.10, 0.0.7, ...
  location searched: `rsproxy-sparse` index (which is replacing registry `crates-io`) // ***** this *****
  required by package `algosul v0.0.13 (/home/algosul/workspace/algosul-rs)`
  note: perhaps a crate was updated and forgotten to be re-vendored?

Only the first one has the registry correctly configured.
Obviously, the mirror source doesn't update that quickly. This will cause the publish to fail.
This bug only occurs when different dependent crates within a single workspace are simultaneously published using cargo and have replace-with = '***' set in ~/.cargo/config.toml for [source.crates-io].

Steps

  1. replace-with = '***' set in ~/.cargo/config.toml for [source.crates-io].
  2. Create a workspace with interdependent dependencies.
  3. Try running cargo publish --workspace --registry crates-io

Possible Solution(s)

Make --registry *** apply to all crates

Notes

No response

Version

~ cargo --version
cargo 1.99.0-nightly (59800466c 2026-07-07)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions