From d7aac3b665b61e643400cb570978077306310e13 Mon Sep 17 00:00:00 2001 From: Julio Date: Fri, 20 Nov 2026 15:02:52 +0100 Subject: [PATCH 1/3] chore: install libclang in order to avoid problems compilation problems --- .../workflows/verify-profiling-heap-sampler-bindings.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-profiling-heap-sampler-bindings.yml b/.github/workflows/verify-profiling-heap-sampler-bindings.yml index 95f30d3a1d..c03c592676 100644 --- a/.github/workflows/verify-profiling-heap-sampler-bindings.yml +++ b/.github/workflows/verify-profiling-heap-sampler-bindings.yml @@ -18,13 +18,15 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 - - name: Install libclang-dev + - name: Install libclang-dev and clang # Only this verification job needs libclang; the normal build # path for libdd-profiling-heap-sampler consumes the checked-in bindings # under `src/generated/` and does not depend on bindgen at all. + # `clang-21` is needed alongside `libclang-21-dev` so libclang can find + # clang's builtin headers (e.g. ) on ubuntu-latest. run: | sudo apt-get update - sudo apt-get install -y libclang-dev + sudo apt-get install -y libclang-21-dev clang-21 - name: Read Rust version from rust-toolchain.toml id: rust-version run: echo "version=$(grep -Po '^channel = "\K[^"]+' rust-toolchain.toml)" >> $GITHUB_OUTPUT From 28d75996eb214f8c07ba9c92258a00e6e68e1bb7 Mon Sep 17 00:00:00 2001 From: Julio Date: Fri, 20 Nov 2026 15:13:13 +0100 Subject: [PATCH 2/3] chore: point bindgen at clang-21 libclang and builtin headers Co-Authored-By: Claude Sonnet 5.5 --- .../verify-profiling-heap-sampler-bindings.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-profiling-heap-sampler-bindings.yml b/.github/workflows/verify-profiling-heap-sampler-bindings.yml index c03c592676..3fa09e6838 100644 --- a/.github/workflows/verify-profiling-heap-sampler-bindings.yml +++ b/.github/workflows/verify-profiling-heap-sampler-bindings.yml @@ -42,7 +42,16 @@ jobs: # them. We use an env var (rather than a cargo feature) so that # unrelated `--all-features` CI jobs cannot accidentally invoke # bindgen — see libdd-profiling-heap-sampler/Cargo.toml for the rationale. - run: LIBDD_PROFILING_HEAP_SAMPLER_REGEN=1 cargo build -p libdd-profiling-heap-sampler + # + # Pin libclang to the same LLVM as the installed clang and point + # bindgen at that clang's resource dir, which holds the builtin + # headers (, ...). Without this, libclang may be + # loaded from a different LLVM whose resource dir is missing, and + # `atomic_load_explicit` ends up undeclared. + run: | + export LIBCLANG_PATH=/usr/lib/llvm-21/lib + export BINDGEN_EXTRA_CLANG_ARGS="-isystem $(clang-21 -print-resource-dir)/include" + LIBDD_PROFILING_HEAP_SAMPLER_REGEN=1 cargo build -p libdd-profiling-heap-sampler - name: Verify committed bindings match regenerated output run: | if ! git diff --exit-code libdd-profiling-heap-sampler/src/generated/; then From 96c3616662ea0b27c7bcd58cbc62e57d5dd85408 Mon Sep 17 00:00:00 2001 From: Julio Date: Fri, 20 Nov 2026 15:16:21 +0100 Subject: [PATCH 3/3] chore: split assignment from export to satisfy shellcheck SC2155 Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/verify-profiling-heap-sampler-bindings.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-profiling-heap-sampler-bindings.yml b/.github/workflows/verify-profiling-heap-sampler-bindings.yml index 3fa09e6838..9d8077a6d4 100644 --- a/.github/workflows/verify-profiling-heap-sampler-bindings.yml +++ b/.github/workflows/verify-profiling-heap-sampler-bindings.yml @@ -50,7 +50,8 @@ jobs: # `atomic_load_explicit` ends up undeclared. run: | export LIBCLANG_PATH=/usr/lib/llvm-21/lib - export BINDGEN_EXTRA_CLANG_ARGS="-isystem $(clang-21 -print-resource-dir)/include" + resource_dir="$(clang-21 -print-resource-dir)" + export BINDGEN_EXTRA_CLANG_ARGS="-isystem ${resource_dir}/include" LIBDD_PROFILING_HEAP_SAMPLER_REGEN=1 cargo build -p libdd-profiling-heap-sampler - name: Verify committed bindings match regenerated output run: |