-
Notifications
You must be signed in to change notification settings - Fork 74
chore: update V8 to 13.8.258.26 #442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
leonm1
wants to merge
19
commits into
proxy-wasm:main
Choose a base branch
from
leonm1:chore/update-v8
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
41cacf1
update V8 to 13.8.258.26
mpwarres 68c6d37
add missing files to v8.patch
mpwarres ed84311
chore: Update v8 to use 13.8 interface
leonm1 5907976
chore: use bazel repos for missing v8 dependencies
leonm1 cf80dff
chore: fix test expectation
leonm1 0b5f911
chore: format with clang-format-18
leonm1 482a5cd
chore: update macos runner version
leonm1 743e0d9
chore: use toolchains_llvm with clang 18 for cross-compile toolchain
leonm1 5f35a6d
chore: disable failing test
leonm1 a6fa8ca
chore: fix llvm builds:
leonm1 c0f4bca
chore: format
leonm1 8d489bd
chore: fix sed to work on darwin
leonm1 ead5952
chore: re-add qemu arguments for testing cross binaries
leonm1 724d4e3
chore: use hermetic_llvm for macos execution
leonm1 619bf90
fix: remove racy call to isolate->IsExecutionTerminating()
leonm1 99f973b
fix: update tool flags for macos to fix linking error
leonm1 8ff692c
fix: use macos-13 for runners
leonm1 16bea38
fix: remove suimdutf atomic requirement
leonm1 e7265f9
fix: revert macos toolchain flags
leonm1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
load("@rules_cc//cc:defs.bzl", "cc_library") | ||
|
||
licenses(["notice"]) # Apache 2 | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
cc_library( | ||
name = "dragonbox", | ||
srcs = [], | ||
hdrs = ["include/dragonbox/dragonbox.h"], | ||
includes = ["include/"], | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
load("@rules_cc//cc:defs.bzl", "cc_library") | ||
|
||
licenses(["notice"]) # MIT | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
cc_library( | ||
name = "FP16", | ||
hdrs = [ | ||
"include/fp16.h", | ||
"include/fp16/bitcasts.h", | ||
"include/fp16/fp16.h", | ||
], | ||
includes = ["include/"], | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
load("@rules_cc//cc:defs.bzl", "cc_library") | ||
|
||
licenses(["notice"]) # Apache 2 | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
cc_library( | ||
name = "simdutf", | ||
srcs = ["simdutf.cpp"], | ||
hdrs = ["simdutf.h"], | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
# 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. | ||
From bc2a85e39fd55879b9baed51429c08b27d5514c8 Mon Sep 17 00:00:00 2001 | ||
From: Matt Leon <[email protected]> | ||
Date: Wed, 16 Jul 2025 16:55:02 -0400 | ||
Subject: [PATCH 1/6] Disable pointer compression | ||
|
||
Pointer compression limits the maximum number of WasmVMs. | ||
|
||
Signed-off-by: Matt Leon <[email protected]> | ||
--- | ||
BUILD.bazel | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/BUILD.bazel b/BUILD.bazel | ||
index 4e89f90e7e..3fcb38b3f3 100644 | ||
index 3f5a87d054e..0a693b7ee10 100644 | ||
--- a/BUILD.bazel | ||
+++ b/BUILD.bazel | ||
@@ -157,7 +157,7 @@ v8_int( | ||
@@ -292,7 +292,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,45 +23,80 @@ index 4e89f90e7e..3fcb38b3f3 100644 | |
) | ||
|
||
# Default setting for v8_enable_pointer_compression. | ||
-- | ||
2.50.0.727.gbf7dc18ff4-goog | ||
|
||
|
||
From 61898e9a63ac89a37261c081b84714cfc400a4b1 Mon Sep 17 00:00:00 2001 | ||
From: Matt Leon <[email protected]> | ||
Date: Wed, 16 Jul 2025 16:56:31 -0400 | ||
Subject: [PATCH 2/6] Restore _allowlist_function_transition | ||
|
||
Reverts 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). | ||
|
||
Signed-off-by: Matt Leon <[email protected]> | ||
--- | ||
bazel/defs.bzl | 3 +++ | ||
bazel/v8-non-pointer-compression.bzl | 11 +++++++++++ | ||
2 files changed, 14 insertions(+) | ||
|
||
diff --git a/bazel/defs.bzl b/bazel/defs.bzl | ||
index e957c0fad3..063627b72b 100644 | ||
index 0539ea176ac..14d7ace5e59 100644 | ||
--- a/bazel/defs.bzl | ||
+++ b/bazel/defs.bzl | ||
@@ -131,6 +131,10 @@ def _default_args(): | ||
"-Wno-redundant-move", | ||
"-Wno-return-type", | ||
"-Wno-stringop-overflow", | ||
+ "-Wno-nonnull", | ||
+ "-Wno-error=pessimizing-move", | ||
+ "-Wno-error=dangling-reference", | ||
+ "-Wno-error=dangling-pointer=", | ||
# 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({ | ||
@@ -485,6 +485,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, | ||
-- | ||
2.50.0.727.gbf7dc18ff4-goog | ||
|
||
|
||
From 4a6e7158fd4ca48c75c8e33ea15760c9beea1d2f Mon Sep 17 00:00:00 2001 | ||
From: Matt Leon <[email protected]> | ||
Date: Wed, 16 Jul 2025 16:56:52 -0400 | ||
Subject: [PATCH 3/6] Don't expose Wasm C API (only Wasm C++ API). | ||
|
||
Signed-off-by: Matt Leon <[email protected]> | ||
--- | ||
src/wasm/c-api.cc | 4 ++++ | ||
1 file changed, 4 insertions(+) | ||
|
||
diff --git a/src/wasm/c-api.cc b/src/wasm/c-api.cc | ||
index 4473e205c0..65a6ec7e1d 100644 | ||
index 05e4029f183..d705be96a16 100644 | ||
--- a/src/wasm/c-api.cc | ||
+++ b/src/wasm/c-api.cc | ||
@@ -2247,6 +2247,8 @@ auto Instance::exports() const -> ownvec<Extern> { | ||
@@ -2472,6 +2472,8 @@ WASM_EXPORT auto Instance::exports() const -> ownvec<Extern> { | ||
|
||
} // namespace wasm | ||
|
||
|
@@ -63,9 +105,99 @@ 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) { | ||
@@ -3518,3 +3520,5 @@ wasm_instance_t* wasm_frame_instance(const wasm_frame_t* frame) { | ||
#undef WASM_DEFINE_SHARABLE_REF | ||
|
||
} // extern "C" | ||
+ | ||
+#endif | ||
-- | ||
2.50.0.727.gbf7dc18ff4-goog | ||
|
||
|
||
From 7b593eb8086dcfe9012d4fa694d622f21dadb731 Mon Sep 17 00:00:00 2001 | ||
From: Matt Leon <[email protected]> | ||
Date: Wed, 16 Jul 2025 16:58:02 -0400 | ||
Subject: [PATCH 4/6] Stub out fast_float for bazel-supplied version | ||
|
||
Signed-off-by: Matt Leon <[email protected]> | ||
--- | ||
BUILD.bazel | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/BUILD.bazel b/BUILD.bazel | ||
index 0a693b7ee10..eafd9dad20c 100644 | ||
--- a/BUILD.bazel | ||
+++ b/BUILD.bazel | ||
@@ -4438,7 +4438,7 @@ v8_library( | ||
], | ||
deps = [ | ||
":lib_dragonbox", | ||
- "//third_party/fast_float/src:fast_float", | ||
+ "@fast_float//:fast_float", | ||
":lib_fp16", | ||
":simdutf", | ||
":v8_libbase", | ||
-- | ||
2.50.0.727.gbf7dc18ff4-goog | ||
|
||
|
||
From b442d34b12dd513946f509d9db86839ce8aa4d7f Mon Sep 17 00:00:00 2001 | ||
From: Matt Leon <[email protected]> | ||
Date: Wed, 16 Jul 2025 20:04:05 -0400 | ||
Subject: [PATCH 5/6] Stub out vendored dependencies for bazel-sourced versions | ||
|
||
Signed-off-by: Matt Leon <[email protected]> | ||
--- | ||
BUILD.bazel | 6 +++--- | ||
1 file changed, 3 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/BUILD.bazel b/BUILD.bazel | ||
index eafd9dad20c..ce36666e36e 100644 | ||
--- a/BUILD.bazel | ||
+++ b/BUILD.bazel | ||
@@ -4437,10 +4437,10 @@ v8_library( | ||
":noicu/generated_torque_definitions", | ||
], | ||
deps = [ | ||
- ":lib_dragonbox", | ||
+ "@dragonbox//:dragonbox", | ||
"@fast_float//:fast_float", | ||
- ":lib_fp16", | ||
- ":simdutf", | ||
+ "@fp16//:FP16", | ||
+ "@simdutf//:simdutf", | ||
":v8_libbase", | ||
"@abseil-cpp//absl/container:btree", | ||
"@abseil-cpp//absl/container:flat_hash_map", | ||
-- | ||
2.50.0.727.gbf7dc18ff4-goog | ||
|
||
|
||
From e0b8f32cc057a3c0875437d5d54d012cabcab458 Mon Sep 17 00:00:00 2001 | ||
From: Matt Leon <[email protected]> | ||
Date: Wed, 16 Jul 2025 20:29:10 -0400 | ||
Subject: [PATCH 6/6] Add build flags to make V8 compile with GCC | ||
|
||
Signed-off-by: Matt Leon <[email protected]> | ||
--- | ||
bazel/defs.bzl | 3 +++ | ||
1 file changed, 3 insertions(+) | ||
|
||
diff --git a/bazel/defs.bzl b/bazel/defs.bzl | ||
index 14d7ace5e59..c7a48d4e805 100644 | ||
--- a/bazel/defs.bzl | ||
+++ b/bazel/defs.bzl | ||
@@ -117,6 +117,9 @@ def _default_args(): | ||
"-Wno-implicit-int-float-conversion", | ||
"-Wno-deprecated-copy", | ||
"-Wno-non-virtual-dtor", | ||
+ "-Wno-invalid-offsetof", | ||
+ "-Wno-dangling-pointer", | ||
+ "-Wno-dangling-reference", | ||
"-isystem .", | ||
], | ||
"//conditions:default": [], | ||
-- | ||
2.50.0.727.gbf7dc18ff4-goog | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.