diff --git a/.bazelrc b/.bazelrc index 5a037335..0b612212 100644 --- a/.bazelrc +++ b/.bazelrc @@ -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 diff --git a/bazel/external/bazel_clang_tidy.patch b/bazel/external/bazel_clang_tidy.patch index 82711d83..17cb9898 100644 --- a/bazel/external/bazel_clang_tidy.patch +++ b/bazel/external/bazel_clang_tidy.patch @@ -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("--") diff --git a/bazel/external/rules_rust.patch b/bazel/external/rules_rust.patch index a9a57c93..1af65f0b 100644 --- a/bazel/external/rules_rust.patch +++ b/bazel/external/rules_rust.patch @@ -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 diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 09939a70..68dbf213 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -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", ],