Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ build:clang-tsan --linkopt -fsanitize=thread
build:clang-tsan --test_env=TSAN_OPTIONS=suppressions=bazel/tsan_suppressions.txt

# Use Clang-Tidy tool.
build:clang-tidy --config=clang
build:clang-tidy --action_env=CC=clang-18
build:clang-tidy --action_env=CXX=clang++-18
build:clang-tidy --aspects @bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect
build:clang-tidy --@bazel_clang_tidy//:clang_tidy_config=@proxy_wasm_cpp_host//:clang_tidy_config
build:clang-tidy --output_groups=report
Expand Down
9 changes: 7 additions & 2 deletions bazel/external/bazel_clang_tidy.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
# 1. Treat .h files as C++ headers.
# 2. Remove -stdlib=libc++ to use system libstdc++ for clang-tidy compatibility.

diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl
index 3a5ed07..5db5c6c 100644
index 3a5ed07..e9f6072 100644
--- a/clang_tidy/clang_tidy.bzl
+++ b/clang_tidy/clang_tidy.bzl
@@ -16,6 +16,9 @@ def _run_tidy(ctx, exe, flags, compilation_context, infile, discriminator):
@@ -16,6 +16,13 @@ def _run_tidy(ctx, exe, flags, compilation_context, infile, discriminator):
# add source to check
args.add(infile.path)

+ # treat .h files as C++ headers
+ args.add("--extra-arg-before=-xc++")
+
+ # Use system libstdc++ instead of hermetic libc++ for clang-tidy
+ # This ensures compatibility with system clang-tidy-18
+ args.add("--extra-arg=-stdlib=libstdc++")
+
# start args passed to the compiler
args.add("--")
Expand Down
24 changes: 24 additions & 0 deletions bazel/external/rules_rust.patch
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,27 @@ index bfd96ed9..d7e38658 100644
# These rules are not supposed to be depended on by other rust targets, and
# as such they shouldn't provide a CrateInfo. However, one may still want to
# write a rust_test for them, so we provide the CrateInfo wrapped in a provider

# Fix dummy CC toolchain for Bazel 7.7+
# The DUMMY_GCC_TOOL needs to be an actual executable, not a path

diff --git a/rust/private/dummy_cc_toolchain/BUILD.bazel b/rust/private/dummy_cc_toolchain/BUILD.bazel
index 0d5f5f5d..8e8b9b9d 100644
--- a/rust/private/dummy_cc_toolchain/BUILD.bazel
+++ b/rust/private/dummy_cc_toolchain/BUILD.bazel
@@ -8,7 +8,7 @@ filegroup(

sh_binary(
name = "dummy_gcc_tool",
- srcs = ["DUMMY_GCC_TOOL"],
+ srcs = ["dummy_gcc_tool.sh"],
)

cc_toolchain(
diff --git a/rust/private/dummy_cc_toolchain/dummy_gcc_tool.sh b/rust/private/dummy_cc_toolchain/dummy_gcc_tool.sh
new file mode 100644
index 00000000..f1f641af
--- /dev/null
+++ b/rust/private/dummy_cc_toolchain/dummy_gcc_tool.sh
@@ -0,0 +1 @@
+#!/bin/bash
2 changes: 1 addition & 1 deletion bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def proxy_wasm_cpp_host_repositories():
# 13.8.258.26
commit = "de9d0f8b56ae61896e4d2ac577fc589efb14f87d",
remote = "https://chromium.googlesource.com/v8/v8",
shallow_since = "1752074621 -0400",
shallow_since = "1752074621",
patches = [
"@proxy_wasm_cpp_host//bazel/external:v8.patch",
],
Expand Down