Skip to content

Commit dc7ed6e

Browse files
Updated clang toolset to version 18 (WIP)
GitHub Actions workets now use 'ubuntu-24.04' image that have more recent toolsets as a part of standard distribution. 'apt.llvm.org' package repository is no longer used for 'clang'. 'ppa:ubuntu-toolchain-r/test' repository is no longer used for 'gcc'.
1 parent 5bfdf6d commit dc7ed6e

5 files changed

Lines changed: 56 additions & 65 deletions

File tree

.github/workflows/cmake.yml

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616

1717
jobs:
1818
formatting-check:
19-
runs-on: ubuntu-22.04
19+
runs-on: ubuntu-24.04
2020
name: Formatting checks
2121
steps:
2222
- name: Cheking out source tree
@@ -37,24 +37,22 @@ jobs:
3737

3838
- name: Install dependencies on ubuntu
3939
run: |
40-
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
41-
echo deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main | sudo tee /etc/apt/sources.list.d/llvm.list
4240
sudo apt-get update
43-
sudo apt-get install clang-format-17
41+
sudo apt-get install clang-format-18
4442
4543
- name: Info Clang Format
46-
run: clang-format-17 --version
44+
run: clang-format-18 --version
4745

48-
- name: Check formatting with git clang-format-17
46+
- name: Check formatting with git clang-format-18
4947
working-directory: ${{github.workspace}}/src
50-
run: git clang-format-17 --diff --binary=clang-format-17 HEAD~
48+
run: git clang-format-18 --diff --binary=clang-format-18 HEAD~
5149

5250
build:
5351
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
5452
# You can convert this to a matrix build if you need cross-platform coverage.
5553
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
5654
name: ${{ matrix.config.name }}
57-
runs-on: ubuntu-22.04
55+
runs-on: ubuntu-24.04
5856
strategy:
5957
fail-fast: false
6058
matrix:
@@ -76,24 +74,20 @@ jobs:
7674
mtr_options: "--sanitize"
7775
}
7876
- {
79-
name: "Clang 17 Debug",
80-
label: "debug_clang17",
77+
name: "Clang 18 Debug",
78+
label: "debug_clang18",
8179
run_clang_tidy: true
8280
}
8381
- {
84-
name: "Clang 17 RelWithDebInfo",
85-
label: "release_clang17",
82+
name: "Clang 18 RelWithDebInfo",
83+
label: "release_clang18",
8684
run_clang_tidy: true
8785
}
8886
- {
89-
name: "Clang 17 ASan",
90-
label: "asan_clang17"
91-
# TODO: re-enable running MTR under "Clang 17 ASan"
92-
# run_mtr: true,
93-
# mtr_options: "--sanitize"
94-
# when "-stdlib=libc++ -fsanitize=address" alloc-dealloc-mismatch issue is fixed
95-
# (https://github.com/llvm/llvm-project/issues/59432)
96-
# or CI is upgraded to Clang 18
87+
name: "Clang 18 ASan",
88+
label: "asan_clang18",
89+
run_mtr: true,
90+
mtr_options: "--sanitize"
9791
}
9892

9993
steps:
@@ -128,15 +122,12 @@ jobs:
128122
- name: Install Clang dependencies on ubuntu
129123
if: startsWith(matrix.config.name, 'Clang')
130124
run: |
131-
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
132-
echo deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main | sudo tee /etc/apt/sources.list.d/llvm.list
133125
sudo apt-get update
134-
sudo apt-get install clang-17 lld-17 clang-tidy-17 libc++-17-dev libc++1-17 libc++abi-17-dev libc++abi1-17
126+
sudo apt-get install clang-18 lld-18 clang-tidy-18 libc++-18-dev libc++1-18 libc++abi-18-dev libc++abi1-18
135127
136128
- name: Install GCC dependencies on ubuntu
137129
if: startsWith(matrix.config.name, 'GCC')
138130
run: |
139-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
140131
sudo apt-get update
141132
sudo apt-get install g++-13
142133
@@ -157,7 +148,7 @@ jobs:
157148
id: cache-boost-static-libraries
158149
uses: actions/cache@v4
159150
with:
160-
path: ${{github.workspace}}/boost-install-${{matrix.config.label}}
151+
path ${{github.workspace}}/boost-install-${{matrix.config.label}}
161152
key: ${{format('boost-static-libraries-{0}-{1}-{2}-{3}', env.BOOST_MAJOR, env.BOOST_MINOR, env.BOOST_PATCH, matrix.config.label)}}
162153

163154
- name: Checking out Boost source tree
@@ -239,12 +230,12 @@ jobs:
239230

240231
- name: Info Clang Tidy
241232
if: matrix.config.run_clang_tidy
242-
run: clang-tidy-17 --version
233+
run: clang-tidy-18 --version
243234

244235
- name: Clang Tidy
245236
if: matrix.config.run_clang_tidy
246237
# Run Clang Tidy
247-
run: run-clang-tidy-17 -header-filter=.* -j=${{steps.cpu-cores.outputs.count}} -use-color -p=${{github.workspace}}/src-build-${{matrix.config.label}}
238+
run: run-clang-tidy-18 -header-filter=.* -j=${{steps.cpu-cores.outputs.count}} -use-color -p=${{github.workspace}}/src-build-${{matrix.config.label}}
248239

249240
- name: MTR tests
250241
if: matrix.config.run_mtr

CMakePresets.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@
5151
}
5252
},
5353
{
54-
"name": "clang17_hidden",
54+
"name": "clang18_hidden",
5555
"hidden": true,
5656
"cacheVariables": {
57-
"CMAKE_C_COMPILER": "clang-17",
58-
"CMAKE_CXX_COMPILER": "clang++-17",
57+
"CMAKE_C_COMPILER": "clang-18",
58+
"CMAKE_CXX_COMPILER": "clang++-18",
5959
"WITH_STDLIB_LIBCXX": "ON"
6060
}
6161
},
@@ -89,31 +89,31 @@
8989
},
9090

9191
{
92-
"name": "debug_clang17",
92+
"name": "debug_clang18",
9393
"inherits": [
9494
"common_hidden",
9595
"debug_hidden",
96-
"clang17_hidden"
96+
"clang18_hidden"
9797
],
98-
"displayName": "Clang 17 Debug"
98+
"displayName": "Clang 18 Debug"
9999
},
100100
{
101-
"name": "release_clang17",
101+
"name": "release_clang18",
102102
"inherits": [
103103
"common_hidden",
104104
"release_hidden",
105-
"clang17_hidden"
105+
"clang18_hidden"
106106
],
107-
"displayName": "Clang 17 RelWithDebInfo"
107+
"displayName": "Clang 18 RelWithDebInfo"
108108
},
109109
{
110-
"name": "asan_clang17",
110+
"name": "asan_clang18",
111111
"inherits": [
112112
"common_hidden",
113113
"asan_hidden",
114-
"clang17_hidden"
114+
"clang18_hidden"
115115
],
116-
"displayName": "Clang 17 ASan"
116+
"displayName": "Clang 18 ASan"
117117
}
118118
]
119119
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Currently prebuilt binaries are not available.
1515
#### Dependencies
1616

1717
- [CMake](https://cmake.org/) 3.20.0+
18-
- [Clang](https://clang.llvm.org/) (`clang-15` / `clang-16` / `clang-17`) or [GCC](https://gcc.gnu.org/) (`gcc-12` / `gcc-13` / `gcc-14`)
18+
- [Clang](https://clang.llvm.org/) (`clang-15` .. `clang-18`) or [GCC](https://gcc.gnu.org/) (`gcc-12` .. `gcc-14`)
1919
- [Boost libraries](https://www.boost.org/) 1.88.0 (git version, not the source tarball)
2020
- [MySQL client library](https://dev.mysql.com/doc/c-api/8.0/en/) 8.0.x (`libmysqlclient`)
2121
- [CURL library](https://curl.se/libcurl/) (`libcurl`) 8.6.0+
@@ -44,7 +44,7 @@ Define `BUILD_PRESET` depending on whether you want to build in `Debug`, `Releas
4444
export BUILD_PRESET=<configuration>_<toolset>
4545
```
4646
The supported values for `<configuration>` are `debug`, `release`, and `asan`.
47-
The supported values for `<toolset>` are `gcc13` and `clang17`.
47+
The supported values for `<toolset>` are `gcc13` and `clang18`.
4848

4949
For instance, if you want to build in `RelWithDebInfo` configuration using `GCC 13`, please specify
5050
```bash

extra/cmake_presets/aws-sdk-cpp/CMakePresets.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@
5555
}
5656
},
5757
{
58-
"name": "clang17_hidden",
58+
"name": "clang18_hidden",
5959
"hidden": true,
6060
"cacheVariables": {
61-
"CMAKE_C_COMPILER": "clang-17",
62-
"CMAKE_CXX_COMPILER": "clang++-17",
61+
"CMAKE_C_COMPILER": "clang-18",
62+
"CMAKE_CXX_COMPILER": "clang++-18",
6363
"CMAKE_CXX_FLAGS_INIT": "-stdlib=libc++"
6464
}
6565
},
@@ -93,31 +93,31 @@
9393
},
9494

9595
{
96-
"name": "debug_clang17",
96+
"name": "debug_clang18",
9797
"inherits": [
9898
"common_hidden",
9999
"debug_hidden",
100-
"clang17_hidden"
100+
"clang18_hidden"
101101
],
102-
"displayName": "Clang 17 Debug"
102+
"displayName": "Clang 18 Debug"
103103
},
104104
{
105-
"name": "release_clang17",
105+
"name": "release_clang18",
106106
"inherits": [
107107
"common_hidden",
108108
"release_hidden",
109-
"clang17_hidden"
109+
"clang18_hidden"
110110
],
111-
"displayName": "Clang 17 RelWithDebInfo"
111+
"displayName": "Clang 18 RelWithDebInfo"
112112
},
113113
{
114-
"name": "asan_clang17",
114+
"name": "asan_clang18",
115115
"inherits": [
116116
"common_hidden",
117117
"asan_hidden",
118-
"clang17_hidden"
118+
"clang18_hidden"
119119
],
120-
"displayName": "Clang 17 ASan"
120+
"displayName": "Clang 18 ASan"
121121
}
122122
]
123123
}

extra/cmake_presets/boost/CMakePresets.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@
5353
}
5454
},
5555
{
56-
"name": "clang17_hidden",
56+
"name": "clang18_hidden",
5757
"hidden": true,
5858
"cacheVariables": {
59-
"CMAKE_C_COMPILER": "clang-17",
60-
"CMAKE_CXX_COMPILER": "clang++-17"
59+
"CMAKE_C_COMPILER": "clang-18",
60+
"CMAKE_CXX_COMPILER": "clang++-18"
6161
},
6262
"environment": {
6363
"STDLIB_FLAGS": "-stdlib=libc++"
@@ -93,31 +93,31 @@
9393
},
9494

9595
{
96-
"name": "debug_clang17",
96+
"name": "debug_clang18",
9797
"inherits": [
9898
"common_hidden",
9999
"debug_hidden",
100-
"clang17_hidden"
100+
"clang18_hidden"
101101
],
102-
"displayName": "Clang 17 Debug"
102+
"displayName": "Clang 18 Debug"
103103
},
104104
{
105-
"name": "release_clang17",
105+
"name": "release_clang18",
106106
"inherits": [
107107
"common_hidden",
108108
"release_hidden",
109-
"clang17_hidden"
109+
"clang18_hidden"
110110
],
111-
"displayName": "Clang 17 RelWithDebInfo"
111+
"displayName": "Clang 18 RelWithDebInfo"
112112
},
113113
{
114-
"name": "asan_clang17",
114+
"name": "asan_clang18",
115115
"inherits": [
116116
"common_hidden",
117117
"asan_hidden",
118-
"clang17_hidden"
118+
"clang18_hidden"
119119
],
120-
"displayName": "Clang 17 ASan"
120+
"displayName": "Clang 18 ASan"
121121
}
122122
]
123123
}

0 commit comments

Comments
 (0)