Skip to content

fix(uv): use astral urls for uv primary source, github as secondary#3746

Merged
rickeylev merged 2 commits intobazel-contrib:mainfrom
jwnimmer-tri:uv-availability
Apr 29, 2026
Merged

fix(uv): use astral urls for uv primary source, github as secondary#3746
rickeylev merged 2 commits intobazel-contrib:mainfrom
jwnimmer-tri:uv-availability

Conversation

@jwnimmer-tri
Copy link
Copy Markdown
Contributor

@jwnimmer-tri jwnimmer-tri commented Apr 28, 2026

For official releases, use the astral.sh mirror as the preferred url for binary downloads, with github.com as a fallback.

For uv >= 0.11.0, read the checksums directly from the dist-manifest contents, so the only github.com SPOF is fetching the dist-manifest itself.


It is not infrequent for github.com to give a 5xx error on one of the uv sha256 downloads, leading to a failed build. (The sha256 downloads cannot be cached by Bazel's repository cache, since we request them without a checksum.) See RobotLocomotion/drake#24140 for some examples, as well as bazelbuild/bazel-central-registry#8591 (comment) (log).

This change limits github as a single point of failure.

For official releases, use the astral.sh mirror as the preferred url
for binary downloads, with github.com as a fallback.

For uv >= 0.11.0, read the checksums directly from the dist-manifest
contents, so the only github.com SPOF is fetching the dist-manifest
itself.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances uv download reliability by introducing the astral.sh mirror as a preferred download source for official releases and optimizing checksum retrieval for uv versions 0.11.0 and later by reading them directly from the manifest. A review comment identifies that the mirror fallback should also be applied when downloading checksum files for older uv versions to ensure consistent availability.

Comment thread python/uv/private/uv.bzl
@rickeylev
Copy link
Copy Markdown
Collaborator

Thanks for this! TIL astral has mirrors.

Overall LGTM, just some word smithing of the PR and and changelog text to make: replace "improve ..." with "make uv use astral urls as primary, github as backup"

its not infrequent for github to give 500 errors

omg, i know right? It's been so bad lately.

would we like manifest_file_integrity = ... added as an option to the module extension.

Absolutely, yes.

@rickeylev rickeylev changed the title fix(uv): Improve download availability fix(uv): use astral urls for uv primary source, github as secondary Apr 28, 2026
@rickeylev rickeylev enabled auto-merge April 28, 2026 16:10
@jwnimmer-tri
Copy link
Copy Markdown
Contributor Author

Thanks!

I'll open a tracking issue about the manifest_file_integrity feature later today and work on it time permitting.

And lol, the windows CI build hit a github 5xx downloading a standalone cpython. Possibly those could use the astral mirror as well? I didn't look into that angle (and generally don't use those toolchains).

@aignas
Copy link
Copy Markdown
Collaborator

aignas commented Apr 28, 2026

We could write the dist manifest sha to the facts file.

@rickeylev rickeylev added this pull request to the merge queue Apr 29, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 29, 2026
@rickeylev rickeylev merged commit 4cce534 into bazel-contrib:main Apr 29, 2026
4 checks passed
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.

3 participants