Skip to content

Commit c02e491

Browse files
authored
Merge pull request #340 from elbeno/add-clang-22
✨ 👷 Add clang-22 build
2 parents 527d7b9 + 45ee7a2 commit c02e491

5 files changed

Lines changed: 60 additions & 32 deletions

File tree

‎.github/workflows/unit_tests.yml‎

Lines changed: 46 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ env:
1313
DEBIAN_FRONTEND: noninteractive
1414
CMAKE_GENERATOR: Ninja
1515
DEFAULT_CXX_STANDARD: 23
16-
DEFAULT_LLVM_VERSION: 21
16+
DEFAULT_LLVM_VERSION: 22
1717
DEFAULT_GCC_VERSION: 14
18-
MULL_LLVM_MAJOR_VERSION: 19
19-
MULL_LLVM_VERSION: 19.1.1
20-
MULL_VERSION: 0.27.1
18+
MULL_LLVM_MAJOR_VERSION: 20
19+
MULL_LLVM_VERSION: 20.1.2
20+
MULL_VERSION: 0.29.0
2121
HYPOTHESIS_PROFILE: default
2222

2323
concurrency:
@@ -31,7 +31,7 @@ jobs:
3131
fail-fast: false
3232
matrix:
3333
compiler: [clang, gcc]
34-
version: [12, 13, 14, 18, 19, 20, 21]
34+
version: [12, 13, 14, 18, 19, 20, 21, 22]
3535
cxx_standard: [23]
3636
stdlib: [libstdc++, libc++]
3737
build_type: [Debug]
@@ -40,62 +40,60 @@ jobs:
4040
cc: "clang"
4141
cxx: "clang++"
4242
cxx_flags: "-stdlib=libstdc++"
43+
- version: 22
44+
compiler: clang
45+
toolchain_root: "/usr/lib/llvm-22"
46+
- version: 22
47+
compiler: clang
48+
stdlib: libc++
49+
cxx_flags: "-stdlib=libc++"
4350
- version: 21
4451
compiler: clang
45-
install: sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" llvm.sh 21
4652
toolchain_root: "/usr/lib/llvm-21"
4753
- version: 21
4854
compiler: clang
4955
stdlib: libc++
50-
install: sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" llvm.sh 21 && sudo apt install -y libc++-21-dev libc++abi-21-dev
5156
cxx_flags: "-stdlib=libc++"
5257
- version: 20
5358
compiler: clang
54-
install: sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" llvm.sh 20
5559
toolchain_root: "/usr/lib/llvm-20"
5660
- version: 20
5761
compiler: clang
5862
stdlib: libc++
59-
install: sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" llvm.sh 20 && sudo apt install -y libc++-20-dev libc++abi-20-dev
6063
cxx_flags: "-stdlib=libc++"
6164
- version: 19
6265
compiler: clang
63-
install: sudo apt update && sudo apt install -y clang-19
6466
toolchain_root: "/usr/lib/llvm-19"
6567
- version: 19
6668
compiler: clang
6769
stdlib: libc++
68-
install: sudo apt update && sudo apt install -y clang-19 libc++-19-dev libc++abi-19-dev
6970
cxx_flags: "-stdlib=libc++"
7071
- version: 18
7172
compiler: clang
72-
install: sudo apt update && sudo apt install -y clang-18
7373
toolchain_root: "/usr/lib/llvm-18"
7474
- version: 18
7575
compiler: clang
7676
stdlib: libc++
77-
install: sudo apt update && sudo apt install -y clang-18 libc++-18-dev libc++abi-18-dev
7877
cxx_flags: "-stdlib=libc++"
7978
- compiler: gcc
8079
toolchain_root: "/usr"
8180
cxx_flags: ""
8281
- version: 14
8382
compiler: gcc
84-
install: sudo apt update && sudo apt install -y gcc-14 g++-14
8583
cc: "gcc-14"
8684
cxx: "g++-14"
8785
- version: 13
8886
compiler: gcc
89-
install: sudo apt update && sudo apt install -y gcc-13 g++-13
9087
cc: "gcc-13"
9188
cxx: "g++-13"
9289
- version: 12
9390
compiler: gcc
94-
install: sudo apt update && sudo apt install -y gcc-12 g++-12
9591
cc: "gcc-12"
9692
cxx: "g++-12"
9793
cxx_flags: ""
9894
exclude:
95+
- compiler: gcc
96+
version: 22
9997
- compiler: gcc
10098
version: 21
10199
- compiler: gcc
@@ -118,8 +116,14 @@ jobs:
118116

119117
- name: Install build tools
120118
run: |
121-
${{ matrix.install }}
122-
sudo apt install -y ninja-build python3-venv python3-pip
119+
if [[ "${{matrix.compiler}}" == "clang" ]]; then
120+
export DISTRO=$(lsb_release -cs)
121+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
122+
sudo add-apt-repository -y deb https://apt.llvm.org/$DISTRO/ llvm-toolchain-$DISTRO-${{matrix.version}} main
123+
sudo apt update && sudo apt install -y ninja-build clang-${{matrix.version}} libc++-${{matrix.version}}-dev libc++abi-${{matrix.version}}-dev
124+
else
125+
sudo apt update && sudo apt install -y ninja-build gcc-${{matrix.version}} g++-${{matrix.version}}
126+
fi
123127
124128
- name: Restore CPM cache
125129
env:
@@ -176,16 +180,22 @@ jobs:
176180
- name: Checkout PR branch
177181
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
178182

183+
- name: Setup python venv
184+
run: |
185+
python3 -m venv ${{github.workspace}}/test_venv
186+
source ${{github.workspace}}/test_venv/bin/activate
187+
echo "${{github.workspace}}/test_venv/bin" >> $GITHUB_PATH
188+
179189
- name: Install build tools
180190
run: |
181-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" llvm.sh ${{env.DEFAULT_LLVM_VERSION}}
182-
sudo apt install -y pipx ninja-build clang-tidy-${{env.DEFAULT_LLVM_VERSION}} clang-format-${{env.DEFAULT_LLVM_VERSION}}
191+
export DISTRO=$(lsb_release -cs)
192+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
193+
sudo add-apt-repository -y deb https://apt.llvm.org/$DISTRO/ llvm-toolchain-$DISTRO-${{env.DEFAULT_LLVM_VERSION}} main
194+
sudo apt update && sudo apt install -y ninja-build clang-tidy-${{env.DEFAULT_LLVM_VERSION}} clang-format-${{env.DEFAULT_LLVM_VERSION}}
183195
184196
- name: Install cmake-format
185197
run: |
186-
pipx install cmakelang
187-
pipx inject cmakelang pyyaml
188-
echo "/opt/pipx_bin" >> $GITHUB_PATH
198+
pip install cmakelang pyyaml
189199
190200
- name: Restore CPM cache
191201
env:
@@ -228,21 +238,25 @@ jobs:
228238
- compiler: clang
229239
cc: "clang"
230240
cxx: "clang++"
231-
install: sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" llvm.sh 21
232-
toolchain_root: "/usr/lib/llvm-21"
241+
toolchain_root: "/usr/lib/llvm-22"
233242
- compiler: gcc
234243
cc: "gcc-14"
235244
cxx: "g++-14"
236-
install: sudo apt update && sudo apt install -y gcc-14 g++-14
237245
toolchain_root: "/usr"
238246

239247
steps:
240248
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
241249

242250
- name: Install build tools
243251
run: |
244-
${{ matrix.install }}
245-
sudo apt install -y ninja-build python3-venv python3-pip
252+
if [[ "${{matrix.compiler}}" == "clang" ]]; then
253+
export DISTRO=$(lsb_release -cs)
254+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
255+
sudo add-apt-repository -y deb https://apt.llvm.org/$DISTRO/ llvm-toolchain-$DISTRO-${{env.DEFAULT_LLVM_VERSION}} main
256+
sudo apt update && sudo apt install -y ninja-build clang-${{env.DEFAULT_LLVM_VERSION}}
257+
else
258+
sudo apt update && sudo apt install -y ninja-build ${{matrix.cc}} ${{matrix.cxx}}
259+
fi
246260
247261
- name: Restore CPM cache
248262
env:
@@ -373,8 +387,10 @@ jobs:
373387

374388
- name: Install build tools
375389
run: |
376-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" llvm.sh ${{env.MULL_LLVM_MAJOR_VERSION}}
377-
sudo apt install -y ninja-build python3-venv python3-pip
390+
export DISTRO=$(lsb_release -cs)
391+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
392+
sudo add-apt-repository -y deb https://apt.llvm.org/$DISTRO/ llvm-toolchain-$DISTRO-${{env.MULL_LLVM_MAJOR_VERSION}} main
393+
sudo apt update && sudo apt install -y ninja-build clang-${{env.MULL_LLVM_MAJOR_VERSION}}
378394
379395
- name: Install mull
380396
env:

‎include/stdx/bitset.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class bitset {
4040

4141
constexpr static auto lastmask = []() -> elem_t {
4242
if constexpr (N % storage_elem_size != 0) {
43-
return allbits >> (storage_elem_size - N % storage_elem_size);
43+
return allbits >> (storage_elem_size - (N % storage_elem_size));
4444
} else {
4545
return allbits;
4646
}

‎include/stdx/rollover.hpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ template <typename T> rollover_t(T) -> rollover_t<T>;
143143
} // namespace v1
144144
} // namespace stdx
145145

146+
// NOLINTBEGIN(bugprone-std-namespace-modification)
147+
146148
template <typename T, typename U>
147149
struct std::common_type<stdx::rollover_t<T>, stdx::rollover_t<U>> {
148150
using type = stdx::rollover_t<std::common_type_t<T, U>>;
@@ -153,3 +155,5 @@ struct std::common_type<stdx::rollover_t<T>, I> {
153155
using type =
154156
stdx::rollover_t<std::common_type_t<T, std::make_unsigned_t<I>>>;
155157
};
158+
159+
// NOLINTEND(bugprone-std-namespace-modification)

‎include/stdx/tuple_destructure.hpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include <type_traits>
1010
#include <utility>
1111

12+
// NOLINTBEGIN(bugprone-std-namespace-modification)
13+
1214
template <typename... Ts>
1315
struct std::tuple_size<stdx::tuple<Ts...>>
1416
: std::integral_constant<std::size_t, sizeof...(Ts)> {};
@@ -26,4 +28,6 @@ struct std::tuple_element<I, stdx::indexed_tuple<IL, Ts...>>
2628
std::remove_cvref_t<decltype(std::declval<stdx::indexed_tuple<
2729
IL, Ts...>>()[stdx::index<I>])>> {};
2830

31+
// NOLINTEND(bugprone-std-namespace-modification)
32+
2933
#endif

‎include/stdx/utility.hpp‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ template <typename T, typename U>
148148
} else if constexpr (sizeof(T) > sizeof(U)) {
149149
return (sz * sizeof(T) / sizeof(U)) + (sizeof(T) % sizeof(U) > 0);
150150
} else {
151-
return (sz * sizeof(T) + sizeof(U) - 1) / sizeof(U);
151+
return ((sz * sizeof(T)) + sizeof(U) - 1) / sizeof(U);
152152
}
153153
}
154154
} // namespace detail
@@ -300,13 +300,17 @@ constexpr auto get(make_integer_sequence<T, N>) {
300300
} // namespace v1
301301
} // namespace stdx
302302

303+
// NOLINTBEGIN(bugprone-std-namespace-modification)
304+
303305
template <typename T, T N>
304306
struct std::tuple_size<stdx::make_integer_sequence<T, N>>
305307
: std::integral_constant<std::size_t, N> {};
306308
template <std::size_t I, typename T, T N>
307309
struct std::tuple_element<I, stdx::make_integer_sequence<T, N>>
308310
: stdx::type_identity<std::integral_constant<T, I>> {};
309311

312+
// NOLINTEND(bugprone-std-namespace-modification)
313+
310314
// NOLINTBEGIN(cppcoreguidelines-macro-usage)
311315

312316
#ifndef FWD

0 commit comments

Comments
 (0)