Skip to content

Commit 7f4d30e

Browse files
committed
chore: support clang-18 and ubuntu-24.04
These changes make Proxy-Wasm build cleanly with clang-18 and pass clang-tidy-18 checks. Signed-off-by: Matt Leon <[email protected]>
1 parent 59cb7c6 commit 7f4d30e

File tree

7 files changed

+41
-37
lines changed

7 files changed

+41
-37
lines changed

.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ build --action_env=PATH
1010
build:clang --action_env=BAZEL_COMPILER=clang
1111
build:clang --action_env=CC=clang
1212
build:clang --action_env=CXX=clang++
13+
build:clang --copt -Wno-pragma-once-outside-header --cxxopt -Wno-pragma-once-outside-header
1314

1415
# Common flags for Clang sanitizers.
1516
build:clang-xsan --config=clang

.clang-tidy

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,38 @@
11
Checks: clang-*,
2+
-clang-analyzer-core.CallAndMessage,
23
-clang-analyzer-optin.portability.UnixAPI,
34
-clang-analyzer-unix.Malloc,
45
-clang-diagnostic-pragma-once-outside-header,
6+
-clang-diagnostic-builtin-macro-redefined,
57
cppcoreguidelines-pro-type-member-init,
68
cppcoreguidelines-pro-type-static-cast-downcast,
79
misc-*,
810
-misc-non-private-member-variables-in-classes,
11+
-misc-use-anonymous-namespace,
12+
-misc-const-correctness,
13+
-misc-include-cleaner,
14+
-misc-unused-parameters,
915
modernize-*,
1016
-modernize-avoid-c-arrays,
1117
-modernize-use-trailing-return-type,
18+
-modernize-return-braced-init-list,
19+
-modernize-use-default-member-init,
20+
-modernize-type-traits,
21+
-modernize-use-emplace,
1222
llvm-include-order,
1323
performance-*,
1424
-performance-no-int-to-ptr,
25+
-performance-avoid-endl,
1526
portability-*,
1627
readability-*,
1728
-readability-convert-member-functions-to-static,
1829
-readability-function-cognitive-complexity,
1930
-readability-magic-numbers,
2031
-readability-make-member-function-const,
2132
-readability-simplify-boolean-expr,
22-
-clang-diagnostic-builtin-macro-redefined,
33+
-readability-identifier-length,
34+
-readability-container-data-pointer,
35+
-readability-redundant-casting,
36+
-readability-avoid-return-with-void-value,
2337

2438
WarningsAsErrors: '*'

.github/workflows/format.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
addlicense:
4444
name: verify licenses
4545

46-
runs-on: ubuntu-22.04
46+
runs-on: ubuntu-24.04
4747

4848
steps:
4949
- uses: actions/checkout@v2
@@ -63,7 +63,7 @@ jobs:
6363
buildifier:
6464
name: check format with buildifier
6565

66-
runs-on: ubuntu-22.04
66+
runs-on: ubuntu-24.04
6767

6868
steps:
6969
- uses: actions/checkout@v2
@@ -101,29 +101,29 @@ jobs:
101101
clang_format:
102102
name: check format with clang-format
103103

104-
runs-on: ubuntu-22.04
104+
runs-on: ubuntu-24.04
105105

106106
steps:
107107
- uses: actions/checkout@v2
108108

109109
- name: Install dependencies (Linux)
110-
run: sudo apt update -y && sudo apt install -y clang-format-12
110+
run: sudo apt update -y && sudo apt install -y clang-format-18
111111

112112
- name: Format (clang-format)
113113
run: |
114-
find . -name "*.h" -o -name "*.cc" -o -name "*.proto" | grep -v ".pb." | xargs -n1 clang-format-12 -i
114+
find . -name "*.h" -o -name "*.cc" -o -name "*.proto" | grep -v ".pb." | xargs -n1 clang-format-18 -i
115115
git diff --exit-code
116116
117117
clang_tidy:
118118
name: check format with clang-tidy
119119

120-
runs-on: ubuntu-22.04
120+
runs-on: ubuntu-24.04
121121

122122
steps:
123123
- uses: actions/checkout@v2
124124

125125
- name: Install dependencies (Linux)
126-
run: sudo apt update -y && sudo apt install -y clang-tidy-12 lld-12 && sudo ln -sf /usr/bin/lld-12 /usr/bin/lld
126+
run: sudo apt update -y && sudo apt install -y clang-tidy-18 lld-18 && sudo ln -sf /usr/bin/lld-18 /usr/bin/lld
127127

128128
- name: Bazel cache
129129
uses: PiotrSikora/[email protected]

.github/workflows/test.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
test_data:
4444
name: build test data
4545

46-
runs-on: ubuntu-22.04
46+
runs-on: ubuntu-24.04
4747

4848
steps:
4949
- uses: actions/checkout@v2
@@ -111,19 +111,19 @@ jobs:
111111
include:
112112
- name: 'NullVM on Linux/x86_64'
113113
engine: 'null'
114-
os: ubuntu-22.04
114+
os: ubuntu-24.04
115115
arch: x86_64
116116
action: test
117117
flags: --config=gcc
118118
- name: 'NullVM on Linux/x86_64 with ASan'
119119
engine: 'null'
120-
os: ubuntu-22.04
120+
os: ubuntu-24.04
121121
arch: x86_64
122122
action: test
123123
flags: --config=clang-asan --define=crypto=system
124124
- name: 'NullVM on Linux/x86_64 with TSan'
125125
engine: 'null'
126-
os: ubuntu-22.04
126+
os: ubuntu-24.04
127127
arch: x86_64
128128
action: test
129129
flags: --config=clang-tsan
@@ -136,39 +136,39 @@ jobs:
136136
- name: 'V8 on Linux/x86_64'
137137
engine: 'v8'
138138
repo: 'v8'
139-
os: ubuntu-22.04
139+
os: ubuntu-24.04
140140
arch: x86_64
141141
action: test
142142
flags: --config=clang --define=crypto=system
143143
cache: true
144144
- name: 'V8 on Linux/x86_64 with ASan'
145145
engine: 'v8'
146146
repo: 'v8'
147-
os: ubuntu-22.04
147+
os: ubuntu-24.04
148148
arch: x86_64
149149
action: test
150150
flags: --config=clang-asan
151151
cache: true
152152
- name: 'V8 on Linux/x86_64 with TSan'
153153
engine: 'v8'
154154
repo: 'v8'
155-
os: ubuntu-22.04
155+
os: ubuntu-24.04
156156
arch: x86_64
157157
action: test
158158
flags: --config=clang-tsan
159159
cache: true
160160
- name: 'V8 on Linux/x86_64 with GCC'
161161
engine: 'v8'
162162
repo: 'v8'
163-
os: ubuntu-22.04
163+
os: ubuntu-24.04
164164
arch: x86_64
165165
action: test
166166
flags: --config=gcc
167167
cache: true
168168
- name: 'V8 on Linux/aarch64'
169169
engine: 'v8'
170170
repo: 'v8'
171-
os: ubuntu-22.04
171+
os: ubuntu-24.04
172172
arch: aarch64
173173
action: test
174174
targets: -//test/fuzz/...
@@ -185,7 +185,7 @@ jobs:
185185
- name: 'WAMR interp on Linux/x86_64'
186186
engine: 'wamr-interp'
187187
repo: 'com_github_bytecodealliance_wasm_micro_runtime'
188-
os: ubuntu-22.04
188+
os: ubuntu-24.04
189189
arch: x86_64
190190
action: test
191191
flags: --config=clang
@@ -198,11 +198,11 @@ jobs:
198198
- name: 'WAMR jit on Linux/x86_64'
199199
engine: 'wamr-jit'
200200
repo: 'com_github_bytecodealliance_wasm_micro_runtime'
201-
os: ubuntu-22.04
201+
os: ubuntu-24.04
202202
arch: x86_64
203203
action: test
204204
flags: --config=clang
205-
deps: lld-12
205+
deps: lld-18
206206
cache: true
207207
- name: 'WAMR jit on macOS/x86_64'
208208
engine: 'wamr-jit'
@@ -214,7 +214,7 @@ jobs:
214214
- name: 'WasmEdge on Linux/x86_64'
215215
engine: 'wasmedge'
216216
repo: 'com_github_wasmedge_wasmedge'
217-
os: ubuntu-22.04
217+
os: ubuntu-24.04
218218
arch: x86_64
219219
action: test
220220
flags: --config=clang
@@ -227,29 +227,29 @@ jobs:
227227
- name: 'Wasmtime on Linux/x86_64'
228228
engine: 'wasmtime'
229229
repo: 'com_github_bytecodealliance_wasmtime'
230-
os: ubuntu-22.04
230+
os: ubuntu-24.04
231231
arch: x86_64
232232
action: test
233233
flags: --config=clang -c opt
234234
- name: 'Wasmtime on Linux/x86_64 with ASan'
235235
engine: 'wasmtime'
236236
repo: 'com_github_bytecodealliance_wasmtime'
237-
os: ubuntu-22.04
237+
os: ubuntu-24.04
238238
arch: x86_64
239239
action: test
240240
flags: --config=clang-asan --define=crypto=system
241241
- name: 'Wasmtime on Linux/aarch64'
242242
engine: 'wasmtime'
243243
repo: 'com_github_bytecodealliance_wasmtime'
244-
os: ubuntu-22.04
244+
os: ubuntu-24.04
245245
arch: aarch64
246246
action: build
247247
flags: --config=zig-cc-linux-aarch64
248248
deps: qemu-user-static libc6-arm64-cross
249249
- name: 'Wasmtime on Linux/s390x'
250250
engine: 'wasmtime'
251251
repo: 'com_github_bytecodealliance_wasmtime'
252-
os: ubuntu-22.04
252+
os: ubuntu-24.04
253253
arch: s390x
254254
action: test
255255
flags: --config=clang --test_timeout=1800

bazel/external/bazel_clang_tidy.patch

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# 1. Treat .h files as C++ headers.
2-
# 2. Hardcode clang-tidy-12.
32

43
diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl
54
index 3a5ed07..5db5c6c 100644
@@ -15,13 +14,3 @@ index 3a5ed07..5db5c6c 100644
1514
# start args passed to the compiler
1615
args.add("--")
1716

18-
diff --git a/clang_tidy/run_clang_tidy.sh b/clang_tidy/run_clang_tidy.sh
19-
index 582bab1..b9ebb94 100755
20-
--- a/clang_tidy/run_clang_tidy.sh
21-
+++ b/clang_tidy/run_clang_tidy.sh
22-
@@ -11,4 +11,4 @@ shift
23-
touch $OUTPUT
24-
truncate -s 0 $OUTPUT
25-
26-
-clang-tidy "$@"
27-
+clang-tidy-12 "$@"

src/null/null_plugin.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <utility>
2727
#include <vector>
2828

29-
#include "include/proxy-wasm/null_plugin.h"
3029
#include "include/proxy-wasm/null_vm.h"
3130
#include "include/proxy-wasm/wasm.h"
3231

src/wasmedge/wasmedge.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#include "wasmedge/wasmedge.h"
2121

22+
#include <algorithm>
2223
#include <array>
2324
#include <cassert>
2425
#include <cstring>

0 commit comments

Comments
 (0)