Skip to content

chore: update V8 to 13.8.258.26 #440

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
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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 --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
Expand Down
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ Checks: clang-*,
-readability-magic-numbers,
-readability-make-member-function-const,
-readability-simplify-boolean-expr,
-clang-diagnostic-builtin-macro-redefined,

WarningsAsErrors: '*'
12 changes: 2 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,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
Expand Down Expand Up @@ -237,7 +237,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'
Expand All @@ -262,14 +262,6 @@ jobs:
os: macos-13
arch: x86_64
action: test
- name: 'WAVM on Linux/x86_64'
engine: 'wavm'
repo: 'com_github_wavm_wavm'
os: ubuntu-22.04
arch: x86_64
action: test
flags: --config=clang
cache: true

steps:
- uses: actions/checkout@v2
Expand Down
31 changes: 0 additions & 31 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ load(
"proxy_wasm_select_engine_wamr",
"proxy_wasm_select_engine_wasmedge",
"proxy_wasm_select_engine_wasmtime",
"proxy_wasm_select_engine_wavm",
)
load("@rules_cc//cc:defs.bzl", "cc_library")

Expand Down Expand Up @@ -281,34 +280,6 @@ cc_library(
],
)

cc_library(
name = "wavm_lib",
srcs = [
"src/wavm/wavm.cc",
],
hdrs = ["include/proxy-wasm/wavm.h"],
copts = [
"-DWAVM_API=",
"-Wno-non-virtual-dtor",
"-Wno-old-style-cast",
],
defines = [
"PROXY_WASM_HAS_RUNTIME_WAVM",
"PROXY_WASM_HOST_ENGINE_WAVM",
],
linkopts = select({
"@platforms//os:macos": [],
"@platforms//os:windows": [],
"//conditions:default": [
"-ldl",
],
}),
deps = [
":wasm_vm_headers",
"//external:wavm",
],
)

cc_library(
name = "lib",
deps = [
Expand All @@ -324,7 +295,5 @@ cc_library(
) + proxy_wasm_select_engine_wasmtime(
[":wasmtime_lib"],
[":prefixed_wasmtime_lib"],
) + proxy_wasm_select_engine_wavm(
[":wavm_lib"],
),
)
5 changes: 0 additions & 5 deletions bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ config_setting(
values = {"define": "engine=wasmtime"},
)

config_setting(
name = "engine_wavm",
values = {"define": "engine=wavm"},
)

config_setting(
name = "multiengine",
values = {"define": "engine=multi"},
Expand Down
76 changes: 41 additions & 35 deletions bazel/external/v8.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# 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.
# 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 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",
Expand All @@ -17,41 +18,46 @@ 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
index 0539ea176ac..14d7ace5e59 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({
@@ -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,
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

Expand All @@ -60,7 +66,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) {
@@ -3518,3 +3520,5 @@ wasm_instance_t* wasm_frame_instance(const wasm_frame_t* frame) {
#undef WASM_DEFINE_SHARABLE_REF

} // extern "C"
Expand Down
41 changes: 0 additions & 41 deletions bazel/external/v8_include.patch

This file was deleted.

28 changes: 0 additions & 28 deletions bazel/external/wavm.BUILD

This file was deleted.

62 changes: 9 additions & 53 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ def proxy_wasm_cpp_host_repositories():
maybe(
http_archive,
name = "proxy_wasm_cpp_sdk",
sha256 = "89792fc1abca331f29f99870476a04146de5e82ff903bdffca90e6729c1f2470",
strip_prefix = "proxy-wasm-cpp-sdk-95bb82ce45c41d9100fd1ec15d2ffc67f7f3ceee",
urls = ["https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/archive/95bb82ce45c41d9100fd1ec15d2ffc67f7f3ceee.tar.gz"],
sha256 = "26c4c0f9f645de7e789dc92f113d7352ee54ac43bb93ae3a8a22945f1ce71590",
strip_prefix = "proxy-wasm-cpp-sdk-7465dee8b2953beebff99f6dc3720ad0c79bab99",
urls = ["https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/archive/7465dee8b2953beebff99f6dc3720ad0c79bab99.tar.gz"],
)

# Compile DB dependencies.
Expand All @@ -149,11 +149,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 = "65fab701d9829d38cb77c14acdc431d2108bfdbf8979e40eb8ae567edf10b27c",
strip_prefix = "googletest-1.17.0",
urls = ["https://github.com/google/googletest/releases/download/v1.17.0/googletest-1.17.0.tar.gz"],
)

# NullVM dependencies.
Expand All @@ -171,13 +169,12 @@ def proxy_wasm_cpp_host_repositories():
maybe(
git_repository,
name = "v8",
# 10.7.193.13
commit = "6c8b357a84847a479cd329478522feefc1c3195a",
# 13.8.258.26
commit = "de9d0f8b56ae61896e4d2ac577fc589efb14f87d",
remote = "https://chromium.googlesource.com/v8/v8",
shallow_since = "1664374400 +0000",
shallow_since = "1752074621 -0400",
patches = [
"@proxy_wasm_cpp_host//bazel/external:v8.patch",
"@proxy_wasm_cpp_host//bazel/external:v8_include.patch",
],
patch_args = ["-p1"],
)
Expand All @@ -187,20 +184,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(
Expand Down Expand Up @@ -263,30 +246,3 @@ def proxy_wasm_cpp_host_repositories():
name = "prefixed_wasmtime",
actual = "@com_github_bytecodealliance_wasmtime//:prefixed_wasmtime_lib",
)

# WAVM with dependencies.

maybe(
http_archive,
name = "com_github_wavm_wavm",
build_file = "@proxy_wasm_cpp_host//bazel/external:wavm.BUILD",
sha256 = "7cfa3d7334c96f89553bb44eeee736a192826a78b4db114042d38d6882748f5b",
strip_prefix = "WAVM-nightly-2022-05-14",
url = "https://github.com/WAVM/WAVM/archive/refs/tags/nightly/2022-05-14.tar.gz",
)

native.bind(
name = "wavm",
actual = "@com_github_wavm_wavm//:wavm_lib",
)

maybe(
http_archive,
name = "llvm",
build_file = "@proxy_wasm_cpp_host//bazel/external:llvm.BUILD",
sha256 = "7d9a8405f557cefc5a21bf5672af73903b64749d9bc3a50322239f56f34ffddf",
strip_prefix = "llvm-12.0.1.src",
url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/llvm-12.0.1.src.tar.xz",
patches = ["@proxy_wasm_cpp_host//bazel/external:llvm.patch"],
patch_args = ["-p1"],
)
Loading
Loading