Skip to content

Commit 2ddb3c9

Browse files
committed
fix(uv): drop powerpc64 support to fix latest version downloads
Before this PR we would index all of the available binaries and it would fail in the case if the `sha256` file is not found. It seems that this is the case for the `powerpc64`. In order to work this around, we just drop support for that particular platform. Whilst at it, bump the uv version. Fixes #3676.
1 parent 900d557 commit 2ddb3c9

3 files changed

Lines changed: 38 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ Other changes:
8181
Fixes
8282
([#3260](https://github.com/bazel-contrib/rules_python/issues/3260) and
8383
[#2632](https://github.com/bazel-contrib/rules_python/issues/2632)).
84+
* (uv) We will now use the download URL specified in the `uv`'s `dist_manifest.json`
85+
file. If you have redirects or blocking rules as part of your downloader setup,
86+
you may need to adjust them. What is more, the default uv version has been bumped
87+
`0.11.2`.
8488

8589
{#v0-0-0-fixed}
8690
### Fixed
@@ -97,6 +101,19 @@ Other changes:
97101
* (bootstrap) Fixed incorrect runfiles path construction in bootstrap
98102
scripts when binary is defined in another bazel module
99103
([#3563](https://github.com/bazel-contrib/rules_python/issues/3563)).
104+
* (uv) Downloads for versions `>=0.10` work again. In order to fix this we had
105+
drop support for `powerpc64` platform. People interested in the platform can
106+
bring it back via the `uv.default` API. Like:
107+
```
108+
uv.default(
109+
compatible_with = [
110+
"@platforms//os:linux",
111+
"@platforms//cpu:ppc",
112+
],
113+
platform = "powerpc64-unknown-linux-gnu",
114+
)
115+
```
116+
Fixes [#3676](https://github.com/bazel-contrib/rules_python/issues/3676).
100117

101118
{#v0-0-0-added}
102119
### Added

MODULE.bazel

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ uv = use_extension("//python/uv:uv.bzl", "uv")
385385
uv.default(
386386
base_url = "https://github.com/astral-sh/uv/releases/download",
387387
manifest_filename = "dist-manifest.json",
388-
version = "0.6.3",
388+
version = "0.11.2",
389389
)
390390
uv.default(
391391
compatible_with = [
@@ -401,13 +401,6 @@ uv.default(
401401
],
402402
platform = "aarch64-unknown-linux-gnu",
403403
)
404-
uv.default(
405-
compatible_with = [
406-
"@platforms//os:linux",
407-
"@platforms//cpu:ppc",
408-
],
409-
platform = "powerpc64-unknown-linux-gnu",
410-
)
411404
uv.default(
412405
compatible_with = [
413406
"@platforms//os:linux",
@@ -460,7 +453,7 @@ uv_dev = use_extension(
460453
dev_dependency = True,
461454
)
462455
uv_dev.configure(
463-
version = "0.6.2",
456+
version = "0.11.2",
464457
)
465458

466459
# Temporarily comment out these flag aliases because they break Bazel 9

python/uv/private/uv.bzl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,17 @@ def _get_tool_urls_from_dist_manifest(module_ctx, *, base_url, manifest_filename
420420
"uv-aarch64-apple-darwin.tar.gz.sha256"
421421
"...
422422
]
423+
hosting
424+
order
425+
0 "simple"
426+
1 "github"
427+
github
428+
artifact_base_url "https://github.com"
429+
artifact_download_path "/astral-sh/uv/releases/download/0.11.2"
430+
owner "astral-sh"
431+
repo "uv"
432+
simple
433+
download_url "https://releases.astral.sh/github/uv/releases/download/0.11.2"
423434
artifacts
424435
uv-aarch64-apple-darwin.tar.gz
425436
name "uv-aarch64-apple-darwin.tar.gz"
@@ -460,6 +471,14 @@ def _get_tool_urls_from_dist_manifest(module_ctx, *, base_url, manifest_filename
460471
fail(result)
461472
dist_manifest = json.decode(module_ctx.read(dist_manifest))
462473

474+
base_url = (
475+
dist_manifest
476+
.get("releases", [{}])[0]
477+
.get("hosting", {})
478+
.get("simple", {})
479+
.get("download_url", base_url)
480+
)
481+
463482
artifacts = dist_manifest["artifacts"]
464483
tool_sources = {}
465484
downloads = {}

0 commit comments

Comments
 (0)