Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ build:no-perfetto --//src/workerd/util:use_perfetto=False
build:no-perfetto --@v8//:v8_use_perfetto=False
build:unix --config=perfetto

# Build V8's Temporal implementation on the temporal_capi crate from crates_vendor.
# NOTE: Temporal is still disabled at runtime for now
build --@v8//:v8_enable_temporal_support=True
build --@v8//:v8_temporal_capi=//deps/rust:temporal_capi

# Increasing the optimization level of V8 significantly speeds up tests using V8 a lot, especially
# python tests. This is useful for both CI and local development and enabled by default, but still
# kept in a separate configuration to make it easy to disable.
Expand Down
20 changes: 20 additions & 0 deletions build/deps/rust.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,26 @@ crate.annotation(
crate = "rust_icu_sys",
rustc_env = {"RUST_ICU_MAJOR_VERSION_NUMBER": "78"},
)
crate.annotation(
# V8 includes generated C++ bindings in the temporal_capi crate; create a cc_library to access
# these from Bazel.
#
# Not a triple-quoted string: Windows checkouts convert this file to CRLF line endings, which
# would end up in the string and change crate_universe's lockfile digest.
additive_build_file_content = "\n".join([
Comment thread
npaun marked this conversation as resolved.
"",
'load("@rules_cc//cc:cc_library.bzl", "cc_library")',
"",
"cc_library(",
' name = "cpp_bindings",',
' hdrs = glob(["bindings/cpp/**/*.hpp"]),',
' strip_include_prefix = "bindings/cpp",',
")",
"",
]),
crate = "temporal_capi",
extra_aliased_targets = {"temporal_capi_cpp_bindings": "cpp_bindings"},
)
crate.from_cargo(
# TODO(cleanup): This name is a bit misleading now that we don't vendor. We can clean it up as a
# followup.
Expand Down
1 change: 1 addition & 0 deletions build/deps/v8.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ PATCHES = [
"0047-Add-v8-Data-IsCompatibleWithIsolate.patch",
"0048-Keep-llvm-libc-private-to-v8_libbase.patch",
"0049-Keep-v8_libshared-private-to-v8.patch",
"0050-Build-Temporal-in-the-V8-Bazel-build.patch",
]

http_archive(
Expand Down
11 changes: 11 additions & 0 deletions deps/rust/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,14 @@ rust_static_library(
stamp = -1, # default to bazel --stamp flag
tags = ["manual"],
)

# Main target for V8 temporal. Consists of our rust runtime + temoral_capi crate + its C++ bindings.
cc_library(
name = "temporal_capi",
visibility = ["//visibility:public"],
deps = [
":runtime",
"@crates_vendor//:temporal_capi",
"@crates_vendor//:temporal_capi_cpp_bindings",
],
)
187 changes: 187 additions & 0 deletions deps/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions deps/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ rustls-webpki = { version = "0.103", default-features = false }
# param_extractor depends on unbounded_depth feature
serde_json = { version = "1", features = ["unbounded_depth"] }
serde = { version = "1", features = ["derive"] }
# V8's Temporal implementation (//deps/rust:temporal_capi). V8 compiles against temporal_capi's
# generated C++ headers, so both crates should be pinned to the versions and features the V8
# release expects: those in Chromium's third_party/rust/chromium_crates_io/Cargo.toml, at the
# third_party/rust revision pinned in V8's DEPS.
temporal_capi = { version = "=0.2.6", features = ["zoneinfo64"] }
temporal_rs = { version = "=0.2.6", default-features = false, features = ["float64_representable_durations"] }
thiserror = "2"
tower-service = "0.3"
# tokio is huge, let's enable only features when we actually need them.
Expand Down
Loading
Loading