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

Retry on publish failure #44

Closed
davidlattimore opened this issue May 13, 2021 · 3 comments
Closed

Retry on publish failure #44

davidlattimore opened this issue May 13, 2021 · 3 comments

Comments

@davidlattimore
Copy link
Contributor

davidlattimore commented May 13, 2021

I use the ra_ap_* packages in evcxr - thanks for setting that up by the way!

I was just looking at rust-lang/rust-analyzer#8662 and the associated log:

info published ra_ap_stdx
    Updating crates.io index
warning: manifest has no documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
   Packaging ra_ap_tt v0.0.52 (/home/runner/work/rust-analyzer/rust-analyzer/crates/tt)
   Verifying ra_ap_tt v0.0.52 (/home/runner/work/rust-analyzer/rust-analyzer/crates/tt)
error: failed to verify package tarball

Caused by:
  failed to select a version for the requirement `ra_ap_stdx = "=0.0.52"`
  candidate versions found which didn't match: 0.0.51, 0.0.50, 0.0.49, ...
  location searched: crates.io index
  required by package `ra_ap_tt v0.0.52 (/home/runner/work/rust-analyzer/rust-analyzer/target/package/ra_ap_tt-0.0.52)`
error: unable to publish package ra_ap_tt

It looks like ra_ap_stdx version 0.0.52 is on crates.io, but presumably it hadn't shown up by the time it went to try and publish ra_ap_tt. The same thing happened with 0.0.50 and presumably 0.0.51.

I've observed similar failures when publishing my own crates if I publish one crate then immediately try to publish another that depends on the exact version of the first. I think there's often a small delay in crates showing up in the crates.io index.

I was wondering what you would think about adding an automatic retry if publishing fails? The number of attempts could be limited to say 3, with a delay in between attempts. It could optionally only retry if it finds something like "failed to select a version" in the output.

@pksunkara
Copy link
Owner

Hey, if you look at this code, what we actually do is wait until the previous code is published and is available in the local cargo index before publishing. This used to work perfectly before.

I think the recent update of crates-index might have messed it up. Or cargo changed how they read the local cargo index (they did this once before).

@pksunkara
Copy link
Owner

rust-lang/cargo@4c02977 changed it in cargo.

@pksunkara
Copy link
Owner

Relevant crates-index PR, frewsxcv/rust-crates-index#53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants