]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Upgrade clang to 19 in our CI
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 14 Mar 2025 13:17:57 +0000 (14:17 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 17 Mar 2025 10:36:00 +0000 (11:36 +0100)
To get rid of the `WARNING: Symbolizer buffer too small` warning,
which is caused by big backtraces, and fixed in clang >= 15 by
using a dynamic symbolizer buffer size.
I only upgrade it for dnsdist because of a compatibility issue between
`libfaketime` and the ASAN implementation in recent versions of `clang`:

https://github.com/wolfcw/libfaketime/issues/365

It seems to be fixed in the `libfaketime` repository. There has not
been any release since the fix, but I guess we could compile from
a more recent commit.

.github/workflows/build-and-test-all.yml
tasks.py

index 71ac5f9e814bceffe86dbe5b645eb2078fba5b2e..65b361b432b1ca2e39873af3c36d713d144415b5 100644 (file)
@@ -234,6 +234,7 @@ jobs:
     container:
       image: "${{ needs.get-runner-container-image.outputs.id }}:${{ needs.get-runner-container-image.outputs.tag }}"
       env:
+        CLANG_VERSION: '19'
         SANITIZERS: ${{ matrix.sanitizers }}
         UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1:suppressions=${{ env.REPO_HOME }}/build-scripts/UBSan.supp"
         UNIT_TESTS: yes
@@ -267,6 +268,8 @@ jobs:
           python3 -m venv ${REPO_HOME}/.venv
           . ${REPO_HOME}/.venv/bin/activate && pip install -r ${REPO_HOME}/meson/requirements.txt
         working-directory: .
+      - run: ${{ env.INV_CMD }} install-clang
+        working-directory: .
       - run: ${{ env.INV_CMD }} install-lld-linker-if-needed
         working-directory: ./pdns/dnsdistdist/
       - run: ${{ env.INV_CMD }} ci-install-rust ${{ env.REPO_HOME }}
@@ -765,6 +768,7 @@ jobs:
     container:
       image: "${{ needs.get-runner-container-image.outputs.id }}:${{ needs.get-runner-container-image.outputs.tag }}"
       env:
+        CLANG_VERSION: '19'
         UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1:suppressions=${{ env.REPO_HOME }}/build-scripts/UBSan.supp"
         # Disabling (intercept_send=0) the custom send wrappers for ASAN and TSAN because they cause the tools to report a race that doesn't exist on actual implementations of send(), see https://github.com/google/sanitizers/issues/1498
         ASAN_OPTIONS: intercept_send=0
index e9de54902665ff161a4b39c8bc93f6d906dbe73a..f4bf4abd3682a1b9dcf7891b47a8b8ee632cedff 100644 (file)
--- a/tasks.py
+++ b/tasks.py
@@ -178,7 +178,10 @@ def install_clang(c):
     """
     install clang and llvm
     """
-    c.sudo(f'apt-get -y --no-install-recommends install clang-{clang_version} llvm-{clang_version}')
+    if int(clang_version) >= 14:
+        c.sudo(f'apt-get -y --no-install-recommends install clang-{clang_version} llvm-{clang_version} llvm-{clang_version}-dev libclang-rt-{clang_version}-dev')
+    else:
+        c.sudo(f'apt-get -y --no-install-recommends install clang-{clang_version} llvm-{clang_version} llvm-{clang_version}-dev')
 
 @task
 def install_clang_tidy_tools(c):
@@ -187,7 +190,10 @@ def install_clang_tidy_tools(c):
 @task
 def install_clang_runtime(c):
     # this gives us the symbolizer, for symbols in asan/ubsan traces
-    c.sudo(f'apt-get -y --no-install-recommends install clang-{clang_version}')
+    # on Debian we need llvm-symbolizer-XX
+    #c.sudo(f'apt-get -y --no-install-recommends install llvm-symbolizer-{clang_version}')
+    # on Ubuntu we need llvm-XX instead
+    c.sudo(f'apt-get -y --no-install-recommends install llvm-{clang_version}')
 
 @task
 def ci_install_rust(c, repo):