Skip to content

Commit 56810de

Browse files
committed
v8 crate integration
1 parent e3e3f10 commit 56810de

8 files changed

+931
-4
lines changed

build/deps/gen/dep_simdutf.bzl

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
load("@//:build/http.bzl", "http_archive")
44

5-
TAG_NAME = "v6.2.0"
6-
URL = "https://github.com/simdutf/simdutf/releases/download/v6.2.0/singleheader.zip"
5+
TAG_NAME = "v6.0.3"
6+
URL = "https://github.com/simdutf/simdutf/releases/download/v6.0.3/singleheader.zip"
77
STRIP_PREFIX = ""
8-
SHA256 = "66c85f591133e3baa23cc441d6e2400dd2c94c4902820734ddbcd9e04dd3988b"
8+
SHA256 = "0e5ba4bc981633bb024ee066833f733b7d3422bc6250f6a6b5bbc09121b782af"
99
TYPE = "zip"
1010

1111
def dep_simdutf():

build/deps/v8.bzl

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ PATCHES = [
3030
"0022-Reset-code_range_-before-pointer-compression-cage.patch",
3131
"0023-Move-tear-down-in-IsolateGroup-Release-into-destruct.patch",
3232
"0024-Modify-where-to-look-for-fast_float-and-simdutf.patch",
33+
"0025-expose-public_header-files.patch",
3334
]
3435

3536
# V8 and its dependencies

deps/rust/BUILD.bazel

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ load("@bazel_skylib//lib:selects.bzl", "selects")
22
load("@bazel_skylib//rules:write_file.bzl", "write_file")
33
load("@rules_rust//crate_universe:defs.bzl", "crates_vendor", "render_config")
44
load("@rules_rust//rust:defs.bzl", "rust_static_library")
5-
load("cargo.bzl", "PACKAGES")
5+
load("cargo.bzl", "ANNOTATIONS", "PACKAGES")
66

77
selects.config_setting_group(
88
name = "linux_x64",
@@ -57,6 +57,7 @@ CARGO_BAZEL = select({
5757
# To repin crates: bazel run //rust-deps:crates_vendor -- --repin
5858
crates_vendor(
5959
name = "crates_vendor",
60+
annotations = ANNOTATIONS,
6061
cargo_bazel = CARGO_BAZEL,
6162
cargo_lockfile = "//deps/rust:Cargo.lock",
6263
generate_binaries = True,

deps/rust/cargo.bzl

+25
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,29 @@ PACKAGES = {
3030
# tokio is huge, let's enable only features when we actually need them.
3131
"tokio": crate.spec(version = "1", default_features = False, features = ["net", "rt", "rt-multi-thread", "time"]),
3232
"tracing": crate.spec(version = "0", default_features = False, features = ["std"]),
33+
"v8": crate.spec(version = "134.5.0"),
34+
}
35+
36+
ANNOTATIONS = {
37+
"v8": [
38+
crate.annotation(
39+
patches = [
40+
"@workerd//:patches/rusty-v8/0001-Clean-up-use-of-v8-internals.patch",
41+
"@workerd//:patches/rusty-v8/0002-removing-the-rest-of-external-api-usages.patch",
42+
"@workerd//:patches/rusty-v8/0003-massage-build.rs-for-workerd.patch",
43+
],
44+
patch_args = ["-p1"],
45+
deps = [":rusty_v8"],
46+
build_script_data = ["@v8//:public_header_files"],
47+
additive_build_file_content = """
48+
cc_library(
49+
name = "rusty_v8",
50+
deps = ["@workerd-v8//:v8"],
51+
srcs = ["src/binding.cc"],
52+
hdrs = ["src/support.h"],
53+
strip_include_prefix = "src/",
54+
)
55+
""",
56+
),
57+
],
3358
}

0 commit comments

Comments
 (0)