From dccb8f24858e4e757da519f4071d1ac2ccfd3749 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 20 Mar 2023 10:03:57 +0100 Subject: [PATCH] feat(swift): support arm64 --- src/usr/local/buildpack/tools/v2/swift.sh | 13 ++++++++++--- test/Dockerfile.arm64 | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/usr/local/buildpack/tools/v2/swift.sh b/src/usr/local/buildpack/tools/v2/swift.sh index dbce21815f..9d1cccdc7e 100644 --- a/src/usr/local/buildpack/tools/v2/swift.sh +++ b/src/usr/local/buildpack/tools/v2/swift.sh @@ -52,6 +52,7 @@ function prepare_tool() { } function install_tool () { + local arch local tool_path local file local SWIFT_PLATFORM @@ -79,15 +80,21 @@ function install_tool () { # shellcheck source=/dev/null VERSION_ID=$(. /etc/os-release && echo "${VERSION_ID}") - # https://swift.org/builds/swift-5.3-release/ubuntu1804/swift-5.3-RELEASE/swift-5.3-RELEASE-ubuntu20.04.tar.gz + # https://download.swift.org/swift-5.7-release/ubuntu2204/swift-5.7-RELEASE/swift-5.7-RELEASE-ubuntu22.04.tar.gz + # https://download.swift.org/swift-5.7.3-release/ubuntu2204/swift-5.7.3-RELEASE/swift-5.7.3-RELEASE-ubuntu22.04.tar.gz + # https://download.swift.org/swift-5.7.3-release/ubuntu2204-aarch64/swift-5.7.3-RELEASE/swift-5.7.3-RELEASE-ubuntu22.04-aarch64.tar.gz if [[ "${PATCH}" = "0" ]]; then version=${MAJOR}.${MINOR} fi - SWIFT_PLATFORM=ubuntu${VERSION_ID} + if [[ "${ARCHITECTURE}" = "aarch64" ]]; then + arch=-${ARCHITECTURE} + fi + + SWIFT_PLATFORM=ubuntu${VERSION_ID}${arch} SWIFT_BRANCH=swift-${version}-release SWIFT_VER=swift-${version}-RELEASE - SWIFT_WEBROOT=https://swift.org/builds + SWIFT_WEBROOT=https://download.swift.org SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo "$SWIFT_PLATFORM" | tr -d .)" diff --git a/test/Dockerfile.arm64 b/test/Dockerfile.arm64 index 5b7ca1d565..34e37707f2 100644 --- a/test/Dockerfile.arm64 +++ b/test/Dockerfile.arm64 @@ -25,7 +25,7 @@ RUN uname -p | tee | grep aarch64 RUN touch /.dummy -ARG IGNORED_TOOLS=erlang,elixir,flutter,php,composer,swift +ARG IGNORED_TOOLS=erlang,elixir,flutter,php,composer RUN prepare-tool all