[libcxx-commits] [libcxx] [libc++] Use compiler explorer for Clang as well and update to LLVM 23 as head (PR #185168)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Mar 7 01:21:36 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Nikolas Klauser (philnik777)

<details>
<summary>Changes</summary>

Using the compiler explorer infrastucture simplifies the dockerfile a bit, since we have a single source for compilers now instead of two independent ones. compiler explorer is also usually significantly faster at providing new versions than apt.llvm.org.


---
Full diff: https://github.com/llvm/llvm-project/pull/185168.diff


2 Files Affected:

- (modified) libcxx/utils/ci/docker/docker-compose.yml (+1-1) 
- (modified) libcxx/utils/ci/docker/linux-builder-base.dockerfile (+27-28) 


``````````diff
diff --git a/libcxx/utils/ci/docker/docker-compose.yml b/libcxx/utils/ci/docker/docker-compose.yml
index e356420276acb..1a1fb84c8bb79 100644
--- a/libcxx/utils/ci/docker/docker-compose.yml
+++ b/libcxx/utils/ci/docker/docker-compose.yml
@@ -15,7 +15,7 @@ services:
       dockerfile: libcxx/utils/ci/docker/linux-builder-base.dockerfile
       args:
         GCC_HEAD_VERSION: 16
-        LLVM_HEAD_VERSION: 22
+        LLVM_HEAD_VERSION: 23
 
   libcxx-linux-builder:
     image: ghcr.io/llvm/libcxx-linux-builder:${TAG:-latest}
diff --git a/libcxx/utils/ci/docker/linux-builder-base.dockerfile b/libcxx/utils/ci/docker/linux-builder-base.dockerfile
index 65ca6e3ab6912..fa9930ca194bf 100644
--- a/libcxx/utils/ci/docker/linux-builder-base.dockerfile
+++ b/libcxx/utils/ci/docker/linux-builder-base.dockerfile
@@ -91,42 +91,41 @@ RUN <<EOF
   sudo locale-gen
 EOF
 
-# Install Clang <latest>, <latest-1> and ToT, which are the ones we support.
-# We also install <latest-2> because we need to support the "latest-1" of the
-# current LLVM release branch, which is effectively the <latest-2> of the
-# tip-of-trunk LLVM. For example, after branching LLVM 14 but before branching
-# LLVM 15, we still need to have Clang 12 in this Docker image because the LLVM
-# 14 release branch CI uses it. The tip-of-trunk CI will never use Clang 12,
-# though.
-RUN <<EOF
-  set -e
-  sudo apt-get update
-  wget https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh
-  chmod +x /tmp/llvm.sh
-  sudo /tmp/llvm.sh $(($LLVM_HEAD_VERSION - 3)) all  # for CI transitions
-  sudo /tmp/llvm.sh $(($LLVM_HEAD_VERSION - 2)) all  # previous release
-  sudo /tmp/llvm.sh $(($LLVM_HEAD_VERSION - 1)) all  # latest release
-  sudo /tmp/llvm.sh $LLVM_HEAD_VERSION          all  # current ToT
-  sudo rm -rf /var/lib/apt/lists/*
-EOF
-
 # Install the most recent GCC, like clang install the previous version as a transition.
 RUN <<EOF
+  install_gcc() {
+    sudo /tmp/ce-infra/bin/ce_install install compilers/c++/x86/gcc $1.1.0
+    sudo ln -s /opt/compiler-explorer/gcc-$1.1.0/bin/gcc /usr/bin/gcc-$1
+    sudo ln -s /opt/compiler-explorer/gcc-$1.1.0/bin/g++ /usr/bin/g++-$1
+  }
+
   set -e
   sudo git clone https://github.com/compiler-explorer/infra.git /tmp/ce-infra
   (cd /tmp/ce-infra && sudo make ce)
-  # Current ToT, we do not guarantee any support in our support matrix.
+
+  # Trunk needs special handling due to it being a nightly build
   sudo /tmp/ce-infra/bin/ce_install --enable nightly install compilers/c++/nightly/gcc trunk
   sudo ln -s /opt/compiler-explorer/gcc-snapshot/bin/gcc /usr/bin/gcc-$GCC_HEAD_VERSION
   sudo ln -s /opt/compiler-explorer/gcc-snapshot/bin/g++ /usr/bin/g++-$GCC_HEAD_VERSION
-  # The latest release.
-  sudo /tmp/ce-infra/bin/ce_install install compilers/c++/x86/gcc $((GCC_HEAD_VERSION - 1)).1.0
-  sudo ln -s /opt/compiler-explorer/gcc-$((GCC_HEAD_VERSION - 1)).1.0/bin/gcc /usr/bin/gcc-$((GCC_HEAD_VERSION - 1))
-  sudo ln -s /opt/compiler-explorer/gcc-$((GCC_HEAD_VERSION - 1)).1.0/bin/g++ /usr/bin/g++-$((GCC_HEAD_VERSION - 1))
-  # For CI transitions.
-  sudo /tmp/ce-infra/bin/ce_install install compilers/c++/x86/gcc $((GCC_HEAD_VERSION - 2)).1.0
-  sudo ln -s /opt/compiler-explorer/gcc-$((GCC_HEAD_VERSION - 2)).1.0/bin/gcc /usr/bin/gcc-$((GCC_HEAD_VERSION - 2))
-  sudo ln -s /opt/compiler-explorer/gcc-$((GCC_HEAD_VERSION - 2)).1.0/bin/g++ /usr/bin/g++-$((GCC_HEAD_VERSION - 2))
+
+  install_gcc $((GCC_HEAD_VERSION - 1)) # The latest release. The only supported version.
+  install_gcc $((GCC_HEAD_VERSION - 2)) # For CI transitions. Not supported anymore.
+
+  install_clang() {
+    sudo /tmp/ce-infra/bin/ce_install install compilers/c++/clang $1.1.0
+    sudo ln -s /opt/compiler-explorer/clang-$1.1.0/bin/clang   /usr/bin/clang-$1
+    sudo ln -s /opt/compiler-explorer/clang-$1.1.0/bin/clang++ /usr/bin/clang++-$1
+  }
+
+  # Trunk needs special handling due to it being a nightly build
+  sudo /tmp/ce-infra/bin/ce_install --enable nightly install compilers/c++/nightly/clang trunk
+  sudo ln -s /opt/compiler-explorer/clang-trunk/bin/clang /usr/bin/clang-$LLVM_HEAD_VERSION
+  sudo ln -s /opt/compiler-explorer/clang-trunk/bin/clang++ /usr/bin/clang++-$LLVM_HEAD_VERSION
+
+  install_clang $((LLVM_HEAD_VERSION - 1)) # Latest release
+  install_clang $((LLVM_HEAD_VERSION - 2)) # Previous release, still supported
+  install_clang $((LLVM_HEAD_VERSION - 3)) # For CI transitions. Not supported anymore.
+
   sudo rm -rf /tmp/ce-infra
 EOF
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/185168


More information about the libcxx-commits mailing list