[libcxx-commits] [libcxx] 8ea2b95 - [libc++][ci] Install Clang 11, Clang 12 and Clang ToT in the Docker image

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 8 11:14:26 PDT 2021


Author: Louis Dionne
Date: 2021-07-08T14:14:17-04:00
New Revision: 8ea2b951c65645ea803d4797dacbb8077b3aa629

URL: https://github.com/llvm/llvm-project/commit/8ea2b951c65645ea803d4797dacbb8077b3aa629
DIFF: https://github.com/llvm/llvm-project/commit/8ea2b951c65645ea803d4797dacbb8077b3aa629.diff

LOG: [libc++][ci] Install Clang 11, Clang 12 and Clang ToT in the Docker image

The compiler support policy mentions that we support Clang 11 and 12, so
we should test those. We already test on Clang 12, but I'll add testers
for Clang 11 once the new Docker image is in use on all the builders.

Added: 
    

Modified: 
    libcxx/utils/ci/Dockerfile

Removed: 
    


################################################################################
diff  --git a/libcxx/utils/ci/Dockerfile b/libcxx/utils/ci/Dockerfile
index eb3b810c1ef9..aeb1d2f24952 100644
--- a/libcxx/utils/ci/Dockerfile
+++ b/libcxx/utils/ci/Dockerfile
@@ -39,28 +39,36 @@ RUN apt-get update && apt-get install -y bash curl
 RUN apt-get update && apt-get install -y ninja-build python3 python3-sphinx python3-distutils git gdb
 RUN apt-get update && apt-get install -y libc6-dev-i386 # Required to cross-compile to 32 bits
 
-# Install the most recently released LLVM
+# Install Clang <latest>, <latest-1> and ToT, which are the ones we support.
+ENV LLVM_LATEST_VERSION=12
 RUN apt-get update && apt-get install -y lsb-release wget software-properties-common
 RUN wget https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh
-RUN bash /tmp/llvm.sh
-RUN LLVM_VERSION=$(find /usr/bin -regex '^.+/clang-[0-9.]+$') && LLVM_VERSION=${LLVM_VERSION#*clang-} && echo "LLVM_VERSION=$LLVM_VERSION" > /tmp/env.sh
-RUN ln -s $(find /usr/bin -regex '^.+/clang\+\+-[0-9.]+$') /usr/bin/clang++ && [ -e $(readlink /usr/bin/clang++) ]
-RUN ln -s $(find /usr/bin -regex '^.+/clang-[0-9.]+$') /usr/bin/clang && [ -e $(readlink /usr/bin/clang) ]
+RUN bash /tmp/llvm.sh $(($LLVM_LATEST_VERSION - 1)) # previous release
+RUN bash /tmp/llvm.sh $LLVM_LATEST_VERSION          # latest release
+RUN bash /tmp/llvm.sh $(($LLVM_LATEST_VERSION + 1)) # current ToT
 
-# Install the not-yet-released LLVM
-RUN . /tmp/env.sh && echo "LLVM_TOT_VERSION=$(($LLVM_VERSION + 1))" >> /tmp/env.sh
-RUN . /tmp/env.sh && bash /tmp/llvm.sh ${LLVM_TOT_VERSION}
-RUN . /tmp/env.sh && ln -s /usr/bin/clang++-${LLVM_TOT_VERSION} /usr/bin/clang++-tot && [ -e $(readlink /usr/bin/clang++-tot) ]
-RUN . /tmp/env.sh && ln -s /usr/bin/clang-${LLVM_TOT_VERSION} /usr/bin/clang-tot && [ -e $(readlink /usr/bin/clang-tot) ]
+# Make the latest Clang the "default" compiler on the system
+RUN ln -fs /usr/bin/clang++-$LLVM_LATEST_VERSION /usr/bin/c++ && [ -e $(readlink /usr/bin/c++) ]
+RUN ln -fs /usr/bin/clang-$LLVM_LATEST_VERSION /usr/bin/cc && [ -e $(readlink /usr/bin/cc) ]
+
+# Temporarily keep the clang++ and clang++-tot symlinks around for backwards compatibility with builders
+RUN ln -s /usr/bin/clang++-$LLVM_LATEST_VERSION /usr/bin/clang++ && [ -e $(readlink /usr/bin/clang++) ]
+RUN ln -s /usr/bin/clang-$LLVM_LATEST_VERSION /usr/bin/clang && [ -e $(readlink /usr/bin/clang) ]
+RUN ln -s /usr/bin/clang++-$(($LLVM_LATEST_VERSION + 1)) /usr/bin/clang++-tot && [ -e $(readlink /usr/bin/clang++-tot) ]
+RUN ln -s /usr/bin/clang-$(($LLVM_LATEST_VERSION + 1)) /usr/bin/clang-tot && [ -e $(readlink /usr/bin/clang-tot) ]
 
 # Install clang-format
-RUN . /tmp/env.sh && apt-get install -y clang-format-$LLVM_VERSION
-RUN ln -s $(find /usr/bin -regex '^.+/clang-format-[0-9.]+$') /usr/bin/clang-format && [ -e $(readlink /usr/bin/clang-format) ]
-RUN ln -s $(find /usr/bin -regex '^.+/git-clang-format-[0-9.]+$') /usr/bin/git-clang-format && [ -e $(readlink /usr/bin/git-clang-format) ]
+RUN apt-get install -y clang-format-$LLVM_LATEST_VERSION
+RUN ln -s /usr/bin/clang-format-$LLVM_LATEST_VERSION /usr/bin/clang-format && [ -e $(readlink /usr/bin/clang-format) ]
+RUN ln -s /usr/bin/git-clang-format-$LLVM_LATEST_VERSION /usr/bin/git-clang-format && [ -e $(readlink /usr/bin/git-clang-format) ]
 
-# Install the most recent GCC version and the previous one (which are the two we support)
+# Install the most recent GCC
+ENV GCC_LATEST_VERSION=11
 RUN add-apt-repository ppa:ubuntu-toolchain-r/test
-RUN apt-get update && apt install -y gcc-10 g++-10 gcc-11 g++-11
+RUN apt-get update && apt install -y gcc-$GCC_LATEST_VERSION g++-$GCC_LATEST_VERSION
+
+# Temporarily keep installing GCC 10 for backwards compatibility with build bots
+RUN apt-get update && apt install -y gcc-10 g++-10
 
 # Install a recent CMake
 RUN wget https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2-Linux-x86_64.sh -O /tmp/install-cmake.sh


        


More information about the libcxx-commits mailing list