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

feat(publish): Support 'publish.timeout' config behind '-Zpublish-timeout' #11229

Closed
wants to merge 3 commits into from

Conversation

epage
Copy link
Contributor

@epage epage commented Oct 13, 2022

Originally, crates.io would block on publish requests until the publish
was complete, giving cargo publish this behavior by extension. When
crates.io switched to asynchronous publishing, this intermittently broke
people's workflows when publishing multiple crates. I say interittent
because it usually works until it doesn't and it is unclear why to the
end user because it will be published by the time they check. In the
end, callers tend to either put in timeouts (and pray), poll the
server's API, or use crates-index crate to poll the index.

This isn't sufficient because

  • For any new interested party, this is a pit of failure they'll fall
    into
  • crates-index has re-implemented index support incorrectly in the past,
    currently doesn't handle auth, doesn't support git-cli, etc.
  • None of these previous options work if we were to implement
    workspace-publish support (cargo publish multiple packages at once #1169)
  • The new sparse registry might increase the publish times, making the
    delay easier to hit manually
  • The new sparse registry goes through CDNs so checking the server's API
    might not be sufficient
  • Once the sparse registry is available, crates-index users will find
    out when the package is ready in git but it might not be ready through
    the sparse registry because of CDNs

This introduces unstable support for blocking by setting
publish.timeout to non-zero value.

A step towards #9507

Muscraft and others added 3 commits October 13, 2022 08:40
…eout'

Originally, crates.io would block on publish requests until the publish
was complete, giving `cargo publish` this behavior by extension.  When
crates.io switched to asynchronous publishing, this intermittently broke
people's workflows when publishing multiple crates.  I say interittent
because it usually works until it doesn't and it is unclear why to the
end user because it will be published by the time they check.  In the
end, callers tend to either put in timeouts (and pray), poll the
server's API, or use `crates-index` crate to poll the index.

This isn't sufficient because
- For any new interested party, this is a pit of failure they'll fall
  into
- crates-index has re-implemented index support incorrectly in the past,
  currently doesn't handle auth, doesn't support `git-cli`, etc.
- None of these previous options work if we were to implement
  workspace-publish support (rust-lang#1169)
- The new sparse registry might increase the publish times, making the
  delay easier to hit manually
- The new sparse registry goes through CDNs so checking the server's API
  might not be sufficient
- Once the sparse registry is available, crates-index users will find
  out when the package is ready in git but it might not be ready through
  the sparse registry because of CDNs

This introduces unstable support for blocking by setting
`publish.timeout` to non-zero value.

A step towards rust-lang#9507
@epage epage closed this Oct 13, 2022
@epage epage deleted the unstable branch October 13, 2022 14:33
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

Successfully merging this pull request may close these issues.

None yet

2 participants