Skip to content

Commit 1000bc2

Browse files
leonm1mpwarres
andauthored
chore: update V8 to 13.8.258.26 (#442)
* update V8 to 13.8.258.26 Signed-off-by: Michael Warres <[email protected]> * add missing files to v8.patch Signed-off-by: Michael Warres <[email protected]> * chore: Update v8 to use 13.8 interface Signed-off-by: Matt Leon <[email protected]> * chore: use bazel repos for missing v8 dependencies Signed-off-by: Matt Leon <[email protected]> * chore: fix test expectation Signed-off-by: Matt Leon <[email protected]> * chore: disable failing test This test fails with the new V8 version Signed-off-by: Matt Leon <[email protected]> * chore: fix sed to work on darwin BSD sed requires an extension to create a backup file when used with in-place editing. Signed-off-by: Matt Leon <[email protected]> * fix: remove racy call to isolate->IsExecutionTerminating() Signed-off-by: Matt Leon <[email protected]> * fix: remove V8's libatomic dependency Signed-off-by: Matt Leon <[email protected]> * chore: use toolchains_llvm with clang 19.1.0 Fixes macos build Signed-off-by: Matt Leon <[email protected]> * chore: update aarch64 build to run on native aarch64 runner Signed-off-by: Matt Leon <[email protected]> * chore: update hermetic-llvm to be platform-agnostic and use in CI Signed-off-by: Matt Leon <[email protected]> * chore: Silence tsan warnings inside V8 These warnings flag a Join() function protected by a mutex. Such a function marks that the racy operation has ended. Signed-off-by: Matt Leon <[email protected]> --------- Signed-off-by: Michael Warres <[email protected]> Signed-off-by: Matt Leon <[email protected]> Co-authored-by: Michael Warres <[email protected]>
1 parent 497e4ef commit 1000bc2

19 files changed

+586
-177
lines changed

.bazelrc

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ build:clang-tsan --config=clang-xsan
5555
build:clang-tsan --copt -DTHREAD_SANITIZER=1
5656
build:clang-tsan --copt -fsanitize=thread
5757
build:clang-tsan --linkopt -fsanitize=thread
58+
build:clang-tsan --test_env=TSAN_OPTIONS=suppressions=bazel/tsan_suppressions.txt
5859

5960
# Use Clang-Tidy tool.
6061
build:clang-tidy --config=clang
@@ -67,17 +68,14 @@ build:gcc --action_env=BAZEL_COMPILER=gcc
6768
build:gcc --action_env=CC=gcc
6869
build:gcc --action_env=CXX=g++
6970

70-
# Use Zig C/C++ compiler.
71-
build:zig-cc --incompatible_enable_cc_toolchain_resolution
72-
build:zig-cc --extra_toolchains @zig_sdk//:aarch64-linux-gnu.2.28_toolchain
73-
build:zig-cc --extra_toolchains @zig_sdk//:x86_64-linux-gnu.2.28_toolchain
74-
build:zig-cc --host_copt=-fno-sanitize=undefined
71+
build:hermetic-llvm --incompatible_enable_cc_toolchain_resolution
72+
build:hermetic-llvm --action_env BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
73+
build:hermetic-llvm --extra_toolchains @emsdk//emscripten_toolchain:cc-toolchain-wasm
7574

76-
# Use Zig C/C++ compiler (cross-compile to Linux/aarch64).
77-
build:zig-cc-linux-aarch64 --config=zig-cc
78-
build:zig-cc-linux-aarch64 --platforms @zig_sdk//:linux_aarch64_platform
79-
build:zig-cc-linux-aarch64 --run_under=qemu-aarch64-static
80-
build:zig-cc-linux-aarch64 --test_env=QEMU_LD_PREFIX=/usr/aarch64-linux-gnu/
75+
build:hermetic-llvm-macos --config=hermetic-llvm
76+
# Below flags mitigate https://github.com/bazel-contrib/toolchains_llvm/pull/229.
77+
build:hermetic-llvm-macos --features=-libtool
78+
build:hermetic-llvm-macos --features=-supports_dynamic_linker
8179

8280
build --enable_platform_specific_config
8381

@@ -86,6 +84,7 @@ build:linux --cxxopt=-std=c++20 --host_cxxopt=-std=c++20
8684
build:macos --cxxopt=-std=c++20 --host_cxxopt=-std=c++20
8785
build:windows --cxxopt="/std:c++20" --host_cxxopt="/std:c++20"
8886

87+
8988
# Enable symlinks and runfiles on Windows (enabled by default on other platforms).
9089
startup --windows_enable_symlinks
9190
build:windows --enable_runfiles

.github/workflows/test.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,23 +139,23 @@ jobs:
139139
os: ubuntu-24.04
140140
arch: x86_64
141141
action: test
142-
flags: --config=clang --define=crypto=system
142+
flags: --config=hermetic-llvm --define=crypto=system
143143
cache: true
144144
- name: 'V8 on Linux/x86_64 with ASan'
145145
engine: 'v8'
146146
repo: 'v8'
147147
os: ubuntu-24.04
148148
arch: x86_64
149149
action: test
150-
flags: --config=clang-asan
150+
flags: --config=hermetic-llvm --config=clang-asan
151151
cache: true
152152
- name: 'V8 on Linux/x86_64 with TSan'
153153
engine: 'v8'
154154
repo: 'v8'
155155
os: ubuntu-24.04
156156
arch: x86_64
157157
action: test
158-
flags: --config=clang-tsan
158+
flags: --config=hermetic-llvm --config=clang-tsan
159159
cache: true
160160
- name: 'V8 on Linux/x86_64 with GCC'
161161
engine: 'v8'
@@ -168,19 +168,19 @@ jobs:
168168
- name: 'V8 on Linux/aarch64'
169169
engine: 'v8'
170170
repo: 'v8'
171-
os: ubuntu-24.04
171+
os: ubuntu-24.04-arm
172172
arch: aarch64
173173
action: test
174174
targets: -//test/fuzz/...
175-
flags: --config=zig-cc-linux-aarch64 --@v8//bazel/config:v8_target_cpu=arm64
176-
deps: qemu-user-static libc6-arm64-cross
175+
flags: --config=hermetic-llvm --@v8//bazel/config:v8_target_cpu=arm64
177176
cache: true
178177
- name: 'V8 on macOS/x86_64'
179178
engine: 'v8'
180179
repo: 'v8'
181180
os: macos-13
182181
arch: x86_64
183182
action: test
183+
flags: --config=hermetic-llvm-macos
184184
cache: true
185185
- name: 'WAMR interp on Linux/x86_64'
186186
engine: 'wamr-interp'
@@ -241,11 +241,10 @@ jobs:
241241
- name: 'Wasmtime on Linux/aarch64'
242242
engine: 'wasmtime'
243243
repo: 'com_github_bytecodealliance_wasmtime'
244-
os: ubuntu-24.04
244+
os: ubuntu-24.04-arm
245245
arch: aarch64
246246
action: build
247-
flags: --config=zig-cc-linux-aarch64
248-
deps: qemu-user-static libc6-arm64-cross
247+
flags: --config=hermetic-llvm
249248
- name: 'Wasmtime on Linux/s390x'
250249
engine: 'wasmtime'
251250
repo: 'com_github_bytecodealliance_wasmtime'

bazel/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,5 @@ selects.config_setting_group(
6868
":linux_s390x",
6969
],
7070
)
71+
72+
exports_files(["tsan_suppressions.txt"])

bazel/cc_defs.bzl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
load("@rules_cc//cc:defs.bzl", _cc_test = "cc_test")
16+
load("@rules_fuzzing//fuzzing:cc_defs.bzl", _cc_fuzz_test = "cc_fuzz_test")
17+
18+
def cc_test(data = [], **kwargs):
19+
_cc_test(data = data + ["//bazel:tsan_suppressions.txt"], **kwargs)
20+
21+
def cc_fuzz_test(data = [], **kwargs):
22+
_cc_fuzz_test(data = data + ["//bazel:tsan_suppressions.txt"], **kwargs)

bazel/dependencies.bzl

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
load("@bazel-zig-cc//toolchain:defs.bzl", zig_register_toolchains = "register_toolchains")
1615
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
16+
load("@envoy_toolshed//sysroot:sysroot.bzl", "setup_sysroots")
1717
load("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:crates.bzl", wasmsign_crate_repositories = "crate_repositories")
1818
load("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:crates.bzl", wasmtime_crate_repositories = "crate_repositories")
1919
load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")
2020
load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies")
2121
load("@rules_rust//rust:repositories.bzl", "rust_repositories", "rust_repository_set")
22+
load("@toolchains_llvm//toolchain:deps.bzl", "bazel_toolchain_dependencies")
23+
load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain")
2224

2325
def proxy_wasm_cpp_host_dependencies():
2426
# Bazel extensions.
@@ -52,14 +54,39 @@ def proxy_wasm_cpp_host_dependencies():
5254
)
5355
crate_universe_dependencies(bootstrap = True)
5456

55-
zig_register_toolchains(
56-
version = "0.9.1",
57-
url_format = "https://ziglang.org/download/{version}/zig-{host_platform}-{version}.tar.xz",
58-
host_platform_sha256 = {
59-
"linux-aarch64": "5d99a39cded1870a3fa95d4de4ce68ac2610cca440336cfd252ffdddc2b90e66",
60-
"linux-x86_64": "be8da632c1d3273f766b69244d80669fe4f5e27798654681d77c992f17c237d7",
61-
"macos-aarch64": "8c473082b4f0f819f1da05de2dbd0c1e891dff7d85d2c12b6ee876887d438287",
62-
"macos-x86_64": "2d94984972d67292b55c1eb1c00de46580e9916575d083003546e9a01166754c",
57+
setup_sysroots()
58+
bazel_toolchain_dependencies()
59+
llvm_toolchain(
60+
name = "llvm_toolchain",
61+
llvm_version = "19.1.0",
62+
sha256 = {
63+
"linux-x86_64": "cee77d641690466a193d9b88c89705de1c02bbad46bde6a3b126793c0a0f2923",
64+
"linux-aarch64": "7bb54afd330fe1a1c2d4c593fa1e2dbe2abd9bf34fb3597994ff41e443cf144b",
65+
"darwin-aarch64": "9da86f64a99f5ce9b679caf54e938736ca269c5e069d0c94ad08b995c5f25c16",
66+
"darwin-x86_64": "264f2f1e8b67f066749349ae8b4943d346cd44e099464164ef21b42a57663540",
67+
},
68+
strip_prefix = {
69+
"linux-x86_64": "LLVM-19.1.0-Linux-X64",
70+
"linux-aarch64": "clang+llvm-19.1.0-aarch64-linux-gnu",
71+
"darwin-aarch64": "LLVM-19.1.0-macOS-ARM64",
72+
"darwin-x86_64": "LLVM-19.1.0-macOS-X64",
73+
},
74+
urls = {
75+
"linux-x86_64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.0/LLVM-19.1.0-Linux-X64.tar.xz"],
76+
"linux-aarch64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.0/clang+llvm-19.1.0-aarch64-linux-gnu.tar.xz"],
77+
"darwin-aarch64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.0/LLVM-19.1.0-macOS-ARM64.tar.xz"],
78+
"darwin-x86_64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.0/LLVM-19.1.0-macOS-X64.tar.xz"],
79+
},
80+
)
81+
82+
llvm_toolchain(
83+
name = "llvm_aarch64",
84+
llvm_version = "19.1.0",
85+
toolchain_roots = {
86+
"": "@llvm_toolchain_llvm//",
87+
},
88+
sysroot = {
89+
"linux-aarch64": "@sysroot_linux_arm64//:sysroot",
6390
},
6491
)
6592

bazel/dependencies_import.bzl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313
# limitations under the License.
1414

1515
load("@fuzzing_py_deps//:requirements.bzl", pip_fuzzing_dependencies = "install_deps")
16+
load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")
1617
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
1718
load("@rules_fuzzing//fuzzing:repositories.bzl", "rules_fuzzing_dependencies")
1819
load("@v8_python_deps//:requirements.bzl", pip_v8_dependencies = "install_deps")
1920

2021
def proxy_wasm_cpp_host_dependencies_import():
22+
llvm_register_toolchains()
23+
2124
rules_foreign_cc_dependencies()
2225
rules_fuzzing_dependencies()
2326

bazel/external/dragonbox.BUILD

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
load("@rules_cc//cc:defs.bzl", "cc_library")
2+
3+
licenses(["notice"]) # Apache 2
4+
5+
package(default_visibility = ["//visibility:public"])
6+
7+
cc_library(
8+
name = "dragonbox",
9+
srcs = [],
10+
hdrs = ["include/dragonbox/dragonbox.h"],
11+
includes = ["include/"],
12+
)

bazel/external/fp16.BUILD

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
load("@rules_cc//cc:defs.bzl", "cc_library")
2+
3+
licenses(["notice"]) # MIT
4+
5+
package(default_visibility = ["//visibility:public"])
6+
7+
cc_library(
8+
name = "FP16",
9+
hdrs = [
10+
"include/fp16.h",
11+
"include/fp16/bitcasts.h",
12+
"include/fp16/fp16.h",
13+
],
14+
includes = ["include/"],
15+
)

bazel/external/intel_ittapi.BUILD

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
load("@rules_cc//cc:defs.bzl", "cc_library")
2+
3+
licenses(["notice"])
4+
5+
package(default_visibility = ["//visibility:public"])
6+
7+
cc_library(
8+
name = "lib_ittapi",
9+
srcs = [
10+
"include/ittnotify.h",
11+
"include/jitprofiling.h",
12+
"src/ittnotify/ittnotify_config.h",
13+
"src/ittnotify/jitprofiling.c",
14+
],
15+
hdrs = [
16+
"include/ittnotify.h",
17+
"src/ittnotify/ittnotify_types.h",
18+
],
19+
includes = ["include/"],
20+
visibility = ["//visibility:public"],
21+
)

bazel/external/simdutf.BUILD

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
load("@rules_cc//cc:defs.bzl", "cc_library")
2+
3+
licenses(["notice"]) # Apache 2
4+
5+
package(default_visibility = ["//visibility:public"])
6+
7+
cc_library(
8+
name = "simdutf",
9+
srcs = ["simdutf.cpp"],
10+
hdrs = ["simdutf.h"],
11+
)

0 commit comments

Comments
 (0)