From bbd5c0d1289fbe897961f8b482c57e4d9f9377c6 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Thu, 12 Mar 2026 09:30:06 +0000 Subject: [PATCH] Download uv from `releases.astral.sh` instead of GitHub releases Since Astral now mirror uv releases to `releases.astral.sh`, which is backed by Cloudflare R2 / CDN, and so is more reliable than GitHub releases. See: https://github.com/astral-sh/uv/pull/18207#issuecomment-3997795493 GUS-W-21561072. --- CHANGELOG.md | 1 + src/errors.rs | 8 ++++---- src/layers/uv.rs | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 984bd97..3a77409 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Updated uv from 0.10.7 to 0.10.9. ([#523](https://github.com/heroku/buildpacks-python/pull/523)) +- Switched to downloading uv from `releases.astral.sh` instead of GitHub releases. ([#524](https://github.com/heroku/buildpacks-python/pull/524)) ## [6.0.1] - 2026-03-03 diff --git a/src/errors.rs b/src/errors.rs index f1a6064..110401a 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -516,15 +516,15 @@ fn on_uv_layer_error(error: UvLayerError) { DownloadUnpackArchiveError::Request(ureq_error) => log_error( "Unable to download uv", formatdoc! {" - An error occurred while downloading uv from GitHub. + An error occurred while downloading uv from Astral's website. In some cases, this happens due to a temporary issue with - the network connection or GitHub's API/CDN. + the network connection or Astral's CDN, Cloudflare. Try building again to see if the error resolves itself. - If that doesn't help, check the status of GitHub here: - https://www.githubstatus.com + If that doesn't help, check the status of Cloudflare here: + https://www.cloudflarestatus.com Details: {ureq_error} "}, diff --git a/src/layers/uv.rs b/src/layers/uv.rs index 2212bf3..00789ae 100644 --- a/src/layers/uv.rs +++ b/src/layers/uv.rs @@ -87,7 +87,7 @@ pub(crate) fn install_uv( // 1. It's currently slower than the glibc variant: https://github.com/astral-sh/uv/issues/10610 // 2. At the moment this buildpack only supports Ubuntu anyway (we only compile Python runtimes for Ubuntu). let archive_url = format!( - "https://github.com/astral-sh/uv/releases/download/{UV_VERSION}/uv-{ARCH}-unknown-linux-gnu.tar.gz" + "https://releases.astral.sh/github/uv/releases/download/{UV_VERSION}/uv-{ARCH}-unknown-linux-gnu.tar.gz" ); let layer_bin_dir = layer.path().join("bin"); utils::download_and_unpack_nested_gzip_archive(&archive_url, &layer_bin_dir, 1)