Skip to content

Conversation

weihanglo
Copy link
Member

@weihanglo weihanglo commented Sep 25, 2025

What does this PR try to resolve?

Before this, cargo publish --workspace would fail
if any member packages were already published.

After this, it skips already published packages
and continues with the rest.

To make sure the local package is really published,
we verify the checksum of the newly packed .crate tarball
against the checksum from the registry index.
This helps catch cases where the package contents changed
but the version wasn’t bumped,
which would otherwise be treated as already published.

fixes #13397

How to test and review this PR?

Need discussions, FCP, and maybe an unstable flag.

Some other design questions:

  • Is this a breaking change to --workspace publish?
  • We might want to skip --verify for already published packages.
  • Better diagnostics.

Before this, `cargo publish --workspace` would fail
if any member packages were already published.

After this, it skips already published packages
and continues with the rest.

To make sure the local package is really published,
we verify the checksum of the newly packed `.crate` tarball
against the checksum from the registry index.
This helps catch cases where the package contents changed
but the version wasn’t bumped,
which would otherwise be treated as already published.
@rustbot rustbot added A-interacts-with-crates.io Area: interaction with registries Command-publish S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 25, 2025
@weihanglo weihanglo marked this pull request as draft September 25, 2025 05:38
@rustbot
Copy link
Collaborator

rustbot commented Sep 25, 2025

r? @epage

rustbot has assigned @epage.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 25, 2025
@MOZGIII
Copy link

MOZGIII commented Sep 29, 2025

Why only for the workspaces? Doesn't it make sense to do it for the non-workspace publish too?

@weihanglo
Copy link
Member Author

Why only for the workspaces? Doesn't it make sense to do it for the non-workspace publish too?

See #13397 (comment)
This PR is a proof-of-concept not meant for general discussions btw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-interacts-with-crates.io Area: interaction with registries Command-publish
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Want cargo publish --idempotent
4 participants