Skip to content

Commit 51d0859

Browse files
Use clang 21 in CI.
1 parent 9feb73c commit 51d0859

File tree

3 files changed

+58
-43
lines changed

3 files changed

+58
-43
lines changed

.circleci/config.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ jobs:
5151
- image: ubuntu:25.04
5252
resource_class: arm.medium
5353
environment:
54-
CC: clang-20
55-
CXX: clang++-20
54+
CC: clang-21
55+
CXX: clang++-21
5656
steps:
5757
- run: |
5858
apt-get update --quiet=2 || apt-get update --quiet=2 || apt-get update --quiet=2
@@ -62,14 +62,16 @@ jobs:
6262
export REPO_HTTPS=`echo "$CIRCLE_REPOSITORY_URL" | sed "s|[email protected]:|https://github.com/|g"`
6363
git clone -b "$CIRCLE_BRANCH" "$REPO_HTTPS" . --depth=1
6464
- run: |
65-
sudo apt-get install -y gnupg wget # Only needed in container.
65+
sudo apt-get install -y wget software-properties-common # Only needed in container.
6666
sudo apt-get install -y gcc-15 g++-15
6767
sudo apt-get install -y cmake
6868
sudo apt-get install -y hwloc libhwloc-dev
69+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
70+
sudo apt-add-repository -y 'deb https://apt.llvm.org/plucky/ llvm-toolchain-plucky-21 main'
6971
# tzdata is required by clang and has to be installed carefully to avoid user prompts stalling the script.
70-
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
71-
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends tzdata
72-
sudo apt-get install -y clang-20
72+
#ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
73+
#DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends tzdata
74+
sudo apt-get install -y clang-21
7375
- run: |
7476
mkdir build
7577
cd build
@@ -95,8 +97,8 @@ jobs:
9597
- image: ubuntu:25.04
9698
resource_class: arm.medium
9799
environment:
98-
CC: clang-20
99-
CXX: clang++-20
100+
CC: clang-21
101+
CXX: clang++-21
100102
CFLAGS: "-fsanitize=<< parameters.sanitizer >> -fno-sanitize-recover=all"
101103
CXXFLAGS: "-fsanitize=<< parameters.sanitizer >> -fno-sanitize-recover=all"
102104
LDFLAGS: "-fsanitize=<< parameters.sanitizer >> -fno-sanitize-recover=all"
@@ -111,14 +113,16 @@ jobs:
111113
export REPO_HTTPS=`echo "$CIRCLE_REPOSITORY_URL" | sed "s|[email protected]:|https://github.com/|g"`
112114
git clone -b "$CIRCLE_BRANCH" "$REPO_HTTPS" . --depth=1
113115
- run: |
114-
sudo apt-get install -y gnupg wget # Only needed in container.
116+
sudo apt-get install -y wget software-properties-common # Only needed in container.
115117
sudo apt-get install -y gcc-15 g++-15
116118
sudo apt-get install -y cmake
117119
sudo apt-get install -y hwloc libhwloc-dev
120+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
121+
sudo apt-add-repository -y 'deb https://apt.llvm.org/plucky/ llvm-toolchain-plucky-21 main'
118122
# tzdata is required by clang and has to be installed carefully to avoid user prompts stalling the script.
119-
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
120-
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends tzdata
121-
sudo apt-get install -y clang-20
123+
#ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
124+
#DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends tzdata
125+
sudo apt-get install -y clang-21
122126
- run: |
123127
mkdir build
124128
cd build

.github/workflows/CI.yml

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ jobs:
4444

4545
linux-clang:
4646
runs-on: ubuntu-24.04
47+
container: ubuntu:25.04
4748
continue-on-error: true
4849
strategy:
4950
matrix:
50-
clang_version: [14, 15, 16, 17, 18, 19]
51+
clang_version: [14, 15, 16, 17, 18, 19, 20]
5152
scheduler: [nemesis, sherwood, distrib]
5253
topology: [hwloc, binders, no]
5354
include:
@@ -63,18 +64,26 @@ jobs:
6364
gcc_version: 13
6465
- clang_version: 19
6566
gcc_version: 14
67+
- clang_version: 20
68+
gcc_version: 15
6669
env:
6770
CC: clang-${{ matrix.clang_version }}
6871
CXX: clang++-${{ matrix.clang_version }}
6972
steps:
7073
- uses: actions/checkout@v4
74+
- name: container prerequisites
75+
run: |
76+
# some additional setup steps are only needed when running in a container.
77+
# These end up being no-ops in the github actions images.
78+
apt-get update
79+
apt-get install -y sudo wget software-properties-common cmake
7180
- name: install gcc
72-
run: sudo apt-get install gcc-${{ matrix.gcc_version }} g++-${{ matrix.gcc_version }}
81+
run: sudo apt-get install -y gcc-${{ matrix.gcc_version }} g++-${{ matrix.gcc_version }}
7382
- name: install clang
74-
run: sudo apt-get install clang-${{ matrix.clang_version }}
83+
run: sudo apt-get install -y clang-${{ matrix.clang_version }}
7584
- if: ${{ matrix.topology != 'no' }}
7685
run: |
77-
sudo apt-get install hwloc libhwloc-dev
86+
sudo apt-get install -y hwloc libhwloc-dev
7887
hwloc-ls --version
7988
- name: build qthreads
8089
run: |
@@ -281,30 +290,31 @@ jobs:
281290
- sanitizer: thread
282291
topology: binders
283292
env:
284-
CC: clang-20
285-
CXX: clang++-20
293+
CC: clang-21
294+
CXX: clang++-21
286295
CFLAGS: "-fsanitize=${{ matrix.sanitizer }} -fno-sanitize-recover=all"
287296
CXXFLAGS: ${{ matrix.use_libcxx && format('-stdlib=libc++ -fsanitize={0} -fno-sanitize-recover=all', matrix.sanitizer) || format('-fsanitize={0} -fno-sanitize-recover=all', matrix.sanitizer) }}
288297
LDFLAGS: "-fsanitize=${{ matrix.sanitizer }} -fno-sanitize-recover=all"
289298
QTHREAD_STACK_SIZE: 2097152
290299
ASAN_OPTIONS: "check_initialization_order=1"
291300
steps:
292301
- uses: actions/checkout@v4
293-
- if: ${{ ! matrix.use_libcxx }}
302+
- name: container prerequisites
294303
run: |
304+
# some additional setup steps are only needed when running in a container.
305+
# These end up being no-ops in the github actions images.
295306
apt-get update
296-
apt-get install -y sudo # Updating and installing sudo is only neccesary in a container.
297-
# Installing sudo is just so that the later commands using sudo can be the same whether in a container or not.
307+
apt-get install -y sudo wget software-properties-common cmake
308+
- if: ${{ ! matrix.use_libcxx }}
309+
run: |
298310
sudo apt-get install -y gcc-15 g++-15
299-
sudo apt-get install -y cmake # Only needed in a container. Cmake is installed by default on VM images.
300311
- name: install compiler
301312
run: |
302-
sudo apt-get install -y software-properties-common # Only needed in container.
303-
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - && break || sleep 1
304-
sudo apt-add-repository 'deb https://apt.llvm.org/oracular/ llvm-toolchain-oracular-20 main' && break || sleep 1
305-
sudo apt-get install -y clang-20
313+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
314+
sudo apt-add-repository 'deb https://apt.llvm.org/plucky/ llvm-toolchain-plucky-21 main' && break || sleep 1
315+
sudo apt-get install -y clang-21
306316
- if: ${{ matrix.use_libcxx }}
307-
run: sudo apt-get install -y libc++-20-dev libc++abi-20-dev
317+
run: sudo apt-get install -y libc++-21-dev libc++abi-21-dev
308318
- if: ${{ matrix.topology != 'no' }}
309319
run: |
310320
sudo apt-get install -y hwloc libhwloc-dev
@@ -337,26 +347,27 @@ jobs:
337347
- compiler: gcc
338348
use_libcxx: true
339349
env:
340-
CC: ${{ matrix.compiler == 'gcc' && 'gcc-15' || 'clang-20' }}
341-
CXX: ${{ matrix.compiler == 'gcc' && 'g++-15' || 'clang++-20' }}
350+
CC: ${{ matrix.compiler == 'gcc' && 'gcc-15' || 'clang-21' }}
351+
CXX: ${{ matrix.compiler == 'gcc' && 'g++-15' || 'clang++-21' }}
342352
CXXFLAGS: ${{ matrix.use_libcxx && '-stdlib=libc++' || '' }}
343353
QTHREADS_ENABLE_ASSERTS: ${{ matrix.use_asserts && '--enable-asserts' || '' }}
344354
steps:
345355
- uses: actions/checkout@v4
346-
- run: |
356+
- name: container prerequisites
357+
run: |
358+
# some additional setup steps are only needed when running in a container.
359+
# These end up being no-ops in the github actions images.
347360
apt-get update
348-
apt-get install -y sudo # Updating and installing sudo is only neccesary in a container.
349-
# Installing sudo is just so that the later commands using sudo can be the same whether in a container or not.
361+
apt-get install -y sudo wget software-properties-common cmake
362+
- run: |
350363
sudo apt-get install -y gcc-15 g++-15
351-
sudo apt-get install -y cmake # Only needed in a container. Cmake is installed by default on VM images.
352364
- if: ${{ matrix.compiler == 'clang' }}
353365
run: |
354-
sudo apt-get install -y software-properties-common # Only needed in container.
355-
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - && break || sleep 1
356-
sudo apt-add-repository 'deb https://apt.llvm.org/oracular/ llvm-toolchain-oracular-20 main' && break || sleep 1
357-
sudo apt-get install -y clang-20
366+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
367+
sudo apt-add-repository 'deb https://apt.llvm.org/plucky/ llvm-toolchain-plucky-21 main' && break || sleep 1
368+
sudo apt-get install -y clang-21
358369
- if: ${{ matrix.use_libcxx }}
359-
run: sudo apt-get install -y libc++-20-dev libc++abi-20-dev
370+
run: sudo apt-get install -y libc++-21-dev libc++abi-21-dev
360371
- if: ${{ matrix.topology != 'no' }}
361372
run: |
362373
sudo apt-get install -y hwloc libhwloc-dev
@@ -377,14 +388,14 @@ jobs:
377388
runs-on: ubuntu-24.04
378389
continue-on-error: true
379390
env:
380-
CC: 'clang-20'
381-
CXX: 'clang++-20'
391+
CC: 'clang-21'
392+
CXX: 'clang++-21'
382393
steps:
383394
- uses: actions/checkout@v4
384395
- run: |
385396
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - && break || sleep 1
386-
sudo apt-add-repository 'deb https://apt.llvm.org/noble/ llvm-toolchain-noble-20 main' && break || sleep 1
387-
sudo apt-get install clang-format-20
397+
sudo apt-add-repository 'deb https://apt.llvm.org/noble/ llvm-toolchain-noble-21 main' && break || sleep 1
398+
sudo apt-get install clang-format-21
388399
- name: check formatting
389400
run: |
390401
clang-format --version

clang-format.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
find -iname *.h -or -iname *.c -or -iname *.hpp -or -iname *.cpp | xargs clang-format-20 -i
1+
find -iname *.h -or -iname *.c -or -iname *.hpp -or -iname *.cpp | xargs clang-format-21 -i

0 commit comments

Comments
 (0)