From 644e5e222f58f92dc8adc2b765fb7742350ca40a Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Sun, 18 Aug 2024 21:46:36 +0000 Subject: [PATCH 01/22] Compile with C++20 Signed-off-by: Michael Warres --- .bazelrc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.bazelrc b/.bazelrc index ab9a27f8..b05ba07b 100644 --- a/.bazelrc +++ b/.bazelrc @@ -80,10 +80,10 @@ build:zig-cc-linux-aarch64 --test_env=QEMU_LD_PREFIX=/usr/aarch64-linux-gnu/ build --enable_platform_specific_config -# Use C++17. -build:linux --cxxopt=-std=c++17 -build:macos --cxxopt=-std=c++17 -build:windows --cxxopt="/std:c++17" +# Use C++20. +build:linux --cxxopt=-std=c++20 +build:macos --cxxopt=-std=c++20 +build:windows --cxxopt="/std:c++20" # Enable symlinks and runfiles on Windows (enabled by default on other platforms). startup --windows_enable_symlinks From fdb5e9373f98146d497423f45aed5d1908131e06 Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Sun, 18 Aug 2024 22:17:10 +0000 Subject: [PATCH 02/22] Update googletest to v1.15.2 Signed-off-by: Michael Warres --- bazel/external/googletest.patch | 13 ------------- bazel/repositories.bzl | 8 +++----- 2 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 bazel/external/googletest.patch diff --git a/bazel/external/googletest.patch b/bazel/external/googletest.patch deleted file mode 100644 index 502ef58b..00000000 --- a/bazel/external/googletest.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/BUILD.bazel b/BUILD.bazel -index 8099642a85..3598661079 100644 ---- a/BUILD.bazel -+++ b/BUILD.bazel -@@ -40,7 +40,7 @@ exports_files(["LICENSE"]) - - config_setting( - name = "windows", -- constraint_values = ["@bazel_tools//platforms:windows"], -+ constraint_values = ["@platforms//os:windows"], - ) - - config_setting( diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 79e2fd59..d708483f 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -139,11 +139,9 @@ def proxy_wasm_cpp_host_repositories(): maybe( http_archive, name = "com_google_googletest", - sha256 = "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb", - strip_prefix = "googletest-release-1.10.0", - urls = ["https://github.com/google/googletest/archive/release-1.10.0.tar.gz"], - patches = ["@proxy_wasm_cpp_host//bazel/external:googletest.patch"], - patch_args = ["-p1"], + sha256 = "7b42b4d6ed48810c5362c265a17faebe90dc2373c885e5216439d37927f02926", + strip_prefix = "googletest-1.15.2", + urls = ["https://github.com/google/googletest/archive/refs/tags/v1.15.2.tar.gz"], ) # NullVM dependencies. From aab161168fc82282d124b00bafe6c6955f9ff08f Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Mon, 19 Aug 2024 01:45:48 +0000 Subject: [PATCH 03/22] Patch proxy-wasm-cpp-sdk to work around g++ -std=c++20 compilation issue Signed-off-by: Michael Warres --- bazel/external/proxy_wasm_cpp_sdk.patch | 33 +++++++++++++++++++++++++ bazel/repositories.bzl | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 bazel/external/proxy_wasm_cpp_sdk.patch diff --git a/bazel/external/proxy_wasm_cpp_sdk.patch b/bazel/external/proxy_wasm_cpp_sdk.patch new file mode 100644 index 00000000..c9ef490c --- /dev/null +++ b/bazel/external/proxy_wasm_cpp_sdk.patch @@ -0,0 +1,33 @@ +# Address g++ -std=c++20 variadic template compilation issue: +# https://github.com/proxy-wasm/proxy-wasm-cpp-host/pull/411#issuecomment-2295429152 + +diff --git a/proxy_wasm_api.h b/proxy_wasm_api.h +index 166b49c..263d2b9 100644 +--- a/proxy_wasm_api.h ++++ b/proxy_wasm_api.h +@@ -1207,7 +1207,7 @@ struct SimpleHistogram { + template struct Counter : public MetricBase { + static Counter *New(std::string_view name, MetricTagDescriptor... fieldnames); + +- Counter(std::string_view name, MetricTagDescriptor... descriptors) ++ Counter(std::string_view name, MetricTagDescriptor... descriptors) + : Counter(std::string(name), std::vector({toMetricTag(descriptors)...})) { + } + +@@ -1256,7 +1256,7 @@ inline Counter *Counter::New(std::string_view name, + template struct Gauge : public MetricBase { + static Gauge *New(std::string_view name, MetricTagDescriptor... fieldnames); + +- Gauge(std::string_view name, MetricTagDescriptor... descriptors) ++ Gauge(std::string_view name, MetricTagDescriptor... descriptors) + : Gauge(std::string(name), std::vector({toMetricTag(descriptors)...})) {} + + SimpleGauge resolve(Tags... f) { +@@ -1302,6 +1302,6 @@ inline Gauge *Gauge::New(std::string_view name, + template struct Histogram : public MetricBase { + static Histogram *New(std::string_view name, MetricTagDescriptor... fieldnames); + +- Histogram(std::string_view name, MetricTagDescriptor... descriptors) ++ Histogram(std::string_view name, MetricTagDescriptor... descriptors) + : Histogram(std::string(name), + std::vector({toMetricTag(descriptors)...})) {} diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index d708483f..373c25d0 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -132,6 +132,8 @@ def proxy_wasm_cpp_host_repositories(): sha256 = "89792fc1abca331f29f99870476a04146de5e82ff903bdffca90e6729c1f2470", strip_prefix = "proxy-wasm-cpp-sdk-95bb82ce45c41d9100fd1ec15d2ffc67f7f3ceee", urls = ["https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/archive/95bb82ce45c41d9100fd1ec15d2ffc67f7f3ceee.tar.gz"], + patches = ["@proxy_wasm_cpp_host//bazel/external:proxy_wasm_cpp_sdk.patch"], + patch_args = ["-p1"], ) # Test dependencies. From 749ebf8b77d3ccf239fa8ed0bdf49b6e57c91508 Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Mon, 19 Aug 2024 02:48:26 +0000 Subject: [PATCH 04/22] Add temporary workaround for #412 Signed-off-by: Michael Warres --- test/utility.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/utility.h b/test/utility.h index 27b3b049..be60d321 100644 --- a/test/utility.h +++ b/test/utility.h @@ -197,4 +197,7 @@ class TestVm : public testing::TestWithParam { std::string engine_; }; +// TODO: remove when #412 is fixed. +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TestVm); + } // namespace proxy_wasm From fc7a80b87e777cf0e7451d52619d1825e5cf3e28 Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Mon, 19 Aug 2024 15:56:11 +0000 Subject: [PATCH 05/22] Add -fno-sanitize=unsigned-integer-overflow to clang asan options Signed-off-by: Michael Warres --- .bazelrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.bazelrc b/.bazelrc index b05ba07b..c21135e4 100644 --- a/.bazelrc +++ b/.bazelrc @@ -28,6 +28,7 @@ build:clang-asan --copt -DADDRESS_SANITIZER=1 build:clang-asan --copt -DUNDEFINED_SANITIZER=1 build:clang-asan --copt -fsanitize=address,undefined build:clang-asan --copt -fsanitize-address-use-after-scope +build:clang-asan --copt -fno-sanitize=unsigned-integer-overflow build:clang-asan --linkopt -fsanitize=address,undefined build:clang-asan --linkopt -fsanitize-address-use-after-scope build:clang-asan --test_env=ASAN_OPTIONS=check_initialization_order=1:detect_stack_use_after_return=1:strict_init_order=1:strict_string_checks=1 From c2f810279e5914edb249ba90aef1fab9d8863a5f Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Mon, 19 Aug 2024 15:59:37 +0000 Subject: [PATCH 06/22] Disable clang-tidy clang-diagnostic-builtin-macro-redefined check Signed-off-by: Michael Warres --- .clang-tidy | 1 + 1 file changed, 1 insertion(+) diff --git a/.clang-tidy b/.clang-tidy index ceab9ad4..ea657db5 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -19,5 +19,6 @@ Checks: clang-*, -readability-magic-numbers, -readability-make-member-function-const, -readability-simplify-boolean-expr, + -clang-diagnostic-builtin-macro-redefined, WarningsAsErrors: '*' From d7d6af73bd16cf6abf7383f7b1382b06c89f923d Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Mon, 19 Aug 2024 16:17:50 +0000 Subject: [PATCH 07/22] Change asan config for NullVM and Wasmtime from clang-asan-strict to clang-asan Signed-off-by: Michael Warres --- .bazelrc | 1 - .github/workflows/test.yml | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.bazelrc b/.bazelrc index c21135e4..b05ba07b 100644 --- a/.bazelrc +++ b/.bazelrc @@ -28,7 +28,6 @@ build:clang-asan --copt -DADDRESS_SANITIZER=1 build:clang-asan --copt -DUNDEFINED_SANITIZER=1 build:clang-asan --copt -fsanitize=address,undefined build:clang-asan --copt -fsanitize-address-use-after-scope -build:clang-asan --copt -fno-sanitize=unsigned-integer-overflow build:clang-asan --linkopt -fsanitize=address,undefined build:clang-asan --linkopt -fsanitize-address-use-after-scope build:clang-asan --test_env=ASAN_OPTIONS=check_initialization_order=1:detect_stack_use_after_return=1:strict_init_order=1:strict_string_checks=1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 66ec91bf..548c099a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -118,7 +118,7 @@ jobs: os: ubuntu-22.04 arch: x86_64 action: test - flags: --config=clang-asan-strict --define=crypto=system + flags: --config=clang-asan --define=crypto=system - name: 'NullVM on Linux/x86_64 with TSan' engine: 'null' os: ubuntu-22.04 @@ -235,7 +235,7 @@ jobs: os: ubuntu-22.04 arch: x86_64 action: test - flags: --config=clang-asan-strict --define=crypto=system + flags: --config=clang-asan --define=crypto=system - name: 'Wasmtime on Linux/aarch64' engine: 'wasmtime' repo: 'com_github_bytecodealliance_wasmtime' From 509217905d51ead55c2cd40b179c7b3ce3aa4114 Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Thu, 15 Aug 2024 21:59:53 +0000 Subject: [PATCH 08/22] v8: update to 12.7.224.18 - Update v8.patch - Remove v8_include.patch which is no longer needed - Remove dependency on chromium_base_trace_event_common Signed-off-by: Michael Warres --- bazel/external/v8.patch | 43 ++++----------------------------- bazel/external/v8_include.patch | 41 ------------------------------- bazel/repositories.bzl | 21 +++------------- 3 files changed, 8 insertions(+), 97 deletions(-) delete mode 100644 bazel/external/v8_include.patch diff --git a/bazel/external/v8.patch b/bazel/external/v8.patch index 58e7f9ba..393c1b6c 100644 --- a/bazel/external/v8.patch +++ b/bazel/external/v8.patch @@ -1,13 +1,11 @@ # 1. Disable pointer compression (limits the maximum number of WasmVMs). # 2. Don't expose Wasm C API (only Wasm C++ API). -# 3. Fix gcc build error by disabling nonnull warning. -# 4. Allow compiling v8 on macOS 10.15 to 13.0. TODO(dio): Will remove this patch when https://bugs.chromium.org/p/v8/issues/detail?id=13428 is fixed. diff --git a/BUILD.bazel b/BUILD.bazel -index 4e89f90e7e..3fcb38b3f3 100644 +index 30be47fa333..d03d1e4d522 100644 --- a/BUILD.bazel +++ b/BUILD.bazel -@@ -157,7 +157,7 @@ v8_int( +@@ -220,7 +220,7 @@ v8_int( # If no explicit value for v8_enable_pointer_compression, we set it to 'none'. v8_string( name = "v8_enable_pointer_compression", @@ -16,42 +14,11 @@ index 4e89f90e7e..3fcb38b3f3 100644 ) # Default setting for v8_enable_pointer_compression. -diff --git a/bazel/defs.bzl b/bazel/defs.bzl -index e957c0fad3..063627b72b 100644 ---- a/bazel/defs.bzl -+++ b/bazel/defs.bzl -@@ -131,6 +131,7 @@ def _default_args(): - "-Wno-redundant-move", - "-Wno-return-type", - "-Wno-stringop-overflow", -+ "-Wno-nonnull", - # Use GNU dialect, because GCC doesn't allow using - # ##__VA_ARGS__ when in standards-conforming mode. - "-std=gnu++17", -@@ -151,6 +152,18 @@ def _default_args(): - "-fno-integrated-as", - ], - "//conditions:default": [], -+ }) + select({ -+ "@v8//bazel/config:is_macos": [ -+ # The clang available on macOS catalina has a warning that isn't clean on v8 code. -+ "-Wno-range-loop-analysis", -+ -+ # To supress warning on deprecated declaration on v8 code. For example: -+ # external/v8/src/base/platform/platform-darwin.cc:56:22: 'getsectdatafromheader_64' -+ # is deprecated: first deprecated in macOS 13.0. -+ # https://bugs.chromium.org/p/v8/issues/detail?id=13428. -+ "-Wno-deprecated-declarations", -+ ], -+ "//conditions:default": [], - }), - includes = ["include"], - linkopts = select({ diff --git a/src/wasm/c-api.cc b/src/wasm/c-api.cc -index 4473e205c0..65a6ec7e1d 100644 +index 2d6d0f6c270..61d071acd52 100644 --- a/src/wasm/c-api.cc +++ b/src/wasm/c-api.cc -@@ -2247,6 +2247,8 @@ auto Instance::exports() const -> ownvec { +@@ -2360,6 +2360,8 @@ auto Instance::exports() const -> ownvec { } // namespace wasm @@ -60,7 +27,7 @@ index 4473e205c0..65a6ec7e1d 100644 // BEGIN FILE wasm-c.cc extern "C" { -@@ -3274,3 +3276,5 @@ wasm_instance_t* wasm_frame_instance(const wasm_frame_t* frame) { +@@ -3386,3 +3388,5 @@ wasm_instance_t* wasm_frame_instance(const wasm_frame_t* frame) { #undef WASM_DEFINE_SHARABLE_REF } // extern "C" diff --git a/bazel/external/v8_include.patch b/bazel/external/v8_include.patch deleted file mode 100644 index 0d0fe210..00000000 --- a/bazel/external/v8_include.patch +++ /dev/null @@ -1,41 +0,0 @@ -# fix include types for late clang (15.0.7) / gcc (13.2.1) -# for Arch linux / Fedora, like in -# In file included from external/v8/src/torque/torque.cc:5: -# In file included from external/v8/src/torque/source-positions.h:10: -# In file included from external/v8/src/torque/contextual.h:10: -# In file included from external/v8/src/base/macros.h:12: -# external/v8/src/base/logging.h:154:26: error: use of undeclared identifier 'uint16_t' - -diff --git a/src/base/logging.h b/src/base/logging.h ---- a/src/base/logging.h -+++ b/src/base/logging.h -@@ -5,6 +5,7 @@ - #ifndef V8_BASE_LOGGING_H_ - #define V8_BASE_LOGGING_H_ - -+#include - #include - #include - #include -diff --git a/src/base/macros.h b/src/base/macros.h ---- a/src/base/macros.h -+++ b/src/base/macros.h -@@ -5,6 +5,7 @@ - #ifndef V8_BASE_MACROS_H_ - #define V8_BASE_MACROS_H_ - -+#include - #include - #include - -diff --git a/src/inspector/v8-string-conversions.h b/src/inspector/v8-string-conversions.h ---- a/src/inspector/v8-string-conversions.h -+++ b/src/inspector/v8-string-conversions.h -@@ -5,6 +5,7 @@ - #ifndef V8_INSPECTOR_V8_STRING_CONVERSIONS_H_ - #define V8_INSPECTOR_V8_STRING_CONVERSIONS_H_ - -+#include - #include - - // Conversion routines between UT8 and UTF16, used by string-16.{h,cc}. You may diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 373c25d0..b53f0047 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -161,13 +161,12 @@ def proxy_wasm_cpp_host_repositories(): maybe( git_repository, name = "v8", - # 10.7.193.13 - commit = "6c8b357a84847a479cd329478522feefc1c3195a", + # 12.7.224.18 + commit = "503eb7e9a50b0211f8db54ea362ea06ef56c940d", remote = "https://chromium.googlesource.com/v8/v8", - shallow_since = "1664374400 +0000", + shallow_since = "1722877350 -0400", patches = [ "@proxy_wasm_cpp_host//bazel/external:v8.patch", - "@proxy_wasm_cpp_host//bazel/external:v8_include.patch", ], patch_args = ["-p1"], ) @@ -177,20 +176,6 @@ def proxy_wasm_cpp_host_repositories(): actual = "@v8//:wee8", ) - maybe( - new_git_repository, - name = "com_googlesource_chromium_base_trace_event_common", - build_file = "@v8//:bazel/BUILD.trace_event_common", - commit = "521ac34ebd795939c7e16b37d9d3ddb40e8ed556", - remote = "https://chromium.googlesource.com/chromium/src/base/trace_event/common.git", - shallow_since = "1662508800 +0000", - ) - - native.bind( - name = "base_trace_event_common", - actual = "@com_googlesource_chromium_base_trace_event_common//:trace_event_common", - ) - # WAMR with dependencies. maybe( From ce012d6089b4f82079e824b2f645de372125369d Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Fri, 16 Aug 2024 15:10:46 +0000 Subject: [PATCH 09/22] Update v8.patch to revert v8 commit b26554ec368e9553782012c96aa5e99b163eaff2 This re-adds the use of _allowlist_function_transition, which is needed by Bazel 6.5.0. Signed-off-by: Michael Warres --- bazel/external/v8.patch | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/bazel/external/v8.patch b/bazel/external/v8.patch index 393c1b6c..f930efeb 100644 --- a/bazel/external/v8.patch +++ b/bazel/external/v8.patch @@ -1,5 +1,8 @@ # 1. Disable pointer compression (limits the maximum number of WasmVMs). # 2. Don't expose Wasm C API (only Wasm C++ API). +# 3. Revert v8 commit b26554ec368e9553782012c96aa5e99b163eaff2, which removed +# use of _allowlist_function_transition from v8 bazel/defs.bzl, since it is +# still required by the version of Bazel we currently use (6.5.0). diff --git a/BUILD.bazel b/BUILD.bazel index 30be47fa333..d03d1e4d522 100644 @@ -14,6 +17,42 @@ index 30be47fa333..d03d1e4d522 100644 ) # Default setting for v8_enable_pointer_compression. +diff --git a/bazel/defs.bzl b/bazel/defs.bzl +index 520a311595e..246c4ecf27a 100644 +--- a/bazel/defs.bzl ++++ b/bazel/defs.bzl +@@ -480,6 +480,9 @@ _v8_mksnapshot = rule( + cfg = "exec", + ), + "target_os": attr.string(mandatory = True), ++ "_allowlist_function_transition": attr.label( ++ default = "@bazel_tools//tools/allowlists/function_transition_allowlist", ++ ), + "prefix": attr.string(mandatory = True), + "suffix": attr.string(mandatory = True), + }, +diff --git a/bazel/v8-non-pointer-compression.bzl b/bazel/v8-non-pointer-compression.bzl +index 8c929454840..57336154cf7 100644 +--- a/bazel/v8-non-pointer-compression.bzl ++++ b/bazel/v8-non-pointer-compression.bzl +@@ -47,6 +47,17 @@ v8_binary_non_pointer_compression = rule( + # Note specificaly how it's configured with v8_target_cpu_transition, which + # ensures that setting propagates down the graph. + "binary": attr.label(cfg = v8_disable_pointer_compression), ++ # This is a stock Bazel requirement for any rule that uses Starlark ++ # transitions. It's okay to copy the below verbatim for all such rules. ++ # ++ # The purpose of this requirement is to give the ability to restrict ++ # which packages can invoke these rules, since Starlark transitions ++ # make much larger graphs possible that can have memory and performance ++ # consequences for your build. The whitelist defaults to "everything". ++ # But you can redefine it more strictly if you feel that's prudent. ++ "_allowlist_function_transition": attr.label( ++ default = "@bazel_tools//tools/allowlists/function_transition_allowlist", ++ ), + }, + # Making this executable means it works with "$ bazel run". + executable = True, diff --git a/src/wasm/c-api.cc b/src/wasm/c-api.cc index 2d6d0f6c270..61d071acd52 100644 --- a/src/wasm/c-api.cc From 4614adf739e486980ab9d034ca8ec6f05c72b20d Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Fri, 16 Aug 2024 18:28:10 +0000 Subject: [PATCH 10/22] Bind absl_* build targets referenced by v8 build rules Signed-off-by: Michael Warres --- bazel/repositories.bzl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index b53f0047..b3b7c8a8 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -176,6 +176,26 @@ def proxy_wasm_cpp_host_repositories(): actual = "@v8//:wee8", ) + native.bind( + name = "absl_optional", + actual = "@com_google_absl//absl/types:optional", + ) + + native.bind( + name = "absl_btree", + actual = "@com_google_absl//absl/container:btree", + ) + + native.bind( + name = "absl_flat_hash_map", + actual = "@com_google_absl//absl/container:flat_hash_map", + ) + + native.bind( + name = "absl_flat_hash_set", + actual = "@com_google_absl//absl/container:flat_hash_set", + ) + # WAMR with dependencies. maybe( From ef3558a1373d72e8ac1729f9a0063f0b05379d02 Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Fri, 16 Aug 2024 19:52:51 +0000 Subject: [PATCH 11/22] Fetch fp16 dependency of v8, and patch v8 to find it Signed-off-by: Michael Warres --- bazel/external/v8.patch | 23 ++++++++++++++++++++++- bazel/repositories.bzl | 8 ++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/bazel/external/v8.patch b/bazel/external/v8.patch index f930efeb..7c15ad65 100644 --- a/bazel/external/v8.patch +++ b/bazel/external/v8.patch @@ -3,9 +3,11 @@ # 3. Revert v8 commit b26554ec368e9553782012c96aa5e99b163eaff2, which removed # use of _allowlist_function_transition from v8 bazel/defs.bzl, since it is # still required by the version of Bazel we currently use (6.5.0). +# 4. Tweak where v8 looks for its fp16 dependency, since it isn't downloaded by +# gn. diff --git a/BUILD.bazel b/BUILD.bazel -index 30be47fa333..d03d1e4d522 100644 +index 30be47fa333..093599d47df 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -220,7 +220,7 @@ v8_int( @@ -17,6 +19,25 @@ index 30be47fa333..d03d1e4d522 100644 ) # Default setting for v8_enable_pointer_compression. +@@ -3698,13 +3698,14 @@ filegroup( + + v8_library( + name = "lib_fp16", +- srcs = ["third_party/fp16/src/include/fp16.h"], ++ srcs = ["@fp16//:include/fp16.h"], + hdrs = [ +- "third_party/fp16/src/include/fp16/fp16.h", +- "third_party/fp16/src/include/fp16/bitcasts.h", ++ "@fp16//:include/fp16/fp16.h", ++ "@fp16//:include/fp16/bitcasts.h", + ], ++ include_prefix = "third_party/fp16/src", + includes = [ +- "third_party/fp16/src/include", ++ "@fp16//:include", + ], + ) + diff --git a/bazel/defs.bzl b/bazel/defs.bzl index 520a311595e..246c4ecf27a 100644 --- a/bazel/defs.bzl diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index b3b7c8a8..eeffe096 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -196,6 +196,14 @@ def proxy_wasm_cpp_host_repositories(): actual = "@com_google_absl//absl/container:flat_hash_set", ) + maybe( + git_repository, + name = "fp16", + commit = "0a92994d729ff76a58f692d3028ca1b64b145d91", + build_file_content = "exports_files(glob([\"**\"]))", + remote = "https://chromium.googlesource.com/external/github.com/Maratyszcza/FP16.git", + ) + # WAMR with dependencies. maybe( From 7a25b87a68665a6ef4e745f8832463d7d53be7ec Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Fri, 16 Aug 2024 20:13:07 +0000 Subject: [PATCH 12/22] Set torque generator path to location where Bazel can find outputs Signed-off-by: Michael Warres --- bazel/external/v8.patch | 78 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 2 deletions(-) diff --git a/bazel/external/v8.patch b/bazel/external/v8.patch index 7c15ad65..a2643e05 100644 --- a/bazel/external/v8.patch +++ b/bazel/external/v8.patch @@ -5,6 +5,7 @@ # still required by the version of Bazel we currently use (6.5.0). # 4. Tweak where v8 looks for its fp16 dependency, since it isn't downloaded by # gn. +# 5. Set torque generator path to location where Bazel can find outputs. diff --git a/BUILD.bazel b/BUILD.bazel index 30be47fa333..093599d47df 100644 @@ -39,10 +40,72 @@ index 30be47fa333..093599d47df 100644 ) diff --git a/bazel/defs.bzl b/bazel/defs.bzl -index 520a311595e..246c4ecf27a 100644 +index 520a311595e..06cc7806203 100644 --- a/bazel/defs.bzl +++ b/bazel/defs.bzl -@@ -480,6 +480,9 @@ _v8_mksnapshot = rule( +@@ -6,8 +6,10 @@ + This module contains helper functions to compile V8. + """ + +-FlagInfo = provider("The value of an option.", +-fields = ["value"]) ++FlagInfo = provider( ++ "The value of an option.", ++ fields = ["value"], ++) + + def _options_impl(ctx): + return FlagInfo(value = ctx.build_setting_value) +@@ -109,7 +111,7 @@ def _default_args(): + "-Werror", + "-Wextra", + "-Wno-unneeded-internal-declaration", +- "-Wno-unknown-warning-option", # b/330781959 ++ "-Wno-unknown-warning-option", # b/330781959 + "-Wno-cast-function-type-mismatch", # b/330781959 + "-Wno-bitwise-instead-of-logical", + "-Wno-builtin-assume-aligned-alignment", +@@ -160,7 +162,7 @@ def _default_args(): + "-fno-integrated-as", + ], + "//conditions:default": [], +- }) + select({ ++ }) + select({ + "@v8//bazel/config:is_opt_android": [ + "-fvisibility=hidden", + "-fvisibility-inlines-hidden", +@@ -192,7 +194,7 @@ ENABLE_I18N_SUPPORT_DEFINES = [ + ] + + def _should_emit_noicu_and_icu(noicu_srcs, noicu_deps, noicu_defines, icu_srcs, icu_deps, icu_defines): +- return noicu_srcs != [] or noicu_deps != [] or noicu_defines != [] or icu_srcs != [] or icu_deps != [] or icu_defines != [] ++ return noicu_srcs != [] or noicu_deps != [] or noicu_defines != [] or icu_srcs != [] or icu_deps != [] or icu_defines != [] + + # buildifier: disable=function-docstring + def v8_binary( +@@ -316,7 +318,7 @@ def v8_library( + # split the set of outputs by using OutputGroupInfo, that way we do not need to + # run the torque generator twice. + def _torque_files_impl(ctx): +- v8root = "." ++ v8root = "external/v8" + + # Arguments + args = [] +@@ -408,9 +410,9 @@ def v8_torque_files(name, noicu_srcs, icu_srcs, args, definition_extras, initial + }), + ) + +-def _v8_target_cpu_transition_impl(settings, +- attr, # @unused +- ): ++def _v8_target_cpu_transition_impl( ++ settings, ++ attr): # @unused + # Check for an existing v8_target_cpu flag. + if "@v8//bazel/config:v8_target_cpu" in settings: + if settings["@v8//bazel/config:v8_target_cpu"] != "none": +@@ -480,6 +482,9 @@ _v8_mksnapshot = rule( cfg = "exec", ), "target_os": attr.string(mandatory = True), @@ -52,6 +115,17 @@ index 520a311595e..246c4ecf27a 100644 "prefix": attr.string(mandatory = True), "suffix": attr.string(mandatory = True), }, +@@ -529,8 +534,8 @@ def _json(kv_pairs): + + def build_config_content(cpu, icu): + arch = cpu +- if cpu == 'x86': +- arch = 'ia32' ++ if cpu == "x86": ++ arch = "ia32" + return _json([ + ("arch", arch), + ("asan", "false"), diff --git a/bazel/v8-non-pointer-compression.bzl b/bazel/v8-non-pointer-compression.bzl index 8c929454840..57336154cf7 100644 --- a/bazel/v8-non-pointer-compression.bzl From a65d5e91858083a8c55e62569df5b64e2955920d Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Fri, 16 Aug 2024 20:33:50 +0000 Subject: [PATCH 13/22] Tolerate deprecated declarations in v8 Signed-off-by: Michael Warres --- .bazelrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.bazelrc b/.bazelrc index b05ba07b..bbd4e935 100644 --- a/.bazelrc +++ b/.bazelrc @@ -6,6 +6,9 @@ build --action_env=CC build --action_env=CXX build --action_env=PATH +# Tolerate deprecation warnings in v8 +build --per_file_copt='external/v8/.*@-Wno-deprecated-declarations' + # Use Clang compiler. build:clang --action_env=BAZEL_COMPILER=clang build:clang --action_env=CC=clang From bf4df288d82e6462c9aaaa9544575d8688856e10 Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Fri, 16 Aug 2024 21:50:34 +0000 Subject: [PATCH 14/22] Build with C++20, and take 2 at compiling v8 with -Wno-deprecated-declarations Signed-off-by: Michael Warres --- .bazelrc | 3 -- bazel/external/v8.patch | 86 ++++++++++------------------------------- 2 files changed, 21 insertions(+), 68 deletions(-) diff --git a/.bazelrc b/.bazelrc index bbd4e935..b05ba07b 100644 --- a/.bazelrc +++ b/.bazelrc @@ -6,9 +6,6 @@ build --action_env=CC build --action_env=CXX build --action_env=PATH -# Tolerate deprecation warnings in v8 -build --per_file_copt='external/v8/.*@-Wno-deprecated-declarations' - # Use Clang compiler. build:clang --action_env=BAZEL_COMPILER=clang build:clang --action_env=CC=clang diff --git a/bazel/external/v8.patch b/bazel/external/v8.patch index a2643e05..8aa1ff2b 100644 --- a/bazel/external/v8.patch +++ b/bazel/external/v8.patch @@ -6,6 +6,7 @@ # 4. Tweak where v8 looks for its fp16 dependency, since it isn't downloaded by # gn. # 5. Set torque generator path to location where Bazel can find outputs. +# 6. Compile v8 with -Wno-deprecated-declarations diff --git a/BUILD.bazel b/BUILD.bazel index 30be47fa333..093599d47df 100644 @@ -40,50 +41,29 @@ index 30be47fa333..093599d47df 100644 ) diff --git a/bazel/defs.bzl b/bazel/defs.bzl -index 520a311595e..06cc7806203 100644 +index 520a311595e..64b4928abe5 100644 --- a/bazel/defs.bzl +++ b/bazel/defs.bzl -@@ -6,8 +6,10 @@ - This module contains helper functions to compile V8. - """ - --FlagInfo = provider("The value of an option.", --fields = ["value"]) -+FlagInfo = provider( -+ "The value of an option.", -+ fields = ["value"], -+) - - def _options_impl(ctx): - return FlagInfo(value = ctx.build_setting_value) -@@ -109,7 +111,7 @@ def _default_args(): - "-Werror", - "-Wextra", - "-Wno-unneeded-internal-declaration", -- "-Wno-unknown-warning-option", # b/330781959 -+ "-Wno-unknown-warning-option", # b/330781959 - "-Wno-cast-function-type-mismatch", # b/330781959 - "-Wno-bitwise-instead-of-logical", - "-Wno-builtin-assume-aligned-alignment", -@@ -160,7 +162,7 @@ def _default_args(): - "-fno-integrated-as", +@@ -102,7 +102,9 @@ def _default_args(): ], "//conditions:default": [], -- }) + select({ -+ }) + select({ - "@v8//bazel/config:is_opt_android": [ - "-fvisibility=hidden", - "-fvisibility-inlines-hidden", -@@ -192,7 +194,7 @@ ENABLE_I18N_SUPPORT_DEFINES = [ - ] - - def _should_emit_noicu_and_icu(noicu_srcs, noicu_deps, noicu_defines, icu_srcs, icu_deps, icu_defines): -- return noicu_srcs != [] or noicu_deps != [] or noicu_defines != [] or icu_srcs != [] or icu_deps != [] or icu_defines != [] -+ return noicu_srcs != [] or noicu_deps != [] or noicu_defines != [] or icu_srcs != [] or icu_deps != [] or icu_defines != [] - - # buildifier: disable=function-docstring - def v8_binary( -@@ -316,7 +318,7 @@ def v8_library( + }), +- copts = select({ ++ copts = [ ++ "-Wno-deprecated-declarations", ++ ] + select({ + "@v8//bazel/config:is_posix": [ + "-fPIC", + "-fno-strict-aliasing", +@@ -131,7 +133,6 @@ def _default_args(): + "-Wno-array-bounds", + "-Wno-class-memaccess", + "-Wno-comments", +- "-Wno-deprecated-declarations", + "-Wno-implicit-fallthrough", + "-Wno-int-in-bool-context", + "-Wno-maybe-uninitialized", +@@ -316,7 +317,7 @@ def v8_library( # split the set of outputs by using OutputGroupInfo, that way we do not need to # run the torque generator twice. def _torque_files_impl(ctx): @@ -92,20 +72,7 @@ index 520a311595e..06cc7806203 100644 # Arguments args = [] -@@ -408,9 +410,9 @@ def v8_torque_files(name, noicu_srcs, icu_srcs, args, definition_extras, initial - }), - ) - --def _v8_target_cpu_transition_impl(settings, -- attr, # @unused -- ): -+def _v8_target_cpu_transition_impl( -+ settings, -+ attr): # @unused - # Check for an existing v8_target_cpu flag. - if "@v8//bazel/config:v8_target_cpu" in settings: - if settings["@v8//bazel/config:v8_target_cpu"] != "none": -@@ -480,6 +482,9 @@ _v8_mksnapshot = rule( +@@ -480,6 +481,9 @@ _v8_mksnapshot = rule( cfg = "exec", ), "target_os": attr.string(mandatory = True), @@ -115,17 +82,6 @@ index 520a311595e..06cc7806203 100644 "prefix": attr.string(mandatory = True), "suffix": attr.string(mandatory = True), }, -@@ -529,8 +534,8 @@ def _json(kv_pairs): - - def build_config_content(cpu, icu): - arch = cpu -- if cpu == 'x86': -- arch = 'ia32' -+ if cpu == "x86": -+ arch = "ia32" - return _json([ - ("arch", arch), - ("asan", "false"), diff --git a/bazel/v8-non-pointer-compression.bzl b/bazel/v8-non-pointer-compression.bzl index 8c929454840..57336154cf7 100644 --- a/bazel/v8-non-pointer-compression.bzl From 42d7ee7b1b4f34f58921d56546b0b71e20e8258f Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Fri, 16 Aug 2024 22:31:35 +0000 Subject: [PATCH 15/22] Fix tweak to where v8 looks for its fp16 dependency Signed-off-by: Michael Warres --- bazel/external/v8.patch | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/bazel/external/v8.patch b/bazel/external/v8.patch index 8aa1ff2b..71f43f06 100644 --- a/bazel/external/v8.patch +++ b/bazel/external/v8.patch @@ -9,7 +9,7 @@ # 6. Compile v8 with -Wno-deprecated-declarations diff --git a/BUILD.bazel b/BUILD.bazel -index 30be47fa333..093599d47df 100644 +index 30be47fa333..23cfc9c4754 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -220,7 +220,7 @@ v8_int( @@ -21,25 +21,35 @@ index 30be47fa333..093599d47df 100644 ) # Default setting for v8_enable_pointer_compression. -@@ -3698,13 +3698,14 @@ filegroup( +@@ -3698,14 +3698,22 @@ filegroup( v8_library( name = "lib_fp16", - srcs = ["third_party/fp16/src/include/fp16.h"], -+ srcs = ["@fp16//:include/fp16.h"], - hdrs = [ +- hdrs = [ - "third_party/fp16/src/include/fp16/fp16.h", - "third_party/fp16/src/include/fp16/bitcasts.h", -+ "@fp16//:include/fp16/fp16.h", -+ "@fp16//:include/fp16/bitcasts.h", - ], ++ hdrs = ["@fp16//:include/fp16.h"], ++ srcs = [], + include_prefix = "third_party/fp16/src", - includes = [ ++ deps = [ ++ "lib_fp16_includes", + ], +- includes = [ - "third_party/fp16/src/include", -+ "@fp16//:include", ++) ++ ++v8_library( ++ name = "lib_fp16_includes", ++ hdrs = [ ++ "@fp16//:include/fp16/fp16.h", ++ "@fp16//:include/fp16/bitcasts.h", ], ++ srcs = [], ++ strip_include_prefix = "include", ) + filegroup( diff --git a/bazel/defs.bzl b/bazel/defs.bzl index 520a311595e..64b4928abe5 100644 --- a/bazel/defs.bzl From 93358c2017b01f621224af68b080d97bbf8ab241 Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Mon, 19 Aug 2024 18:31:29 +0000 Subject: [PATCH 16/22] Additionally specify --host_cxxopt=-std=c++20 This isn't strictly necessary in this PR for CI to pass, however I encountered a need for it in child PR #409, and seemed more appropriate to add here. Signed-off-by: Michael Warres --- .bazelrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.bazelrc b/.bazelrc index b05ba07b..6e130159 100644 --- a/.bazelrc +++ b/.bazelrc @@ -81,9 +81,9 @@ build:zig-cc-linux-aarch64 --test_env=QEMU_LD_PREFIX=/usr/aarch64-linux-gnu/ build --enable_platform_specific_config # Use C++20. -build:linux --cxxopt=-std=c++20 -build:macos --cxxopt=-std=c++20 -build:windows --cxxopt="/std:c++20" +build:linux --cxxopt=-std=c++20 --host_cxxopt=-std=c++20 +build:macos --cxxopt=-std=c++20 --host_cxxopt=-std=c++20 +build:windows --cxxopt="/std:c++20" --host_cxxopt="/std:c++20" # Enable symlinks and runfiles on Windows (enabled by default on other platforms). startup --windows_enable_symlinks From 394f07512f6ceda51016b90b2bfb86fd5e6ba7ec Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Mon, 19 Aug 2024 18:41:30 +0000 Subject: [PATCH 17/22] Specify -Wno-invalid-offsetof for gcc builds Signed-off-by: Michael Warres --- .bazelrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.bazelrc b/.bazelrc index 6e130159..205a2f7b 100644 --- a/.bazelrc +++ b/.bazelrc @@ -65,6 +65,7 @@ build:clang-tidy --output_groups=report build:gcc --action_env=BAZEL_COMPILER=gcc build:gcc --action_env=CC=gcc build:gcc --action_env=CXX=g++ +build:gcc --copt -Wno-invalid-offsetof # Use Zig C/C++ compiler. build:zig-cc --incompatible_enable_cc_toolchain_resolution From e5407f4b16160f13430fc04e08a10b23ce87d11d Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Mon, 19 Aug 2024 20:04:36 +0000 Subject: [PATCH 18/22] Cherrypick V8 commit 35888fee7bbaaaf1f02ccc88a95c9a336fc790bc to address gcc build failure Signed-off-by: Michael Warres --- bazel/external/v8.patch | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/bazel/external/v8.patch b/bazel/external/v8.patch index 71f43f06..b8e16c0b 100644 --- a/bazel/external/v8.patch +++ b/bazel/external/v8.patch @@ -7,9 +7,11 @@ # gn. # 5. Set torque generator path to location where Bazel can find outputs. # 6. Compile v8 with -Wno-deprecated-declarations +# 7. Cherrypick V8 commit 35888fee7bbaaaf1f02ccc88a95c9a336fc790bc to fix gcc +# build error. diff --git a/BUILD.bazel b/BUILD.bazel -index 30be47fa333..23cfc9c4754 100644 +index 30be47fa333..72de2d422ca 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -220,7 +220,7 @@ v8_int( @@ -114,6 +116,31 @@ index 8c929454840..57336154cf7 100644 }, # Making this executable means it works with "$ bazel run". executable = True, +diff --git a/src/base/macros.h b/src/base/macros.h +index 794505278e1..890365bf3ae 100644 +--- a/src/base/macros.h ++++ b/src/base/macros.h +@@ -182,7 +182,7 @@ namespace base { + // base::is_trivially_copyable will differ for these cases. + template + struct is_trivially_copyable { +-#if V8_CC_MSVC ++#if V8_CC_MSVC || (__GNUC__ == 12 && __GNUC_MINOR__ <= 2) + // Unfortunately, MSVC 2015 is broken in that std::is_trivially_copyable can + // be false even though it should be true according to the standard. + // (status at 2018-02-26, observed on the msvc waterfall bot). +@@ -190,6 +190,11 @@ struct is_trivially_copyable { + // intended, so we reimplement this according to the standard. + // See also https://developercommunity.visualstudio.com/content/problem/ + // 170883/msvc-type-traits-stdis-trivial-is-bugged.html. ++ // ++ // GCC 12.1 and 12.2 are broken too, they are shipped by some stable Linux ++ // distributions, so the same polyfill is also used. ++ // See ++ // https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=aeba3e009b0abfccaf01797556445dbf891cc8dc + static constexpr bool value = + // Copy constructor is trivial or deleted. + (std::is_trivially_copy_constructible::value || diff --git a/src/wasm/c-api.cc b/src/wasm/c-api.cc index 2d6d0f6c270..61d071acd52 100644 --- a/src/wasm/c-api.cc From c4500ac47c146e4e2c6bf6c1d4c8d9f418404d45 Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Mon, 19 Aug 2024 20:40:04 +0000 Subject: [PATCH 19/22] Use --cxxopt instead of --copt to specify -Wno-invalid-offsetof Signed-off-by: Michael Warres --- .bazelrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index 205a2f7b..bd258091 100644 --- a/.bazelrc +++ b/.bazelrc @@ -65,7 +65,7 @@ build:clang-tidy --output_groups=report build:gcc --action_env=BAZEL_COMPILER=gcc build:gcc --action_env=CC=gcc build:gcc --action_env=CXX=g++ -build:gcc --copt -Wno-invalid-offsetof +build:gcc --cxxopt -Wno-invalid-offsetof # Use Zig C/C++ compiler. build:zig-cc --incompatible_enable_cc_toolchain_resolution From 8f34e8f31122a40b66aa4a937c3d370d75eea93c Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Mon, 19 Aug 2024 21:20:56 +0000 Subject: [PATCH 20/22] Add -Wno-deprecated to gcc cxxopt Signed-off-by: Michael Warres --- .bazelrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index bd258091..8650d599 100644 --- a/.bazelrc +++ b/.bazelrc @@ -65,7 +65,7 @@ build:clang-tidy --output_groups=report build:gcc --action_env=BAZEL_COMPILER=gcc build:gcc --action_env=CC=gcc build:gcc --action_env=CXX=g++ -build:gcc --cxxopt -Wno-invalid-offsetof +build:gcc --cxxopt -Wno-invalid-offsetof -Wno-deprecated # Use Zig C/C++ compiler. build:zig-cc --incompatible_enable_cc_toolchain_resolution From d4eec14fe2b972d572b91d38f0455366583b3ad3 Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Mon, 19 Aug 2024 21:56:35 +0000 Subject: [PATCH 21/22] Specify -Wno-deprecated for gcc, take 2 Signed-off-by: Michael Warres --- .bazelrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index 8650d599..489e7e24 100644 --- a/.bazelrc +++ b/.bazelrc @@ -65,7 +65,8 @@ build:clang-tidy --output_groups=report build:gcc --action_env=BAZEL_COMPILER=gcc build:gcc --action_env=CC=gcc build:gcc --action_env=CXX=g++ -build:gcc --cxxopt -Wno-invalid-offsetof -Wno-deprecated +build:gcc --cxxopt -Wno-invalid-offsetof +build:gcc --cxxopt -Wno-deprecated # Use Zig C/C++ compiler. build:zig-cc --incompatible_enable_cc_toolchain_resolution From 06f64119ecd24ea4594871d3da65a25919b6daa5 Mon Sep 17 00:00:00 2001 From: Michael Warres Date: Mon, 19 Aug 2024 22:17:20 +0000 Subject: [PATCH 22/22] Set gcc warning flags via --host_cxxopt as well Signed-off-by: Michael Warres --- .bazelrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bazelrc b/.bazelrc index 489e7e24..b9b5de49 100644 --- a/.bazelrc +++ b/.bazelrc @@ -65,8 +65,8 @@ build:clang-tidy --output_groups=report build:gcc --action_env=BAZEL_COMPILER=gcc build:gcc --action_env=CC=gcc build:gcc --action_env=CXX=g++ -build:gcc --cxxopt -Wno-invalid-offsetof -build:gcc --cxxopt -Wno-deprecated +build:gcc --cxxopt -Wno-invalid-offsetof --host_cxxopt -Wno-invalid-offsetof +build:gcc --cxxopt -Wno-deprecated --host_cxxopt -Wno-deprecated # Use Zig C/C++ compiler. build:zig-cc --incompatible_enable_cc_toolchain_resolution