From bc75f4838c0db2f476a0718305f5dfd424bdf028 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:08:21 +0000 Subject: [PATCH] Switch to AWS' dual-stack S3 URLs The default AWS S3 URLs only support IPv4, whereas the dual-stack URLs support both IPv4 and IPv6: https://docs.aws.amazon.com/AmazonS3/latest/API/ipv6-access.html https://docs.aws.amazon.com/AmazonS3/latest/API/dual-stack-endpoints.html By switching to the dual-stack URLs, it means systems that support IPv6 will now use it instead of IPv4, which is helpful in IPv6 environments where IPv4 traffic has to fall back to being routed via NAT gateways (which has performance and ingress cost implications). See also: https://salesforce-internal.slack.com/archives/C01R6FJ738U/p1770827176094169 GUS-W-21336806. --- CHANGELOG.md | 4 ++++ src/python_version.rs | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1d4855..f4b9b89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Changed the S3 URL used to download Python to use AWS' dual-stack (IPv6 compatible) endpoint. ([#513](https://github.com/heroku/buildpacks-python/pull/513)) + ## [5.0.0] - 2026-02-10 ### Changed diff --git a/src/python_version.rs b/src/python_version.rs index 5466056..e333164 100644 --- a/src/python_version.rs +++ b/src/python_version.rs @@ -99,7 +99,7 @@ impl PythonVersion { .. } = target; format!( - "https://heroku-buildpack-python.s3.us-east-1.amazonaws.com/python-{major}.{minor}.{patch}-{distro_name}-{distro_version}-{arch}.tar.zst" + "https://heroku-buildpack-python.s3.dualstack.us-east-1.amazonaws.com/python-{major}.{minor}.{patch}-{distro_name}-{distro_version}-{arch}.tar.zst" ) } } @@ -231,7 +231,7 @@ mod tests { distro_name: "ubuntu".to_string(), distro_version: "22.04".to_string() }), - "https://heroku-buildpack-python.s3.us-east-1.amazonaws.com/python-3.11.0-ubuntu-22.04-amd64.tar.zst" + "https://heroku-buildpack-python.s3.dualstack.us-east-1.amazonaws.com/python-3.11.0-ubuntu-22.04-amd64.tar.zst" ); assert_eq!( PythonVersion::new(3, 12, 2).url(&Target { @@ -241,7 +241,7 @@ mod tests { distro_name: "ubuntu".to_string(), distro_version: "24.04".to_string() }), - "https://heroku-buildpack-python.s3.us-east-1.amazonaws.com/python-3.12.2-ubuntu-24.04-arm64.tar.zst" + "https://heroku-buildpack-python.s3.dualstack.us-east-1.amazonaws.com/python-3.12.2-ubuntu-24.04-arm64.tar.zst" ); }