From 291f797416fdc4765638f33e283235c8d5c0fcd0 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Wed, 1 Jul 2026 12:12:44 -0700 Subject: [PATCH] Map Amazon Linux 2023 to amazonlinux2023 toolchain infix Amazon Linux 2023 reports ID=amzn and VERSION_ID=2023 in /etc/os-release. This combination fell through to the generic else branch, producing the OS name amzn2023 and thus an invalid Swift toolchain download URL (swift-...-amzn2023-aarch64.tar.gz), causing a "Toolchain not found" failure. Special-case it to the amazonlinux2023 infix that swift.org actually publishes. --- .github/workflows/pull_request.yml | 4 +++- .github/workflows/scripts/install-and-build-with-sdk.sh | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 99d9db78..8da9c703 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -25,7 +25,9 @@ jobs: uses: ./.github/workflows/swift_package_test.yml with: # Linux - linux_os_versions: '["jammy", "rhel-ubi9"]' + linux_os_versions: '["jammy", "rhel-ubi9", "amazonlinux2023"]' + # Amazon Linux 2023 images are only available for Swift 6.3 and later. + linux_exclude_swift_versions: '[{"swift_version": "5.9", "os_version": "amazonlinux2023"}, {"swift_version": "5.10", "os_version": "amazonlinux2023"}, {"swift_version": "6.0", "os_version": "amazonlinux2023"}, {"swift_version": "6.1", "os_version": "amazonlinux2023"}, {"swift_version": "6.2", "os_version": "amazonlinux2023"}]' linux_host_archs: '["x86_64", "aarch64"]' linux_build_command: | cd tests/TestPackage diff --git a/.github/workflows/scripts/install-and-build-with-sdk.sh b/.github/workflows/scripts/install-and-build-with-sdk.sh index 93305a09..fe313d95 100755 --- a/.github/workflows/scripts/install-and-build-with-sdk.sh +++ b/.github/workflows/scripts/install-and-build-with-sdk.sh @@ -485,6 +485,9 @@ initialize_os_info() { elif [[ "$os_id" == "amzn" && "$version_id" == "2" ]]; then OS_NAME="amazonlinux2" OS_NAME_NO_DOT="amazonlinux2" + elif [[ "$os_id" == "amzn" && "$version_id" == "2023" ]]; then + OS_NAME="amazonlinux2023" + OS_NAME_NO_DOT="amazonlinux2023" else # Ubuntu, Debian, Fedora OS_NAME="${os_id}${version_id}"