diff --git a/swift-ci/master/amazon-linux/2/Dockerfile b/swift-ci/master/amazon-linux/2/Dockerfile index 6d3d154f..50af5a97 100644 --- a/swift-ci/master/amazon-linux/2/Dockerfile +++ b/swift-ci/master/amazon-linux/2/Dockerfile @@ -12,7 +12,6 @@ RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.n # Update and install needed build packages RUN yum -y group install "development tools" RUN yum -y install \ - clang \ cmake \ curl-devel \ gcc-c++ \ @@ -47,6 +46,49 @@ RUN mkdir -p /usr/local/lib/python3.7/site-packages/ RUN easy_install-3.7 six +ARG SWIFT_PLATFORM=amazonlinux2 +ARG SWIFT_VERSION=5.8.1 +ARG SWIFT_BRANCH=swift-${SWIFT_VERSION}-release +ARG SWIFT_TAG=swift-${SWIFT_VERSION}-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org +ARG SWIFT_PREFIX=/opt/swift/${SWIFT_VERSION} + +ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_TAG=$SWIFT_TAG \ + SWIFT_WEBROOT=$SWIFT_WEBROOT \ + SWIFT_PREFIX=$SWIFT_PREFIX + +RUN set -e; \ + ARCH_NAME="$(rpm --eval '%{_arch}')"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'x86_64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'aarch64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_TAG/$SWIFT_TAG-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + && echo $SWIFT_BIN_URL \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && mkdir -p $SWIFT_PREFIX \ + && tar -xzf swift.tar.gz --directory $SWIFT_PREFIX --strip-components=1 \ + && chmod -R o+r $SWIFT_PREFIX/usr/lib/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz + +ENV PATH="${SWIFT_PREFIX}/usr/bin:${PATH}" + USER build-user WORKDIR /home/build-user diff --git a/swift-ci/master/centos/7/Dockerfile b/swift-ci/master/centos/7/Dockerfile index 7eab8876..4d38603a 100644 --- a/swift-ci/master/centos/7/Dockerfile +++ b/swift-ci/master/centos/7/Dockerfile @@ -19,7 +19,6 @@ RUN yum install --enablerepo=centosplus -y \ libtool \ libuuid-devel \ libxml2-devel \ - llvm-toolset-7.0 \ make \ ncurses-devel \ ninja-build \ @@ -41,13 +40,41 @@ RUN yum install --enablerepo=centosplus -y \ zip \ zlib-devel -RUN echo -e ". /opt/rh/sclo-git25/enable\n. /opt/rh/llvm-toolset-7.0/enable\n. /opt/rh/devtoolset-8/enable\n" >> /home/build-user/.bashrc - -RUN echo /opt/rh/llvm-toolset-7.0/root/usr/lib64/ > /etc/ld.so.conf.d/llvm-toolset.conf -RUN ldconfig +RUN echo -e ". /opt/rh/sclo-git25/enable\n. /opt/rh/devtoolset-8/enable\n" >> /home/build-user/.bashrc RUN sed -i -e 's/\*__block/\*__libc_block/g' /usr/include/unistd.h +ARG SWIFT_PLATFORM=centos7 +ARG SWIFT_VERSION=5.8.1 +ARG SWIFT_BRANCH=swift-${SWIFT_VERSION}-release +ARG SWIFT_TAG=swift-${SWIFT_VERSION}-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org +ARG SWIFT_PREFIX=/opt/swift/${SWIFT_VERSION} + +ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_TAG=$SWIFT_TAG \ + SWIFT_WEBROOT=$SWIFT_WEBROOT \ + SWIFT_PREFIX=$SWIFT_PREFIX + +RUN set -e; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_TAG/$SWIFT_TAG-$SWIFT_PLATFORM.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && mkdir -p $SWIFT_PREFIX \ + && tar -xzf swift.tar.gz --directory $SWIFT_PREFIX --strip-components=1 \ + && chmod -R o+r $SWIFT_PREFIX/usr/lib/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz + +ENV PATH="${SWIFT_PREFIX}/usr/bin:${PATH}" + USER build-user WORKDIR /home/build-user diff --git a/swift-ci/master/rhel-ubi/9/Dockerfile b/swift-ci/master/rhel-ubi/9/Dockerfile index 21011051..3489c70a 100644 --- a/swift-ci/master/rhel-ubi/9/Dockerfile +++ b/swift-ci/master/rhel-ubi/9/Dockerfile @@ -6,8 +6,8 @@ RUN groupadd -g 42 build-user && \ RUN yum install -y \ git \ gcc-c++ \ - clang \ cmake \ + diffutils \ make \ libcurl-devel \ libedit-devel \ @@ -20,6 +20,49 @@ RUN yum install -y \ unzip \ zip +ARG SWIFT_PLATFORM=ubi9 +ARG SWIFT_VERSION=5.8.1 +ARG SWIFT_BRANCH=swift-${SWIFT_VERSION}-release +ARG SWIFT_TAG=swift-${SWIFT_VERSION}-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org +ARG SWIFT_PREFIX=/opt/swift/${SWIFT_VERSION} + +ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_TAG=$SWIFT_TAG \ + SWIFT_WEBROOT=$SWIFT_WEBROOT \ + SWIFT_PREFIX=$SWIFT_PREFIX + +RUN set -e; \ + ARCH_NAME="$(rpm --eval '%{_arch}')"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'x86_64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'aarch64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_TAG/$SWIFT_TAG-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + && echo $SWIFT_BIN_URL \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && mkdir -p $SWIFT_PREFIX \ + && tar -xzf swift.tar.gz --directory $SWIFT_PREFIX --strip-components=1 \ + && chmod -R o+r $SWIFT_PREFIX/usr/lib/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz + +ENV PATH="${SWIFT_PREFIX}/usr/bin:${PATH}" + USER build-user WORKDIR /home/build-user diff --git a/swift-ci/master/ubuntu/18.04/Dockerfile b/swift-ci/master/ubuntu/18.04/Dockerfile index 83ec1767..1229864e 100644 --- a/swift-ci/master/ubuntu/18.04/Dockerfile +++ b/swift-ci/master/ubuntu/18.04/Dockerfile @@ -7,7 +7,6 @@ ENV DEBIAN_FRONTEND="noninteractive" RUN apt -y update && apt -y install \ build-essential \ - clang \ cmake \ git \ icu-devtools \ @@ -34,6 +33,41 @@ RUN apt -y update && apt -y install \ uuid-dev \ zip +ARG SWIFT_PLATFORM=ubuntu18.04 +ARG SWIFT_VERSION=5.8.1 +ARG SWIFT_BRANCH=swift-${SWIFT_VERSION}-release +ARG SWIFT_TAG=swift-${SWIFT_VERSION}-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org +ARG SWIFT_PREFIX=/opt/swift/${SWIFT_VERSION} + +ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_TAG=$SWIFT_TAG \ + SWIFT_WEBROOT=$SWIFT_WEBROOT \ + SWIFT_PREFIX=$SWIFT_PREFIX + +RUN set -e; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_TAG/$SWIFT_TAG-$SWIFT_PLATFORM.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + # - Grab curl here so we cache better up above + && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && mkdir -p $SWIFT_PREFIX \ + && tar -xzf swift.tar.gz --directory $SWIFT_PREFIX --strip-components=1 \ + && chmod -R o+r $SWIFT_PREFIX/usr/lib/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ + && apt-get purge --auto-remove -y curl + +ENV PATH="${SWIFT_PREFIX}/usr/bin:${PATH}" + USER build-user WORKDIR /home/build-user diff --git a/swift-ci/master/ubuntu/20.04/Dockerfile b/swift-ci/master/ubuntu/20.04/Dockerfile index 9a440ae0..4b9fec3b 100644 --- a/swift-ci/master/ubuntu/20.04/Dockerfile +++ b/swift-ci/master/ubuntu/20.04/Dockerfile @@ -7,7 +7,6 @@ ENV DEBIAN_FRONTEND="noninteractive" RUN apt-get -y update && apt-get -y install \ build-essential \ - clang \ cmake \ git \ icu-devtools \ @@ -25,6 +24,7 @@ RUN apt-get -y update && apt-get -y install \ python2-dev \ python3-six \ python3-distutils \ + python3-pkg-resources \ python3-psutil \ rsync \ swig \ @@ -33,6 +33,52 @@ RUN apt-get -y update && apt-get -y install \ uuid-dev \ zip +ARG SWIFT_PLATFORM=ubuntu20.04 +ARG SWIFT_VERSION=5.8.1 +ARG SWIFT_BRANCH=swift-${SWIFT_VERSION}-release +ARG SWIFT_TAG=swift-${SWIFT_VERSION}-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org +ARG SWIFT_PREFIX=/opt/swift/${SWIFT_VERSION} + +ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_TAG=$SWIFT_TAG \ + SWIFT_WEBROOT=$SWIFT_WEBROOT \ + SWIFT_PREFIX=$SWIFT_PREFIX + +RUN set -e; \ + ARCH_NAME="$(dpkg --print-architecture)"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'amd64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'arm64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_TAG/$SWIFT_TAG-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + # - Grab curl here so we cache better up above + && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && mkdir -p $SWIFT_PREFIX \ + && tar -xzf swift.tar.gz --directory $SWIFT_PREFIX --strip-components=1 \ + && chmod -R o+r $SWIFT_PREFIX/usr/lib/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ + && apt-get purge --auto-remove -y curl + +ENV PATH="${SWIFT_PREFIX}/usr/bin:${PATH}" + USER build-user WORKDIR /home/build-user diff --git a/swift-ci/master/ubuntu/22.04/Dockerfile b/swift-ci/master/ubuntu/22.04/Dockerfile index a7cf8905..9f9044f2 100644 --- a/swift-ci/master/ubuntu/22.04/Dockerfile +++ b/swift-ci/master/ubuntu/22.04/Dockerfile @@ -7,7 +7,6 @@ ENV DEBIAN_FRONTEND="noninteractive" RUN apt-get -y update && apt-get -y install \ build-essential \ - clang \ cmake \ git \ icu-devtools \ @@ -25,6 +24,7 @@ RUN apt-get -y update && apt-get -y install \ python2-dev \ python3-six \ python3-distutils \ + python3-pkg-resources \ python3-psutil \ rsync \ swig \ @@ -33,6 +33,52 @@ RUN apt-get -y update && apt-get -y install \ uuid-dev \ zip +ARG SWIFT_PLATFORM=ubuntu22.04 +ARG SWIFT_VERSION=5.8.1 +ARG SWIFT_BRANCH=swift-${SWIFT_VERSION}-release +ARG SWIFT_TAG=swift-${SWIFT_VERSION}-RELEASE +ARG SWIFT_WEBROOT=https://download.swift.org +ARG SWIFT_PREFIX=/opt/swift/${SWIFT_VERSION} + +ENV SWIFT_PLATFORM=$SWIFT_PLATFORM \ + SWIFT_VERSION=$SWIFT_VERSION \ + SWIFT_BRANCH=$SWIFT_BRANCH \ + SWIFT_TAG=$SWIFT_TAG \ + SWIFT_WEBROOT=$SWIFT_WEBROOT \ + SWIFT_PREFIX=$SWIFT_PREFIX + +RUN set -e; \ + ARCH_NAME="$(dpkg --print-architecture)"; \ + url=; \ + case "${ARCH_NAME##*-}" in \ + 'amd64') \ + OS_ARCH_SUFFIX=''; \ + ;; \ + 'arm64') \ + OS_ARCH_SUFFIX='-aarch64'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$ARCH_NAME'"; exit 1 ;; \ + esac; \ + SWIFT_WEBDIR="$SWIFT_WEBROOT/$SWIFT_BRANCH/$(echo $SWIFT_PLATFORM | tr -d .)$OS_ARCH_SUFFIX" \ + && SWIFT_BIN_URL="$SWIFT_WEBDIR/$SWIFT_TAG/$SWIFT_TAG-$SWIFT_PLATFORM$OS_ARCH_SUFFIX.tar.gz" \ + && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \ + # - Grab curl here so we cache better up above + && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \ + # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify. + && export GNUPGHOME="$(mktemp -d)" \ + && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \ + && curl -fSsL https://swift.org/keys/all-keys.asc | gpg --import - \ + && gpg --batch --verify swift.tar.gz.sig swift.tar.gz \ + # - Unpack the toolchain, set libs permissions, and clean up. + && mkdir -p $SWIFT_PREFIX \ + && tar -xzf swift.tar.gz --directory $SWIFT_PREFIX --strip-components=1 \ + && chmod -R o+r $SWIFT_PREFIX/usr/lib/swift \ + && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \ + && apt-get purge --auto-remove -y curl + +ENV PATH="${SWIFT_PREFIX}/usr/bin:${PATH}" + USER build-user WORKDIR /home/build-user