Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing a small DAG of crates requires arbitrary delay between publishing dependencies #10297

Closed
mitchmindtree opened this issue Jan 16, 2022 · 2 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@mitchmindtree
Copy link

Problem

Many Rust project repositories have multiple crates that form a small DAG of dependencies. These often reside in a single workspace. It is common for maintainers to attempt to synchronise versions across all crates under a single workspace/project. As a result, it is common to have an automated CI publish action where new versions of each crate are updated in lock-step after a version change lands in master.

When attempting to publish a dependent crate immediately after publishing its dependency, it is common for the cargo publish command to fail. This failure seems to be caused by crates.io taking some extra time (following when cargo publish exits) to propagate the new version to wherever it is accessible by cargo.

Workarounds

In my conrod and nannou workspaces, I've used a small arbitrary sleep step between cargo publish of dependent crates to work around this. I found that 15 seconds worked for around a year or so in 2019, but then after some more recent failures I've updated the delay to 30 seconds to try and be safe. This is not always guaranteed to work, as the necessary delay seems to fluctuate with how busy crates.io is.

Proposed Solution

It would be nice if there were some flag that could be passed to cargo publish that allowed for blocking until a crate's update has propagated through the registry to ensure that, upon returning, the new version of the crate will definitely be available to following calls to cargo publish for dependent crates. Perhaps something like cargo publish --wait-for-registry, or something similar.

I imagine a feature like this would also be necessary in order to land any sort of future cargo publish --workspace command (e.g. #1169) in cargo itself.

Notes

Related:

@mitchmindtree mitchmindtree added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Jan 16, 2022
@ehuss
Copy link
Contributor

ehuss commented Jan 16, 2022

Thanks for the report! However, I'm unclear, is this different from #9507? It seems like the same issue?

@ehuss
Copy link
Contributor

ehuss commented Feb 27, 2022

I'm going to close, as I believe this is essentially the same as #9507.

@ehuss ehuss closed this as completed Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

2 participants