From b992d58ec1d5a0b3639f66027098e443cb0dcd41 Mon Sep 17 00:00:00 2001 From: Sergey Kuznetsov Date: Thu, 12 Feb 2026 17:18:57 +0000 Subject: [PATCH 1/2] Install clang-tidy only for clang-21 image --- .github/workflows/ubuntu.yml | 3 +++ docker/ubuntu/Dockerfile | 12 +++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index f3115b6..a96b5ed 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -186,6 +186,9 @@ jobs: - release: noble compiler_name: clang compiler_version: 20 + - release: noble + compiler_name: clang + compiler_version: 21 runs-on: ubuntu-24.04 needs: - build diff --git a/docker/ubuntu/Dockerfile b/docker/ubuntu/Dockerfile index 598c25a..d297ba6 100644 --- a/docker/ubuntu/Dockerfile +++ b/docker/ubuntu/Dockerfile @@ -236,6 +236,13 @@ if [[ "${CLANG_VERSION}" -gt 20 ]]; then DISTRO_CODENAME=$(lsb_release -cs) echo "deb http://apt.llvm.org/${DISTRO_CODENAME}/ llvm-toolchain-${DISTRO_CODENAME}-${CLANG_VERSION} main" \ | tee /etc/apt/sources.list.d/llvm.list + apt-get update + apt-get install -y --no-install-recommends --allow-unauthenticated \ + clang-tidy-${CLANG_VERSION} + update-alternatives \ + --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-${CLANG_VERSION} 100 + update-alternatives \ + --install /usr/bin/run-clang-tidy run-clang-tidy /usr/bin/run-clang-tidy-${CLANG_VERSION} 100 apt-get clean rm -rf /var/lib/apt/lists/* fi @@ -245,7 +252,6 @@ apt-get install -y --no-install-recommends --allow-unauthenticated \ clang-${CLANG_VERSION} \ libclang-rt-${CLANG_VERSION}-dev \ llvm-${CLANG_VERSION} \ - clang-tidy-${CLANG_VERSION} \ gcc \ g++ apt-get clean @@ -259,10 +265,6 @@ update-alternatives \ --slave /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION} update-alternatives \ --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-${CLANG_VERSION} 100 -update-alternatives \ - --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-${CLANG_VERSION} 100 -update-alternatives \ - --install /usr/bin/run-clang-tidy run-clang-tidy /usr/bin/run-clang-tidy-${CLANG_VERSION} 100 update-alternatives --auto cc update-alternatives --auto c++ update-alternatives --auto clang From eebc20c04908b6fcc133ed66e37127e3e435a81a Mon Sep 17 00:00:00 2001 From: Sergey Kuznetsov Date: Fri, 13 Feb 2026 13:45:55 +0000 Subject: [PATCH 2/2] Install clang-tidy only for the version 21 --- docker/ubuntu/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/ubuntu/Dockerfile b/docker/ubuntu/Dockerfile index d297ba6..b668a6f 100644 --- a/docker/ubuntu/Dockerfile +++ b/docker/ubuntu/Dockerfile @@ -228,9 +228,9 @@ printf "%s\n" \ "Acquire::AllowWeakRepositories \"true\";" \ | tee /etc/apt/apt.conf.d/99llvm-allow-weak -# Add LLVM repository for versions above 20 because it is not available in the default repo -if [[ "${CLANG_VERSION}" -gt 20 ]]; then +if [[ "${CLANG_VERSION}" -eq 21 ]]; then apt-get update + # Add LLVM repository for versions above 20 because it is not available in the default repo apt-get install -y --no-install-recommends lsb-release software-properties-common gnupg wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - DISTRO_CODENAME=$(lsb_release -cs)