Skip to content

Commit 69870b2

Browse files
authored
Upgrade to Bazel 7.7.1 with modern clang-tidy integration and bzlmod-ready dependencies
1 parent 42b1525 commit 69870b2

File tree

8 files changed

+110
-50
lines changed

8 files changed

+110
-50
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

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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ 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)
1112
load("@proxy_wasm_cpp_host//bazel:setup_features.bzl", "setup_bazel_features")
1213

1314
setup_bazel_features()

bazel/dependencies.bzl

Lines changed: 7 additions & 0 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",

bazel/repositories.bzl

Lines changed: 41 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ def proxy_wasm_cpp_host_repositories():
3232
http_archive,
3333
name = "platforms",
3434
urls = [
35-
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz",
36-
"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",
3737
],
38-
sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee",
38+
sha256 = "3384eb1c30762704fbe38e440204e114154086c8fc8a8c2e3e28441028c019a8",
3939
)
4040

4141
maybe(
@@ -56,14 +56,42 @@ def proxy_wasm_cpp_host_repositories():
5656
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
5757
)
5858

59+
# aspect_rules_lint v1.12.0 for modern clang-tidy integration
5960
maybe(
6061
http_archive,
61-
name = "bazel_clang_tidy",
62-
sha256 = "6ed23cbff9423a30ef10becf57210a26d54fe198a211f4037d931c06f843c023",
63-
strip_prefix = "bazel_clang_tidy-c2fe98cfec0430e78bff4169e9ca0a43123e4c99",
64-
url = "https://github.com/erenon/bazel_clang_tidy/archive/c2fe98cfec0430e78bff4169e9ca0a43123e4c99.tar.gz",
65-
patches = ["@proxy_wasm_cpp_host//bazel/external:bazel_clang_tidy.patch"],
66-
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",
6795
)
6896

6997
maybe(
@@ -85,9 +113,9 @@ def proxy_wasm_cpp_host_repositories():
85113
maybe(
86114
http_archive,
87115
name = "rules_foreign_cc",
88-
sha256 = "32759728913c376ba45b0116869b71b68b1c2ebf8f2bcf7b41222bc07b773d73",
89-
strip_prefix = "rules_foreign_cc-0.15.1",
90-
url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.15.1.tar.gz",
116+
sha256 = "bcd0c5f46a49b85b384906daae41d277b3dc0ff27c7c752cc51e43048a58ec83",
117+
strip_prefix = "rules_foreign_cc-0.7.1",
118+
url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.7.1.tar.gz",
91119
)
92120

93121
maybe(
@@ -106,8 +134,6 @@ def proxy_wasm_cpp_host_repositories():
106134
url = "https://github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
107135
)
108136

109-
# Keep at 0.42 one because https://github.com/bazelbuild/rules_rust/issues/2665
110-
# manifests at 0.43
111137
maybe(
112138
http_archive,
113139
name = "rules_rust",
@@ -188,7 +214,7 @@ def proxy_wasm_cpp_host_repositories():
188214
# 13.8.258.26
189215
commit = "de9d0f8b56ae61896e4d2ac577fc589efb14f87d",
190216
remote = "https://chromium.googlesource.com/v8/v8",
191-
shallow_since = "1752074621 -0700",
217+
shallow_since = "1752074621",
192218
patches = [
193219
"@proxy_wasm_cpp_host//bazel/external:v8.patch",
194220
],
@@ -265,11 +291,6 @@ def proxy_wasm_cpp_host_repositories():
265291
build_file = "@proxy_wasm_cpp_host//bazel/external:intel_ittapi.BUILD",
266292
)
267293

268-
native.bind(
269-
name = "wee8",
270-
actual = "@v8//:wee8",
271-
)
272-
273294
# WAMR with dependencies.
274295

275296
maybe(
@@ -282,11 +303,6 @@ def proxy_wasm_cpp_host_repositories():
282303
url = "https://github.com/bytecodealliance/wasm-micro-runtime/archive/refs/tags/WAMR-2.4.1.zip",
283304
)
284305

285-
native.bind(
286-
name = "wamr",
287-
actual = "@com_github_bytecodealliance_wasm_micro_runtime//:wamr_lib",
288-
)
289-
290306
maybe(
291307
http_archive,
292308
name = "llvm-15_0_7",
@@ -307,11 +323,6 @@ def proxy_wasm_cpp_host_repositories():
307323
url = "https://github.com/WasmEdge/WasmEdge/archive/refs/tags/proxy-wasm/0.13.1.tar.gz",
308324
)
309325

310-
native.bind(
311-
name = "wasmedge",
312-
actual = "@com_github_wasmedge_wasmedge//:wasmedge_lib",
313-
)
314-
315326
# Wasmtime with dependencies.
316327

317328
maybe(
@@ -322,13 +333,3 @@ def proxy_wasm_cpp_host_repositories():
322333
strip_prefix = "wasmtime-24.0.0",
323334
url = "https://github.com/bytecodealliance/wasmtime/archive/v24.0.0.tar.gz",
324335
)
325-
326-
native.bind(
327-
name = "wasmtime",
328-
actual = "@com_github_bytecodealliance_wasmtime//:wasmtime_lib",
329-
)
330-
331-
native.bind(
332-
name = "prefixed_wasmtime",
333-
actual = "@com_github_bytecodealliance_wasmtime//:prefixed_wasmtime_lib",
334-
)

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)