Skip to content

Commit 89c4f9f

Browse files
committed
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.
1 parent 72dc949 commit 89c4f9f

3 files changed

Lines changed: 42 additions & 1 deletion

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Manual FreeBSD Test
2+
on: workflow_dispatch
3+
4+
jobs:
5+
build_and_test:
6+
name: Build and Test
7+
env:
8+
SWIFT_INSTALL_PATH: "/opt/swift-main"
9+
SWIFT_WEB_URL: "https://download.swift.org/tmp-ci-nightly/development/freebsd-14_ci_latest.tar.gz"
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v6
13+
- name: Build in FreeBSD
14+
id: build
15+
uses: vmactions/freebsd-vm@v1
16+
with:
17+
envs: 'SWIFT_INSTALL_PATH SWIFT_WEB_URL'
18+
release: "14.3"
19+
sync: rsync
20+
copyback: false
21+
usesh: true
22+
prepare: |
23+
fetch -o /tmp/swift.tar.gz "$SWIFT_WEB_URL"
24+
mkdir -p /opt/swift-main
25+
tar -xzf /tmp/swift.tar.gz -C /opt/swift-main
26+
pkg install -y \
27+
sqlite3 \
28+
python3 \
29+
libuuid \
30+
curl \
31+
brotli \
32+
git
33+
git config --global init.defaultBranch 'main'
34+
"$SWIFT_INSTALL_PATH/usr/bin/swift" --version
35+
run: |
36+
export PATH="$SWIFT_INSTALL_PATH/usr/bin:$PATH"
37+
swift build
38+
swift test

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
uses: ./.github/workflows/swift_package_test.yml
2626
with:
2727
# Linux
28-
linux_os_versions: '["jammy", "rhel-ubi9", "amazonlinux2"]'
28+
linux_os_versions: '["jammy", "rhel-ubi9", "amazonlinux2", "amazonlinux2023"]'
2929
linux_host_archs: '["x86_64", "aarch64"]'
3030
linux_build_command: |
3131
cd tests/TestPackage

.github/workflows/scripts/install-and-build-with-sdk.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,9 @@ initialize_os_info() {
485485
elif [[ "$os_id" == "amzn" && "$version_id" == "2" ]]; then
486486
OS_NAME="amazonlinux2"
487487
OS_NAME_NO_DOT="amazonlinux2"
488+
elif [[ "$os_id" == "amzn" && "$version_id" == "2023" ]]; then
489+
OS_NAME="amazonlinux2023"
490+
OS_NAME_NO_DOT="amazonlinux2023"
488491
else
489492
# Ubuntu, Debian, Fedora
490493
OS_NAME="${os_id}${version_id}"

0 commit comments

Comments
 (0)