Skip to content

Commit b50cc44

Browse files
authored
chore: bump Bazel from 6.5.0 to 7.7.1 (#475)
Summary of changes introduced: * Updates: * Updated Bazel to 7.7.1 * Updated platforms from 0.0.10 -> 1.0.0 * Updated rules_cc from 0.0.9 -> 0.1.5 * Updated toolchains_llvm from 0.10.3 -> v1.4.0 * Updated rules_foreign_cc from 0.7.1 -> 0.15.1 * Updated rules_fuzzing from 0.5.2 -> 0.6.0 * Updated rules_python from 0.34.0 -> 1.6.1 * Updated rules_rust from 0.42.1 -> 0.68.1 * Updated com_google_protobuf from 3.17.3 -> 29.1 * Updated llvm (for WAMR) from 15.0.7 -> 19.1.0 * Updated rustc from 1.77.2 -> 1.91.0 * Updated python toolchain from 3.9 -> 3.11 * Added bazel_features, aspect_rules_lint, bazel_lib, aspect_bazel_lib, aspect_rules_js * Updated wasmsign to wasmsign2 * User-facing changes: * Migrates to wasmsign2. The old wasmsign library was not compatible with the updated rustc, since new wasm instructions failed validation in the wasmsign library. The new wasm signature format changed to follow the wasm signature spec: https://github.com/WebAssembly/tool-conventions/blob/main/Signatures.md. See src/signature_util.cc for changes to the new signature format. * Changes for developers: * Uses rules_aspect_lint for clang-tidy integration rather than bazel-clang-tidy * Updates s390x docker file to use * Changes CI to use caching provided by bazel-contrib/setup-bazel * Updates macos CI runners to use macos 15 * Updates all CI runners to use the vendored toolchain --- Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com> Signed-off-by: Matt Leon <mattleon@google.com>
1 parent c448226 commit b50cc44

File tree

294 files changed

+16981
-1684
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

294 files changed

+16981
-1684
lines changed

.bazelrc

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,9 @@ build:clang-tsan --linkopt -fsanitize=thread
5858
build:clang-tsan --test_env=TSAN_OPTIONS=suppressions=bazel/tsan_suppressions.txt
5959

6060
# Use Clang-Tidy tool.
61-
build:clang-tidy --config=clang
62-
build:clang-tidy --aspects @bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect
63-
build:clang-tidy --@bazel_clang_tidy//:clang_tidy_config=@proxy_wasm_cpp_host//:clang_tidy_config
64-
build:clang-tidy --output_groups=report
61+
build:clang-tidy --aspects //tools/lint:linters.bzl%clang_tidy
62+
build:clang-tidy --output_groups=rules_lint_report
63+
build:clang-tidy --config=hermetic-llvm
6564

6665
# Use GCC compiler.
6766
build:gcc --action_env=BAZEL_COMPILER=gcc
@@ -72,11 +71,6 @@ build:hermetic-llvm --incompatible_enable_cc_toolchain_resolution
7271
build:hermetic-llvm --action_env BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
7372
build:hermetic-llvm --extra_toolchains @emsdk//emscripten_toolchain:cc-toolchain-wasm
7473

75-
build:hermetic-llvm-macos --config=hermetic-llvm
76-
# Below flags mitigate https://github.com/bazel-contrib/toolchains_llvm/pull/229.
77-
build:hermetic-llvm-macos --features=-libtool
78-
build:hermetic-llvm-macos --features=-supports_dynamic_linker
79-
8074
build --enable_platform_specific_config
8175

8276
# Use C++20.

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.5.0
1+
7.7.1

.github/workflows/format.yml

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ jobs:
8888
steps:
8989
- uses: actions/checkout@v2
9090

91+
- uses: bazel-contrib/setup-bazel@0.16.0
92+
with:
93+
bazelisk-cache: true
94+
disk-cache: ${{ github.job }}
95+
external-cache: true
96+
repository-cache: true
97+
9198
- name: Format (bazel query)
9299
run: |
93100
bazel query 'deps(//bazel/cargo/...)'
@@ -122,43 +129,18 @@ jobs:
122129
steps:
123130
- uses: actions/checkout@v2
124131

125-
- name: Install dependencies (Linux)
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
127-
128-
- name: set cache name
129-
id: vars
130-
# The cache tag consists of the following parts:
131-
# * clang-tidy- prefix
132-
# * matrix.name, which separates the cache for each build type.
133-
# * hash of WORKSPACE, .bazelrc, and .bazelversion, which is
134-
# purely to differentiate caches for substantial changes in bazel.
135-
# * github.sha, which is the commit hash of the commit used to generate
136-
# the cache entry.
137-
run: echo "CACHE_TAG=clang-tidy-${{ matrix.name }}-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion') }}" >> "$GITHUB_OUTPUT"
138-
139-
- name: bazel cache
140-
uses: actions/cache/restore@v3
132+
- uses: bazel-contrib/setup-bazel@0.16.0
141133
with:
142-
path: /tmp/bazel/cache
143-
key: ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
144-
restore-keys: |
145-
${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
146-
${{ steps.vars.outputs.CACHE_TAG }}-
147-
clang-tidy-${{ matrix.name }}-
148-
clang-tidy-
134+
bazelisk-cache: true
135+
disk-cache: ${{ github.job }}
136+
external-cache: true
137+
repository-cache: true
149138

150139
- name: Bazel build
151140
run: >
152141
bazel build
142+
--config=hermetic-llvm
153143
--config clang-tidy
154144
--define engine=multi
155-
--disk_cache /tmp/bazel/cache
156-
--copt=-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -b9-)\"
145+
--copt=-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -c3-)\"
157146
//...
158-
159-
- name: save bazel cache
160-
uses: actions/cache/save@v3
161-
if: always()
162-
with:
163-
path: /tmp/bazel/cache
164-
key: ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}

.github/workflows/test.yml

Lines changed: 52 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -48,34 +48,20 @@ jobs:
4848
steps:
4949
- uses: actions/checkout@v2
5050

51-
- name: set cache name
52-
id: vars
53-
# The cache tag consists of the following parts:
54-
# * test-deps-bazel-cache- prefix
55-
# * hash of WORKSPACE, .bazelrc, and .bazelversion, which is
56-
# purely to differentiate caches for substantial changes in bazel.
57-
# * github.sha, which is the commit hash of the commit used to generate
58-
# the cache entry.
59-
run: echo "CACHE_TAG=test-deps-bazel-cache-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion') }}" >> "$GITHUB_OUTPUT"
60-
61-
- name: bazel cache
62-
uses: actions/cache/restore@v3
51+
- uses: bazel-contrib/setup-bazel@0.16.0
6352
with:
64-
path: /tmp/bazel/cache
65-
key: ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
66-
restore-keys: |
67-
${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
68-
${{ steps.vars.outputs.CACHE_TAG }}-
69-
test-deps-bazel-cache-${{ matrix.name }}-
70-
test-deps-bazel-cache-
53+
bazelisk-cache: true
54+
disk-cache: ${{ github.job }}
55+
external-cache: true
56+
repository-cache: true
7157

7258
- name: Bazel build
7359
run: >
7460
bazel build
7561
--verbose_failures
7662
--test_output=errors
7763
--config=clang
78-
--disk_cache /tmp/bazel/cache
64+
--config=hermetic-llvm
7965
-c opt
8066
$(bazel query 'kind(was.*_rust_binary, //test/test_data/...)')
8167
$(bazel query 'kind(_optimized_wasm_cc_binary, //test/test_data/...)')
@@ -99,22 +85,6 @@ jobs:
9985
if-no-files-found: error
10086
retention-days: 3
10187

102-
- name: remove unaccessed files from cache
103-
shell: bash
104-
run: >
105-
find /tmp/bazel/cache
106-
-type f
107-
-name '*'
108-
-amin +360
109-
-exec rm {} \;
110-
111-
- name: save bazel cache
112-
uses: actions/cache/save@v3
113-
if: always()
114-
with:
115-
path: /tmp/bazel/cache
116-
key: ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
117-
11888
build:
11989
name: ${{ matrix.action }} with ${{ matrix.name }}
12090

@@ -137,13 +107,13 @@ jobs:
137107
os: ubuntu-24.04-16core
138108
arch: x86_64
139109
action: test
140-
flags: --config=clang-asan --define=crypto=system
110+
flags: --config=hermetic-llvm --config=clang-asan --define=crypto=system
141111
- name: 'NullVM on Linux/x86_64 with TSan'
142112
engine: 'null'
143113
os: ubuntu-24.04-16core
144114
arch: x86_64
145115
action: test
146-
flags: --config=clang-tsan
116+
flags: --config=hermetic-llvm --config=clang-tsan
147117
- name: 'NullVM on Windows/x86_64'
148118
engine: 'null'
149119
os: windows-2022
@@ -194,67 +164,70 @@ jobs:
194164
- name: 'V8 on macOS/x86_64'
195165
engine: 'v8'
196166
repo: 'v8'
197-
os: macos-13
167+
os: macos-15
198168
arch: x86_64
199169
action: test
200-
flags: --config=hermetic-llvm-macos
170+
flags: --config=hermetic-llvm
201171
cache: true
202172
- name: 'WAMR interp on Linux/x86_64'
203173
engine: 'wamr-interp'
204174
repo: 'com_github_bytecodealliance_wasm_micro_runtime'
205175
os: ubuntu-24.04-16core
206176
arch: x86_64
207177
action: test
208-
flags: --config=clang
178+
flags: --config=hermetic-llvm
209179
- name: 'WAMR interp on macOS/x86_64'
210180
engine: 'wamr-interp'
211181
repo: 'com_github_bytecodealliance_wasm_micro_runtime'
212-
os: macos-13
182+
os: macos-15
213183
arch: x86_64
214184
action: test
185+
flags: --config=hermetic-llvm
215186
- name: 'WAMR jit on Linux/x86_64'
216187
engine: 'wamr-jit'
217188
repo: 'com_github_bytecodealliance_wasm_micro_runtime'
218189
os: ubuntu-24.04-16core
219190
arch: x86_64
220191
action: test
221-
flags: --config=clang
192+
flags: --config=hermetic-llvm
222193
deps: lld-18
223194
cache: true
224195
- name: 'WAMR jit on macOS/x86_64'
225196
engine: 'wamr-jit'
226197
repo: 'com_github_bytecodealliance_wasm_micro_runtime'
227-
os: macos-13
198+
os: macos-15
228199
arch: x86_64
229200
action: test
230201
cache: true
202+
flags: --config=hermetic-llvm
231203
- name: 'WasmEdge on Linux/x86_64'
232204
engine: 'wasmedge'
233205
repo: 'com_github_wasmedge_wasmedge'
234206
os: ubuntu-24.04-16core
235207
arch: x86_64
236208
action: test
237-
flags: --config=clang
209+
flags: --config=hermetic-llvm
238210
- name: 'WasmEdge on macOS/x86_64'
239211
engine: 'wasmedge'
240212
repo: 'com_github_wasmedge_wasmedge'
241-
os: macos-13
213+
os: macos-15
242214
arch: x86_64
243215
action: test
216+
flags: --config=hermetic-llvm
244217
- name: 'Wasmtime on Linux/x86_64'
245218
engine: 'wasmtime'
246219
repo: 'com_github_bytecodealliance_wasmtime'
247220
os: ubuntu-24.04-16core
248221
arch: x86_64
249222
action: test
250-
flags: --config=clang -c opt
223+
flags: --config=hermetic-llvm -c opt
251224
- name: 'Wasmtime on Linux/x86_64 with ASan'
252225
engine: 'wasmtime'
253226
repo: 'com_github_bytecodealliance_wasmtime'
254227
os: ubuntu-24.04-16core
255228
arch: x86_64
256229
action: test
257-
flags: --config=clang-asan --define=crypto=system
230+
flags: --config=hermetic-llvm --config=clang-asan --define=crypto=system
258231
- name: 'Wasmtime on Linux/aarch64'
259232
engine: 'wasmtime'
260233
repo: 'com_github_bytecodealliance_wasmtime'
@@ -267,21 +240,28 @@ jobs:
267240
repo: 'com_github_bytecodealliance_wasmtime'
268241
os: ubuntu-24.04-16core
269242
arch: s390x
243+
platform: linux/s390x
270244
action: test
271245
flags: --config=clang --test_timeout=1800
272246
# s390x build-tools image built from bazel/external/Dockerfile.bazel
273-
run_under: docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/s390x ghcr.io/proxy-wasm/build-tools:ubuntu-22.04-bazel-6.5.0
247+
run_under: docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/s390x proxy-wasm/build-tools:local-ci
274248
cache: true
275249
- name: 'Wasmtime on macOS/x86_64'
276250
engine: 'wasmtime'
277251
repo: 'com_github_bytecodealliance_wasmtime'
278-
os: macos-13
252+
os: macos-15
279253
arch: x86_64
280254
action: test
255+
flags: --config=hermetic-llvm
281256

282257
steps:
283258
- uses: actions/checkout@v2
284259

260+
- name: Compute job hash
261+
id: job-hash
262+
run: echo "hash=$(echo -n '${{ matrix.engine }}-${{ matrix.flags }}-${{ matrix.os }}-${{ matrix.arch }}' | sha1sum | cut -c1-10)" >> $GITHUB_OUTPUT
263+
shell: bash
264+
285265
- name: Install dependencies (Linux)
286266
if: ${{ matrix.deps != '' && startsWith(matrix.os, 'ubuntu') }}
287267
run: sudo apt update -y && sudo apt install -y ${{ matrix.deps }}
@@ -299,27 +279,16 @@ jobs:
299279
if: startsWith(matrix.run_under, 'docker')
300280
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
301281

302-
- name: set cache name
303-
id: vars
304-
# The cache tag consists of the following parts:
305-
# * bazel-cache- prefix
306-
# * matrix.name, which separates the cache for each build type.
307-
# * hash of WORKSPACE, .bazelrc, and .bazelversion, which is
308-
# purely to differentiate caches for substantial changes in bazel.
309-
# * github.sha, which is the commit hash of the commit used to generate
310-
# the cache entry.
311-
run: echo "CACHE_TAG=bazel-cache-${{ matrix.name }}-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion') }}" >> "$GITHUB_OUTPUT"
312-
313-
- name: bazel cache
314-
uses: actions/cache/restore@v3
282+
- name: Set up Docker Buildx
283+
if: startsWith(matrix.run_under, 'docker')
284+
uses: docker/setup-buildx-action@v3
285+
286+
- uses: bazel-contrib/setup-bazel@0.16.0
315287
with:
316-
path: /tmp/bazel/cache
317-
key: ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
318-
restore-keys: |
319-
${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
320-
${{ steps.vars.outputs.CACHE_TAG }}-
321-
bazel-cache-${{ matrix.name }}-
322-
bazel-cache-
288+
bazelisk-cache: true
289+
disk-cache: ${{ github.job }}-${{ steps.job-hash.outputs.hash }}
290+
external-cache: true
291+
repository-cache: true
323292

324293
- name: Download test data
325294
uses: actions/download-artifact@v4
@@ -336,6 +305,18 @@ jobs:
336305
echo "filegroup(name = \"$i\", srcs = [\"$i.wasm\"])" >> test/test_data/BUILD; \
337306
done
338307
308+
- name: Build local Docker image
309+
if: ${{ startsWith(matrix.run_under, 'docker') }}
310+
uses: docker/build-push-action@v6
311+
with:
312+
context: .
313+
file: bazel/external/Dockerfile.bazel
314+
platforms: ${{ matrix.platform }}
315+
tags: proxy-wasm/build-tools:local-ci
316+
load: true
317+
cache-from: type=gha,scope=build-tools-${{ matrix.platform }}
318+
cache-to: type=gha,mode=max,scope=build-tools-${{ matrix.platform }}
319+
339320
- name: Bazel build/test
340321
shell: bash
341322
run: >
@@ -344,7 +325,6 @@ jobs:
344325
--verbose_failures
345326
--test_output=errors
346327
--define engine=${{ matrix.engine }}
347-
--disk_cache /tmp/bazel/cache
348328
${{ matrix.flags }}
349329
-- //test/... ${{ matrix.targets }}
350330
@@ -356,24 +336,7 @@ jobs:
356336
--verbose_failures
357337
--test_output=errors
358338
--define engine=${{ matrix.engine }}
359-
--disk_cache /tmp/bazel/cache
360339
${{ matrix.flags }}
361-
--per_file_copt=src/signature_util.cc,test/signature_util_test.cc@-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -b9-)\"
340+
--per_file_copt=src/signature_util.cc,test/signature_util_test.cc@-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -c3- | tr -d '\n')\"
362341
//test:signature_util_test
363342
364-
- name: remove unaccessed files from cache
365-
shell: bash
366-
run: >
367-
find /tmp/bazel/cache
368-
-type f
369-
-name '*'
370-
-amin +360
371-
-exec rm {} \;
372-
373-
- name: save bazel cache
374-
uses: actions/cache/save@v3
375-
if: always()
376-
with:
377-
path: /tmp/bazel/cache
378-
key: ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }}
379-

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/external
33
/compile_commands.json
44
/.cache/
5+
/_codeql_detected_source_root

0 commit comments

Comments
 (0)