From 6123b85822ea02fdf19024c3c2218b71d9e5b45b Mon Sep 17 00:00:00 2001 From: Sergey Kuznetsov Date: Thu, 12 Feb 2026 13:40:57 +0000 Subject: [PATCH 1/2] Add ubuntu clang 21 and install clang-tidy in clang images --- .github/workflows/tools-rippled.yml | 2 ++ .github/workflows/ubuntu.yml | 3 +++ docker/ubuntu/Dockerfile | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/.github/workflows/tools-rippled.yml b/.github/workflows/tools-rippled.yml index a535b48..da3daa3 100644 --- a/.github/workflows/tools-rippled.yml +++ b/.github/workflows/tools-rippled.yml @@ -98,6 +98,7 @@ jobs: DOXYGEN_VERSION=${{ env.DOXYGEN_VERSION }} GCC_VERSION=${{ env.GCC_VERSION }} GRAPHVIZ_VERSION=${{ env.GRAPHVIZ_VERSION }} + LLVM_VERSION=${{ env.LLVM_VERSION }} PRE_COMMIT_VERSION=${{ env.PRE_COMMIT_VERSION }} context: docker/tools-rippled outputs: type=image,name=${{ env.CONTAINER_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ env.PUSH }} @@ -127,6 +128,7 @@ jobs: strategy: matrix: tool: + - clang-tidy - documentation - pre-commit - signing diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 7cc1506..f3115b6 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -73,6 +73,9 @@ jobs: - release: noble compiler_name: clang compiler_version: 20 + - release: noble + compiler_name: clang + compiler_version: 21 runs-on: ${{ matrix.architecture.runner }} permissions: packages: write diff --git a/docker/ubuntu/Dockerfile b/docker/ubuntu/Dockerfile index 8730e05..644843c 100644 --- a/docker/ubuntu/Dockerfile +++ b/docker/ubuntu/Dockerfile @@ -227,11 +227,25 @@ printf "%s\n" \ "Acquire::AllowInsecureRepositories \"true\";" \ "Acquire::AllowWeakRepositories \"true\";" \ | tee /etc/apt/apt.conf.d/99llvm-allow-weak + +# Add LLVM repository for versions above 20 +if [[ "${CLANG_VERSION}" -gt 20 ]]; then + apt-get update + 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) + 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 clean + rm -rf /var/lib/apt/lists/* +fi + apt-get update 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 @@ -245,6 +259,10 @@ 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 05320e481cc0c9c400acb2b8700223788fc02594 Mon Sep 17 00:00:00 2001 From: Sergey Kuznetsov Date: Thu, 12 Feb 2026 14:59:05 +0000 Subject: [PATCH 2/2] Fix review comments --- .github/workflows/tools-rippled.yml | 2 -- docker/ubuntu/Dockerfile | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tools-rippled.yml b/.github/workflows/tools-rippled.yml index da3daa3..a535b48 100644 --- a/.github/workflows/tools-rippled.yml +++ b/.github/workflows/tools-rippled.yml @@ -98,7 +98,6 @@ jobs: DOXYGEN_VERSION=${{ env.DOXYGEN_VERSION }} GCC_VERSION=${{ env.GCC_VERSION }} GRAPHVIZ_VERSION=${{ env.GRAPHVIZ_VERSION }} - LLVM_VERSION=${{ env.LLVM_VERSION }} PRE_COMMIT_VERSION=${{ env.PRE_COMMIT_VERSION }} context: docker/tools-rippled outputs: type=image,name=${{ env.CONTAINER_IMAGE }},push-by-digest=true,name-canonical=true,push=${{ env.PUSH }} @@ -128,7 +127,6 @@ jobs: strategy: matrix: tool: - - clang-tidy - documentation - pre-commit - signing diff --git a/docker/ubuntu/Dockerfile b/docker/ubuntu/Dockerfile index 644843c..598c25a 100644 --- a/docker/ubuntu/Dockerfile +++ b/docker/ubuntu/Dockerfile @@ -228,7 +228,7 @@ printf "%s\n" \ "Acquire::AllowWeakRepositories \"true\";" \ | tee /etc/apt/apt.conf.d/99llvm-allow-weak -# Add LLVM repository for versions above 20 +# Add LLVM repository for versions above 20 because it is not available in the default repo if [[ "${CLANG_VERSION}" -gt 20 ]]; then apt-get update apt-get install -y --no-install-recommends lsb-release software-properties-common gnupg