Skip to content

Commit 82dc2b1

Browse files
committed
Upgrade to Bazel 7.7.1 with modern clang-tidy integration and bzlmod-ready dependencies
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
1 parent 6110918 commit 82dc2b1

File tree

10 files changed

+147
-54
lines changed

10 files changed

+147
-54
lines changed

.bazelrc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ 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
6563

6664
# Use GCC compiler.
6765
build:gcc --action_env=BAZEL_COMPILER=gcc

.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/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ jobs:
194194
- name: 'V8 on macOS/x86_64'
195195
engine: 'v8'
196196
repo: 'v8'
197-
os: macos-13
197+
os: macos-15
198198
arch: x86_64
199199
action: test
200200
flags: --config=hermetic-llvm-macos
@@ -209,7 +209,7 @@ jobs:
209209
- name: 'WAMR interp on macOS/x86_64'
210210
engine: 'wamr-interp'
211211
repo: 'com_github_bytecodealliance_wasm_micro_runtime'
212-
os: macos-13
212+
os: macos-15
213213
arch: x86_64
214214
action: test
215215
- name: 'WAMR jit on Linux/x86_64'
@@ -224,7 +224,7 @@ jobs:
224224
- name: 'WAMR jit on macOS/x86_64'
225225
engine: 'wamr-jit'
226226
repo: 'com_github_bytecodealliance_wasm_micro_runtime'
227-
os: macos-13
227+
os: macos-15
228228
arch: x86_64
229229
action: test
230230
cache: true
@@ -238,7 +238,7 @@ jobs:
238238
- name: 'WasmEdge on macOS/x86_64'
239239
engine: 'wasmedge'
240240
repo: 'com_github_wasmedge_wasmedge'
241-
os: macos-13
241+
os: macos-15
242242
arch: x86_64
243243
action: test
244244
- name: 'Wasmtime on Linux/x86_64'
@@ -275,7 +275,7 @@ jobs:
275275
- name: 'Wasmtime on macOS/x86_64'
276276
engine: 'wasmtime'
277277
repo: 'com_github_bytecodealliance_wasmtime'
278-
os: macos-13
278+
os: macos-15
279279
arch: x86_64
280280
action: test
281281

BUILD

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ cc_library(
133133
],
134134
deps = [
135135
":wasm_vm_headers",
136-
"//external:wee8",
136+
"@v8//:wee8",
137137
],
138138
)
139139

@@ -151,7 +151,7 @@ cc_library(
151151
],
152152
deps = [
153153
":wasm_vm_headers",
154-
"//external:wamr",
154+
"@com_github_bytecodealliance_wasm_micro_runtime//:wamr_lib",
155155
],
156156
)
157157

@@ -178,7 +178,7 @@ cc_library(
178178
}),
179179
deps = [
180180
":wasm_vm_headers",
181-
"//external:wasmedge",
181+
"@com_github_wasmedge_wasmedge//:wasmedge_lib",
182182
],
183183
)
184184

@@ -217,7 +217,7 @@ cc_library(
217217
}),
218218
deps = [
219219
":wasm_vm_headers",
220-
"//external:wasmtime",
220+
"@com_github_bytecodealliance_wasmtime//:wasmtime_lib",
221221
],
222222
)
223223

@@ -276,7 +276,7 @@ cc_library(
276276
}),
277277
deps = [
278278
":wasm_vm_headers",
279-
"//external:prefixed_wasmtime",
279+
"@com_github_bytecodealliance_wasmtime//:prefixed_wasmtime_lib",
280280
],
281281
)
282282

WORKSPACE

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ load("@proxy_wasm_cpp_host//bazel:dependencies.bzl", "proxy_wasm_cpp_host_depend
88

99
proxy_wasm_cpp_host_dependencies()
1010

11+
# Setup bazel_features internal repos (required for aspect_rules_lint)
12+
load("@proxy_wasm_cpp_host//bazel:setup_features.bzl", "setup_bazel_features")
13+
14+
setup_bazel_features()
15+
1116
load("@proxy_wasm_cpp_host//bazel:dependencies_python.bzl", "proxy_wasm_cpp_host_dependencies_python")
1217

1318
proxy_wasm_cpp_host_dependencies_python()

bazel/dependencies.bzl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
load("@aspect_rules_lint//format:repositories.bzl", "rules_lint_dependencies")
16+
load("@bazel_lib//lib:repositories.bzl", "bazel_lib_dependencies", "bazel_lib_register_toolchains")
1517
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
1618
load("@envoy_toolshed//sysroot:sysroot.bzl", "setup_sysroots")
1719
load("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:crates.bzl", wasmsign_crate_repositories = "crate_repositories")
@@ -25,6 +27,11 @@ load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain")
2527
def proxy_wasm_cpp_host_dependencies():
2628
# Bazel extensions.
2729

30+
rules_lint_dependencies()
31+
32+
bazel_lib_dependencies()
33+
bazel_lib_register_toolchains()
34+
2835
py_repositories()
2936
python_register_toolchains(
3037
name = "python_3_9",
@@ -41,7 +48,7 @@ def proxy_wasm_cpp_host_dependencies():
4148
"wasm32-unknown-unknown",
4249
"wasm32-wasi", # TODO: Change to wasm32-wasip1 once https://github.com/bazelbuild/rules_rust/issues/2782 is fixed
4350
],
44-
version = "1.77.2",
51+
versions = ["1.77.2"],
4552
)
4653
rust_repository_set(
4754
name = "rust_linux_s390x",
@@ -50,7 +57,7 @@ def proxy_wasm_cpp_host_dependencies():
5057
"wasm32-unknown-unknown",
5158
"wasm32-wasi",
5259
],
53-
version = "1.77.2",
60+
versions = ["1.77.2"],
5461
)
5562
crate_universe_dependencies(bootstrap = True)
5663

bazel/repositories.bzl

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,23 @@ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
1919
def proxy_wasm_cpp_host_repositories():
2020
# Bazel extensions.
2121

22+
maybe(
23+
http_archive,
24+
name = "bazel_features",
25+
sha256 = "af3d4fb1cf4f25942cb4a933b1ad93a0ea9fe9ee70c2af7f369fb72a67c266e5",
26+
strip_prefix = "bazel_features-1.21.0",
27+
urls = ["https://github.com/bazel-contrib/bazel_features/releases/download/v1.21.0/bazel_features-v1.21.0.tar.gz"],
28+
)
29+
2230
# Update platforms for crate_universe. Can remove when we update Bazel version.
2331
maybe(
2432
http_archive,
2533
name = "platforms",
2634
urls = [
27-
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz",
28-
"https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz",
35+
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/1.0.0/platforms-1.0.0.tar.gz",
36+
"https://github.com/bazelbuild/platforms/releases/download/1.0.0/platforms-1.0.0.tar.gz",
2937
],
30-
sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee",
38+
sha256 = "3384eb1c30762704fbe38e440204e114154086c8fc8a8c2e3e28441028c019a8",
3139
)
3240

3341
maybe(
@@ -48,14 +56,42 @@ def proxy_wasm_cpp_host_repositories():
4856
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
4957
)
5058

59+
# aspect_rules_lint v1.12.0 for modern clang-tidy integration
5160
maybe(
5261
http_archive,
53-
name = "bazel_clang_tidy",
54-
sha256 = "6ed23cbff9423a30ef10becf57210a26d54fe198a211f4037d931c06f843c023",
55-
strip_prefix = "bazel_clang_tidy-c2fe98cfec0430e78bff4169e9ca0a43123e4c99",
56-
url = "https://github.com/erenon/bazel_clang_tidy/archive/c2fe98cfec0430e78bff4169e9ca0a43123e4c99.tar.gz",
57-
patches = ["@proxy_wasm_cpp_host//bazel/external:bazel_clang_tidy.patch"],
58-
patch_args = ["-p1"],
62+
name = "aspect_rules_lint",
63+
sha256 = "a8a63bd071a39bd5be1f99d9f258eac674673c98505f9fc5b4c76587f67278cd",
64+
strip_prefix = "rules_lint-1.12.0",
65+
url = "https://github.com/aspect-build/rules_lint/releases/download/v1.12.0/rules_lint-v1.12.0.tar.gz",
66+
)
67+
68+
# bazel_lib v3.0.1 required by aspect_rules_lint v1.12.0
69+
maybe(
70+
http_archive,
71+
name = "bazel_lib",
72+
sha256 = "8b074b1a2731d29f6b95defdca95297354dc424492caf7019cf6b9f36afba54f",
73+
strip_prefix = "bazel-lib-3.0.1",
74+
url = "https://github.com/bazel-contrib/bazel-lib/releases/download/v3.0.1/bazel-lib-v3.0.1.tar.gz",
75+
)
76+
77+
# aspect_bazel_lib alias for aspect_rules_js v2.1.2 compatibility
78+
# aspect_rules_js expects @aspect_bazel_lib while aspect_rules_lint expects @bazel_lib
79+
# Both repos reference the same bazel-lib v3.0.1 release to maintain consistency
80+
maybe(
81+
http_archive,
82+
name = "aspect_bazel_lib",
83+
sha256 = "8b074b1a2731d29f6b95defdca95297354dc424492caf7019cf6b9f36afba54f",
84+
strip_prefix = "bazel-lib-3.0.1",
85+
url = "https://github.com/bazel-contrib/bazel-lib/releases/download/v3.0.1/bazel-lib-v3.0.1.tar.gz",
86+
)
87+
88+
# aspect_rules_js is required by aspect_rules_lint
89+
maybe(
90+
http_archive,
91+
name = "aspect_rules_js",
92+
sha256 = "fbc34d815a0cc52183a1a26732fc0329e26774a51abbe0f26fc9fd2dab6133b4",
93+
strip_prefix = "rules_js-2.1.2",
94+
url = "https://github.com/aspect-build/rules_js/releases/download/v2.1.2/rules_js-v2.1.2.tar.gz",
5995
)
6096

6197
maybe(
@@ -98,8 +134,6 @@ def proxy_wasm_cpp_host_repositories():
98134
url = "https://github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
99135
)
100136

101-
# Keep at 0.42 one because https://github.com/bazelbuild/rules_rust/issues/2665
102-
# manifests at 0.43
103137
maybe(
104138
http_archive,
105139
name = "rules_rust",
@@ -180,7 +214,7 @@ def proxy_wasm_cpp_host_repositories():
180214
# 13.8.258.26
181215
commit = "de9d0f8b56ae61896e4d2ac577fc589efb14f87d",
182216
remote = "https://chromium.googlesource.com/v8/v8",
183-
shallow_since = "1752074621 -0400",
217+
shallow_since = "1752074621 -0700",
184218
patches = [
185219
"@proxy_wasm_cpp_host//bazel/external:v8.patch",
186220
],
@@ -257,11 +291,6 @@ def proxy_wasm_cpp_host_repositories():
257291
build_file = "@proxy_wasm_cpp_host//bazel/external:intel_ittapi.BUILD",
258292
)
259293

260-
native.bind(
261-
name = "wee8",
262-
actual = "@v8//:wee8",
263-
)
264-
265294
# WAMR with dependencies.
266295

267296
maybe(
@@ -274,11 +303,6 @@ def proxy_wasm_cpp_host_repositories():
274303
url = "https://github.com/bytecodealliance/wasm-micro-runtime/archive/refs/tags/WAMR-2.4.1.zip",
275304
)
276305

277-
native.bind(
278-
name = "wamr",
279-
actual = "@com_github_bytecodealliance_wasm_micro_runtime//:wamr_lib",
280-
)
281-
282306
maybe(
283307
http_archive,
284308
name = "llvm-15_0_7",
@@ -299,11 +323,6 @@ def proxy_wasm_cpp_host_repositories():
299323
url = "https://github.com/WasmEdge/WasmEdge/archive/refs/tags/proxy-wasm/0.13.1.tar.gz",
300324
)
301325

302-
native.bind(
303-
name = "wasmedge",
304-
actual = "@com_github_wasmedge_wasmedge//:wasmedge_lib",
305-
)
306-
307326
# Wasmtime with dependencies.
308327

309328
maybe(
@@ -314,13 +333,3 @@ def proxy_wasm_cpp_host_repositories():
314333
strip_prefix = "wasmtime-24.0.0",
315334
url = "https://github.com/bytecodealliance/wasmtime/archive/v24.0.0.tar.gz",
316335
)
317-
318-
native.bind(
319-
name = "wasmtime",
320-
actual = "@com_github_bytecodealliance_wasmtime//:wasmtime_lib",
321-
)
322-
323-
native.bind(
324-
name = "prefixed_wasmtime",
325-
actual = "@com_github_bytecodealliance_wasmtime//:prefixed_wasmtime_lib",
326-
)

bazel/setup_features.bzl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""Setup bazel_features internal repositories."""
16+
17+
load("@bazel_features//private:repos.bzl", "bazel_features_repos")
18+
19+
def setup_bazel_features():
20+
"""Initialize bazel_features internal repos (needed for WORKSPACE compat)."""
21+
bazel_features_repos()

tools/lint/BUILD

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
16+
17+
# Make hermetic clang-tidy available as a binary for aspect_rules_lint
18+
native_binary(
19+
name = "clang_tidy",
20+
src = select(
21+
{
22+
"@bazel_tools//src/conditions:linux_x86_64": "@llvm_toolchain_llvm//:bin/clang-tidy",
23+
"@bazel_tools//src/conditions:linux_aarch64": "@llvm_toolchain_llvm//:bin/clang-tidy",
24+
"@bazel_tools//src/conditions:darwin_x86_64": "@llvm_toolchain_llvm//:bin/clang-tidy",
25+
"@bazel_tools//src/conditions:darwin_arm64": "@llvm_toolchain_llvm//:bin/clang-tidy",
26+
},
27+
),
28+
out = "clang_tidy",
29+
visibility = ["//visibility:public"],
30+
)

tools/lint/linters.bzl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""Linter configurations for the project."""
16+
17+
load("@aspect_rules_lint//lint:clang_tidy.bzl", "lint_clang_tidy_aspect")
18+
19+
# Configure clang-tidy to use the hermetic LLVM toolchain
20+
clang_tidy = lint_clang_tidy_aspect(
21+
binary = "@@//tools/lint:clang_tidy",
22+
configs = ["@@//:.clang-tidy"],
23+
)

0 commit comments

Comments
 (0)