Generate Rust bindings that match Bazel-built V8 archives (#57644)

## Why

Pre-generated bindings can disagree with native V8 layouts, including CppGC member storage and the inline typed-array size. Source archives need bindings generated with the same headers, defines, and target configuration.

## What changed

- Generate bindings through Bazel using the archive's C++ compilation metadata, and include them in Darwin and Linux release pairs and source builds.
- Select native Windows MSVC archives and matching bindings together with `--//:rusty_v8_from_source=true`, and generate target-specific Windows GNU bindings.
- Pin a corrected `rusty_v8` revision for Cargo and Bazel, and track native Windows LLVM tools and resources as action inputs so pin changes invalidate cached actions.
- Run release and canary Cargo smoke tests with explicit target triples, required Linux linkers, and `--include-ignored`.

## Testing

Add `codex-v8-poc` coverage for CppGC member size, alignment, tracing, and weak references; typed-array contents and backing-store promotion; and microtask queues across garbage collection and context reassignment. Enable the otherwise ignored CppGC ABI checks for Bazel source builds and staged release smoke tests.

GitOrigin-RevId: 9edfa057a0ef2e323543bb8132c070d336ded1b2
This commit is contained in:
Sean Huang
2026-10-28 04:48:23 +00:00
committed by copyberry
parent 424916ee94
commit d63fe536ee
17 changed files with 727 additions and 175 deletions
+206 -81
View File
@@ -2,6 +2,7 @@ load("@@//third_party/v8:artifact_profile.bzl", "v8_artifact_files")
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load("@rules_cc//cc:cc_static_library.bzl", "cc_static_library")
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_rs//rs:rules_rust_bindgen.bzl", "rust_bindgen")
package(default_visibility = ["//visibility:public"])
@@ -93,20 +94,6 @@ alias(
actual = ":v8_152_2_0_x86_64_pc_windows_gnullvm_bazel",
)
alias(
name = "src_binding_release_x86_64_pc_windows_gnullvm_152_2_0_release",
# `rusty_v8` does not publish a Windows GNU binding file. The generated
# binding only describes this V8 release's C++ API surface, so reuse the
# Linux release binding while the windows-gnullvm archive build is still
# experimental.
actual = ":src_binding_release_x86_64_unknown_linux_gnu_152_2_0_release",
)
alias(
name = "src_binding_release_aarch64_pc_windows_gnullvm_152_2_0_release",
actual = ":src_binding_release_aarch64_unknown_linux_gnu_152_2_0_release",
)
# Both ordinary consumers and source consumers use the current sandbox ABI.
# Switch the archive and binding together for source instrumentation. The same
# root setting is visible in the @v8_targets copy used by rules_rs.
@@ -176,14 +163,14 @@ alias(
actual = select({
"@rules_rs//rs/platforms/config:aarch64-apple-darwin": ":v8_152_2_0_aarch64_apple_darwin_bazel",
"@rules_rs//rs/platforms/config:aarch64-pc-windows-gnullvm": ":v8_152_2_0_aarch64_pc_windows_gnullvm",
"@rules_rs//rs/platforms/config:aarch64-pc-windows-msvc": ":v8_152_2_0_aarch64_pc_windows_msvc",
"@rules_rs//rs/platforms/config:aarch64-pc-windows-msvc": ":v8_152_2_0_aarch64_pc_windows_msvc_bazel",
"@rules_rs//rs/platforms/config:aarch64-unknown-linux-gnu": ":v8_152_2_0_aarch64_unknown_linux_gnu_bazel",
# Rust's compiler-builtins archive does not supply V8's __clear_cache.
# Use the merged archive containing the ARM64 compiler-rt builtins.
":platform_aarch64_unknown_linux_musl": ":v8_152_2_0_aarch64_unknown_linux_musl_release",
"@rules_rs//rs/platforms/config:x86_64-apple-darwin": ":v8_152_2_0_x86_64_apple_darwin_bazel",
"@rules_rs//rs/platforms/config:x86_64-pc-windows-gnullvm": ":v8_152_2_0_x86_64_pc_windows_gnullvm",
"@rules_rs//rs/platforms/config:x86_64-pc-windows-msvc": ":v8_152_2_0_x86_64_pc_windows_msvc",
"@rules_rs//rs/platforms/config:x86_64-pc-windows-msvc": ":v8_152_2_0_x86_64_pc_windows_msvc_bazel",
"@rules_rs//rs/platforms/config:x86_64-unknown-linux-gnu": ":v8_152_2_0_x86_64_unknown_linux_gnu_bazel",
":platform_x86_64_unknown_linux_musl": ":v8_152_2_0_x86_64_unknown_linux_musl_release",
"//conditions:default": ":v8_152_2_0_x86_64_unknown_linux_gnu_bazel",
@@ -216,17 +203,17 @@ alias(
alias(
name = "rusty_v8_source_binding_for_target",
actual = select({
"@rules_rs//rs/platforms/config:aarch64-apple-darwin": ":src_binding_release_aarch64_apple_darwin_152_2_0_release",
"@rules_rs//rs/platforms/config:aarch64-pc-windows-gnullvm": ":src_binding_release_aarch64_pc_windows_gnullvm_152_2_0_release",
"@rules_rs//rs/platforms/config:aarch64-pc-windows-msvc": ":src_binding_release_aarch64_pc_windows_msvc_152_2_0_release",
"@rules_rs//rs/platforms/config:aarch64-unknown-linux-gnu": ":src_binding_release_aarch64_unknown_linux_gnu_152_2_0_release",
":platform_aarch64_unknown_linux_musl": ":src_binding_release_aarch64_unknown_linux_musl_152_2_0_release",
"@rules_rs//rs/platforms/config:x86_64-apple-darwin": ":src_binding_release_x86_64_apple_darwin_152_2_0_release",
"@rules_rs//rs/platforms/config:x86_64-pc-windows-gnullvm": ":src_binding_release_x86_64_pc_windows_gnullvm_152_2_0_release",
"@rules_rs//rs/platforms/config:x86_64-pc-windows-msvc": ":src_binding_release_x86_64_pc_windows_msvc_152_2_0_release",
"@rules_rs//rs/platforms/config:x86_64-unknown-linux-gnu": ":src_binding_release_x86_64_unknown_linux_gnu_152_2_0_release",
":platform_x86_64_unknown_linux_musl": ":src_binding_release_x86_64_unknown_linux_musl_152_2_0_release",
"//conditions:default": ":src_binding_release_x86_64_unknown_linux_gnu_152_2_0_release",
"@rules_rs//rs/platforms/config:aarch64-apple-darwin": ":src_binding_aarch64_apple_darwin_152_2_0_bazel",
"@rules_rs//rs/platforms/config:aarch64-pc-windows-gnullvm": ":src_binding_aarch64_pc_windows_gnullvm_152_2_0_bazel",
"@rules_rs//rs/platforms/config:aarch64-pc-windows-msvc": ":src_binding_aarch64_pc_windows_msvc_152_2_0_bazel",
"@rules_rs//rs/platforms/config:aarch64-unknown-linux-gnu": ":src_binding_aarch64_unknown_linux_gnu_152_2_0_bazel",
":platform_aarch64_unknown_linux_musl": ":src_binding_aarch64_unknown_linux_musl_152_2_0_bazel",
"@rules_rs//rs/platforms/config:x86_64-apple-darwin": ":src_binding_x86_64_apple_darwin_152_2_0_bazel",
"@rules_rs//rs/platforms/config:x86_64-pc-windows-gnullvm": ":src_binding_x86_64_pc_windows_gnullvm_152_2_0_bazel",
"@rules_rs//rs/platforms/config:x86_64-pc-windows-msvc": ":src_binding_x86_64_pc_windows_msvc_152_2_0_bazel",
"@rules_rs//rs/platforms/config:x86_64-unknown-linux-gnu": ":src_binding_x86_64_unknown_linux_gnu_152_2_0_bazel",
":platform_x86_64_unknown_linux_musl": ":src_binding_x86_64_unknown_linux_musl_152_2_0_bazel",
"//conditions:default": ":src_binding_x86_64_unknown_linux_gnu_152_2_0_bazel",
}),
)
@@ -420,6 +407,184 @@ alias(
tags = ["manual"],
)
# Bindgen reads the same CcInfo as the C++ archive. Pass local libc++ options
# explicitly because CcInfo propagates defines and headers, but not copts.
cc_library(
name = "binding_headers_152_2_0",
hdrs = [
"@v8_crate_152_2_0//:binding_hpp",
"@v8_crate_152_2_0//:support_h",
],
tags = ["manual"],
# Bindgen asks the toolchain for C flags, which omit its C++ header search
# paths. Source profiles use the workspace headers; release profiles get
# their pinned Chromium headers from the profiled binding dependency.
deps = [":v8_152_2_0_binding"] + select({
":use_rusty_v8_custom_libcxx": [],
"@platforms//os:osx": [],
"//conditions:default": [
"@llvm-project//libcxx:headers",
"@llvm-project//libcxxabi:headers",
],
}),
)
rust_bindgen(
name = "binding_generated_152_2_0",
bindgen_flags = [
"--generate-cstr",
"--rustified-enum=.*UseCounterFeature",
"--rustified-enum=.*ModuleImportPhase",
"--rustified-enum=.*Intercepted",
"--bitfield-enum=.*GCType",
"--bitfield-enum=.*GCCallbackFlags",
"--allowlist-item=v8__.*",
"--allowlist-item=cppgc__.*",
"--allowlist-item=RustObj",
"--allowlist-item=memory_span_t",
"--allowlist-item=const_memory_span_t",
"--allowlist-item=ExternalConstOneByteStringResource",
"--blocklist-item=cppgc.*Visitor",
"--blocklist-item=RustObj.*Trace",
],
cc_lib = ":binding_headers_152_2_0",
clang_flags = [
"-x",
"c++",
"-std=c++20",
] + V8_CUSTOM_LIBCXX_COPTS + select({
# Match the C++ toolchain. Bindgen asks for C flags and otherwise
# enables C++20 modules, for which the macOS SDK's types are cyclic.
"@platforms//os:osx": [
"-Xclang",
"-fno-cxx-modules",
],
"//conditions:default": [],
}) + select({
"@rules_rs//rs/platforms/config:aarch64-apple-darwin": ["--target=arm64-apple-darwin"],
"@rules_rs//rs/platforms/config:aarch64-pc-windows-gnullvm": ["--target=aarch64-w64-windows-gnu"],
"@rules_rs//rs/platforms/config:aarch64-pc-windows-msvc": ["--target=aarch64-pc-windows-msvc"],
"@llvm//platforms/config:linux_aarch64": ["--target=aarch64-unknown-linux-gnu"],
":platform_aarch64_unknown_linux_musl": ["--target=aarch64-unknown-linux-musl"],
"@rules_rs//rs/platforms/config:x86_64-apple-darwin": ["--target=x86_64-apple-darwin"],
"@rules_rs//rs/platforms/config:x86_64-pc-windows-gnullvm": ["--target=x86_64-w64-windows-gnu"],
"@rules_rs//rs/platforms/config:x86_64-pc-windows-msvc": ["--target=x86_64-pc-windows-msvc"],
"@llvm//platforms/config:linux_x86_64": ["--target=x86_64-unknown-linux-gnu"],
":platform_x86_64_unknown_linux_musl": ["--target=x86_64-unknown-linux-musl"],
}),
header = "@v8_crate_152_2_0//:binding_hpp",
tags = ["manual"],
)
v8_artifact_files(
name = "src_binding_aarch64_pc_windows_msvc_152_2_0_bazel",
srcs = [":binding_generated_152_2_0"],
profile = "sandbox_release",
tags = ["manual"],
target_compatible_with = [
"@platforms//cpu:aarch64",
"@platforms//os:windows",
"@llvm//constraints/windows/abi:msvc",
],
v8_cpu = "arm64",
)
v8_artifact_files(
name = "src_binding_x86_64_pc_windows_msvc_152_2_0_bazel",
srcs = [":binding_generated_152_2_0"],
profile = "sandbox_release",
tags = ["manual"],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@llvm//constraints/windows/abi:msvc",
],
v8_cpu = "x64",
)
v8_artifact_files(
name = "src_binding_aarch64_pc_windows_gnullvm_152_2_0_bazel",
srcs = [":binding_generated_152_2_0"],
profile = "source",
tags = ["manual"],
target_compatible_with = [
"@platforms//cpu:aarch64",
"@platforms//os:windows",
"@llvm//constraints/windows/abi:gnullvm",
],
v8_cpu = "arm64",
)
v8_artifact_files(
name = "src_binding_x86_64_pc_windows_gnullvm_152_2_0_bazel",
srcs = [":binding_generated_152_2_0"],
profile = "source",
tags = ["manual"],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@llvm//constraints/windows/abi:gnullvm",
],
v8_cpu = "x64",
)
v8_artifact_files(
name = "src_binding_aarch64_apple_darwin_152_2_0_bazel",
srcs = [":binding_generated_152_2_0"],
profile = "source",
tags = ["manual"],
v8_cpu = "arm64",
)
v8_artifact_files(
name = "src_binding_x86_64_apple_darwin_152_2_0_bazel",
srcs = [":binding_generated_152_2_0"],
profile = "source",
tags = ["manual"],
v8_cpu = "x64",
)
v8_artifact_files(
name = "src_binding_aarch64_unknown_linux_gnu_152_2_0_bazel",
srcs = [":binding_generated_152_2_0"],
profile = "source",
tags = ["manual"],
v8_cpu = "arm64",
)
v8_artifact_files(
name = "src_binding_x86_64_unknown_linux_gnu_152_2_0_bazel",
srcs = [":binding_generated_152_2_0"],
profile = "source",
tags = ["manual"],
v8_cpu = "x64",
)
v8_artifact_files(
name = "src_binding_aarch64_unknown_linux_musl_152_2_0_bazel",
srcs = [":binding_generated_152_2_0"],
profile = "source",
tags = ["manual"],
v8_cpu = "arm64",
)
v8_artifact_files(
name = "src_binding_x86_64_unknown_linux_musl_152_2_0_bazel",
srcs = [":binding_generated_152_2_0"],
profile = "source",
tags = ["manual"],
v8_cpu = "x64",
)
alias(
name = "rusty_v8_native_windows_binding_for_target",
actual = select({
"@rules_rs//rs/platforms/config:aarch64-pc-windows-msvc": ":src_binding_aarch64_pc_windows_msvc_152_2_0_bazel",
"@rules_rs//rs/platforms/config:x86_64-pc-windows-msvc": ":src_binding_x86_64_pc_windows_msvc_152_2_0_bazel",
}),
tags = ["manual"],
)
cc_static_library(
name = "_v8_152_2_0_aarch64_apple_darwin_bazel",
features = V8_STATIC_LIBRARY_FEATURES,
@@ -541,51 +706,11 @@ cc_static_library(
]
]
filegroup(
name = "src_binding_release_aarch64_apple_darwin_152_2_0_release",
srcs = ["@v8_crate_152_2_0//:src_binding_release_aarch64_apple_darwin"],
)
filegroup(
name = "src_binding_release_x86_64_apple_darwin_152_2_0_release",
srcs = ["@v8_crate_152_2_0//:src_binding_release_x86_64_apple_darwin"],
)
filegroup(
name = "src_binding_release_aarch64_unknown_linux_gnu_152_2_0_release",
srcs = ["@v8_crate_152_2_0//:src_binding_release_aarch64_unknown_linux_gnu"],
)
filegroup(
name = "src_binding_release_x86_64_unknown_linux_gnu_152_2_0_release",
srcs = ["@v8_crate_152_2_0//:src_binding_release_x86_64_unknown_linux_gnu"],
)
filegroup(
name = "src_binding_release_aarch64_unknown_linux_musl_152_2_0_release",
srcs = ["@v8_crate_152_2_0//:src_binding_release_aarch64_unknown_linux_gnu"],
)
filegroup(
name = "src_binding_release_x86_64_unknown_linux_musl_152_2_0_release",
srcs = ["@v8_crate_152_2_0//:src_binding_release_x86_64_unknown_linux_gnu"],
)
alias(
name = "src_binding_release_aarch64_pc_windows_msvc_152_2_0_release",
actual = "@rusty_v8_152_2_0_aarch64_pc_windows_msvc_binding//file",
)
alias(
name = "src_binding_release_x86_64_pc_windows_msvc_152_2_0_release",
actual = "@rusty_v8_152_2_0_x86_64_pc_windows_msvc_binding//file",
)
v8_artifact_files(
name = "rusty_v8_release_pair_x86_64_apple_darwin",
srcs = [
":_v8_152_2_0_x86_64_apple_darwin_bazel",
":src_binding_release_x86_64_apple_darwin_152_2_0_release",
":binding_generated_152_2_0",
],
profile = "release",
v8_cpu = "x64",
@@ -595,7 +720,7 @@ v8_artifact_files(
name = "rusty_v8_release_pair_aarch64_apple_darwin",
srcs = [
":_v8_152_2_0_aarch64_apple_darwin_bazel",
":src_binding_release_aarch64_apple_darwin_152_2_0_release",
":binding_generated_152_2_0",
],
profile = "release",
v8_cpu = "arm64",
@@ -605,7 +730,7 @@ v8_artifact_files(
name = "rusty_v8_release_pair_x86_64_unknown_linux_gnu",
srcs = [
":_v8_152_2_0_x86_64_unknown_linux_gnu_bazel",
":src_binding_release_x86_64_unknown_linux_gnu_152_2_0_release",
":binding_generated_152_2_0",
],
profile = "release",
v8_cpu = "x64",
@@ -615,7 +740,7 @@ v8_artifact_files(
name = "rusty_v8_release_pair_aarch64_unknown_linux_gnu",
srcs = [
":_v8_152_2_0_aarch64_unknown_linux_gnu_bazel",
":src_binding_release_aarch64_unknown_linux_gnu_152_2_0_release",
":binding_generated_152_2_0",
],
profile = "release",
v8_cpu = "arm64",
@@ -625,7 +750,7 @@ v8_artifact_files(
name = "rusty_v8_release_pair_x86_64_unknown_linux_musl",
srcs = [
":_v8_152_2_0_x86_64_unknown_linux_musl_release",
":src_binding_release_x86_64_unknown_linux_musl_152_2_0_release",
":binding_generated_152_2_0",
],
profile = "release",
v8_cpu = "x64",
@@ -635,7 +760,7 @@ v8_artifact_files(
name = "rusty_v8_release_pair_aarch64_unknown_linux_musl",
srcs = [
":_v8_152_2_0_aarch64_unknown_linux_musl_release",
":src_binding_release_aarch64_unknown_linux_musl_152_2_0_release",
":binding_generated_152_2_0",
],
profile = "release",
v8_cpu = "arm64",
@@ -644,16 +769,16 @@ v8_artifact_files(
filegroup(
name = "rusty_v8_release_pair_x86_64_pc_windows_msvc",
srcs = [
":src_binding_release_x86_64_pc_windows_msvc_152_2_0_release",
":v8_152_2_0_x86_64_pc_windows_msvc",
"@rusty_v8_152_2_0_x86_64_pc_windows_msvc_binding//file",
],
)
filegroup(
name = "rusty_v8_release_pair_aarch64_pc_windows_msvc",
srcs = [
":src_binding_release_aarch64_pc_windows_msvc_152_2_0_release",
":v8_152_2_0_aarch64_pc_windows_msvc",
"@rusty_v8_152_2_0_aarch64_pc_windows_msvc_binding//file",
],
)
@@ -661,7 +786,7 @@ v8_artifact_files(
name = "rusty_v8_sandbox_release_pair_x86_64_apple_darwin",
srcs = [
":_v8_152_2_0_x86_64_apple_darwin_bazel",
":src_binding_release_x86_64_apple_darwin_152_2_0_release",
":binding_generated_152_2_0",
],
profile = "sandbox_release",
v8_cpu = "x64",
@@ -671,7 +796,7 @@ v8_artifact_files(
name = "rusty_v8_sandbox_release_pair_aarch64_apple_darwin",
srcs = [
":_v8_152_2_0_aarch64_apple_darwin_bazel",
":src_binding_release_aarch64_apple_darwin_152_2_0_release",
":binding_generated_152_2_0",
],
profile = "sandbox_release",
v8_cpu = "arm64",
@@ -681,7 +806,7 @@ v8_artifact_files(
name = "rusty_v8_sandbox_release_pair_x86_64_unknown_linux_gnu",
srcs = [
":_v8_152_2_0_x86_64_unknown_linux_gnu_bazel",
":src_binding_release_x86_64_unknown_linux_gnu_152_2_0_release",
":binding_generated_152_2_0",
],
profile = "sandbox_release",
v8_cpu = "x64",
@@ -691,7 +816,7 @@ v8_artifact_files(
name = "rusty_v8_sandbox_release_pair_aarch64_unknown_linux_gnu",
srcs = [
":_v8_152_2_0_aarch64_unknown_linux_gnu_bazel",
":src_binding_release_aarch64_unknown_linux_gnu_152_2_0_release",
":binding_generated_152_2_0",
],
profile = "sandbox_release",
v8_cpu = "arm64",
@@ -701,7 +826,7 @@ v8_artifact_files(
name = "rusty_v8_sandbox_release_pair_x86_64_unknown_linux_musl",
srcs = [
":_v8_152_2_0_x86_64_unknown_linux_musl_release",
":src_binding_release_x86_64_unknown_linux_musl_152_2_0_release",
":binding_generated_152_2_0",
],
profile = "sandbox_release",
v8_cpu = "x64",
@@ -711,7 +836,7 @@ v8_artifact_files(
name = "rusty_v8_sandbox_release_pair_aarch64_unknown_linux_musl",
srcs = [
":_v8_152_2_0_aarch64_unknown_linux_musl_release",
":src_binding_release_aarch64_unknown_linux_musl_152_2_0_release",
":binding_generated_152_2_0",
],
profile = "sandbox_release",
v8_cpu = "arm64",
+31 -22
View File
@@ -6,7 +6,7 @@ Bazel consumer builds use:
- Codex-published sandbox archive/binding pairs on Darwin, GNU/musl Linux,
and Windows MSVC (x64 and arm64), with checksums pinned from the trusted
release manifests
- source-built V8 archives on Windows GNU
- source-built V8 archives and matching generated bindings on Windows GNU
Local Cargo builds still use upstream prebuilt `rusty_v8` archives by default.
Selected Cargo CI, release, and package builds override
@@ -15,14 +15,17 @@ sets those variables independently in `MODULE.bazel`, selecting the pair above
for its consumers. All Bazel compilation modes use the same published V8
release archive on supported platforms.
The Bazel `v8` crate feature selection enables V8's in-process sandbox.
Darwin/Linux consumers use the matching published pair by default.
For a source build use `--//:rusty_v8_from_source=true`; both archive and
bindings then come from the source path. Source targets enforce the workspace
runtime and sandbox/pointer-compression ABI. Release-pair targets enforce either
the legacy or the sandbox ABI plus Chromium's pinned runtime. Target CPU follows
the named artifact. The underlying V8 settings are internal, and callers do
not pass separate V8 feature or libc++ flags.
The Bazel `v8` crate and its native source targets enable V8's in-process
sandbox and pointer compression. For instrumentation, use
`--//:rusty_v8_from_source=true`: on Darwin, Linux and native Windows MSVC
the archive and bindings both come from source instead of the pinned published
sandbox pair. The published archive cannot incorporate native debug or sanitizer
settings.
Source targets enforce the workspace runtime and sandbox/pointer-compression
ABI. Release-pair targets enforce either the legacy or sandbox ABI plus
Chromium's pinned runtime. Target CPU follows the named artifact. These V8
settings are internal; callers do not pass separate V8 feature or libc++ flags.
Current pinned versions:
@@ -130,20 +133,25 @@ This depends on libc++'s shared exception-object ABI; updates to either libc++
revision must keep the native GNU link/runtime checks passing. The Bazel pair targets above still point directly to source
targets so a new release or canary never depends on an older published copy.
Native Windows x64 and ARM64 hosts can build sandbox archives with pinned
clang-cl and the installed Microsoft SDK using
Native Windows x64 and ARM64 hosts can build sandbox archives and matching
Rust bindings with pinned clang-cl and the installed Microsoft SDK using
`//third_party/v8:v8_152_2_0_x86_64_pc_windows_msvc_bazel` and
`//third_party/v8:v8_152_2_0_aarch64_pc_windows_msvc_bazel`.
`//third_party/v8:rusty_v8_native_windows_archive_for_target` selects these source
outputs directly. These targets bundle Chromium libc++ and compiler builtins,
and fix pointer compression and sandboxing to the published Windows contract.
The owned engine policy also preserves the GN MSVC defaults for GC-managed
microtask queues, random Wasm module generation, disabled imminent-deprecation
warnings, and external TypedArray backing stores. Other source targets retain
the published Unix policy, including a 64-byte inline TypedArray threshold.
These are fixed platform choices, not additional developer build switches.
Matching generated Rust bindings, consumer selection, and publishing integration
are added separately; existing MSVC consumers continue using the prebuilt pair.
The producer selectors `//third_party/v8:rusty_v8_native_windows_archive_for_target`
and `//third_party/v8:rusty_v8_native_windows_binding_for_target` select source
outputs directly. Both use the same sandbox, pointer compression, target CPU,
and Chromium libc++ profile. The bindings use V8's compiled headers and defines
so their sizes follow the archive, including CppGC members. Default MSVC
consumers keep the published pair; `--//:rusty_v8_from_source=true` selects
the newly built archive and bindings together.
The owned engine policy preserves the GN MSVC defaults for GC-managed microtask
queues, random Wasm module generation, disabled imminent-deprecation warnings,
and external TypedArray backing stores. Other source targets retain the published
Unix policy, including a 64-byte inline TypedArray threshold. Generated Rust
bindings use that same threshold; never pair a native 64-byte threshold with
GN's size-zero binding constant. These are fixed platform choices, not additional
developer build switches.
Use a native Visual Studio Developer PowerShell with the C++ tools and Windows
SDK available. The SDK supplies headers, libraries, `dumpbin.exe`, and the
@@ -152,7 +160,8 @@ assembler. From the repo root, build the archive for that host:
```powershell
bazel build --config=ci-windows-msvc `
--host_platform=//:local_windows_msvc --platforms=//:local_windows_msvc `
//third_party/v8:rusty_v8_native_windows_archive_for_target
//third_party/v8:rusty_v8_native_windows_archive_for_target `
//third_party/v8:rusty_v8_native_windows_binding_for_target
```
Bazel fetches and verifies LLVM 22.1.8 for the host, the same major and patch
+18
View File
@@ -32,6 +32,24 @@ package(default_visibility = ["//visibility:public"])
exports_files(["BUILD.bazel"])
filegroup(name = "llvm-readobj", srcs = glob(["bin/llvm-readobj.exe"], allow_empty = True))
filegroup(name = "llvm-lib", srcs = glob(["bin/llvm-lib.exe"], allow_empty = True))
# Tool paths alone do not invalidate cached C++ actions when the pin changes.
# Keep compiler resources and bundled runtime DLLs in the toolchain inputs.
filegroup(
name = "compiler_files",
srcs = glob(["bin/clang-cl.exe", "bin/*.dll", "lib/clang/*/include/**"], allow_empty = True),
)
filegroup(
name = "linker_files",
srcs = glob(["bin/lld-link.exe", "bin/*.dll"], allow_empty = True),
)
filegroup(
name = "archiver_files",
srcs = glob(["bin/llvm-lib.exe", "bin/*.dll"], allow_empty = True),
)
filegroup(
name = "all_files",
srcs = [":compiler_files", ":linker_files", ":archiver_files"],
)
[
filegroup(
name = "builtins_" + arch,
+5 -30
View File
@@ -5,6 +5,11 @@ filegroup(
srcs = ["src/binding.cc"],
)
filegroup(
name = "binding_hpp",
srcs = ["src/binding.hpp"],
)
filegroup(
name = "crdtp_binding_cc",
srcs = ["src/crdtp_binding.cc"],
@@ -14,33 +19,3 @@ filegroup(
name = "support_h",
srcs = ["src/support.h"],
)
filegroup(
name = "src_binding_release_aarch64_apple_darwin",
srcs = ["gen/src_binding_release_aarch64-apple-darwin.rs"],
)
filegroup(
name = "src_binding_release_x86_64_apple_darwin",
srcs = ["gen/src_binding_release_x86_64-apple-darwin.rs"],
)
filegroup(
name = "src_binding_release_aarch64_unknown_linux_gnu",
srcs = ["gen/src_binding_release_aarch64-unknown-linux-gnu.rs"],
)
filegroup(
name = "src_binding_release_x86_64_unknown_linux_gnu",
srcs = ["gen/src_binding_release_x86_64-unknown-linux-gnu.rs"],
)
filegroup(
name = "src_binding_release_x86_64_pc_windows_msvc",
srcs = ["gen/src_binding_release_x86_64-pc-windows-msvc.rs"],
)
filegroup(
name = "src_binding_release_aarch64_pc_windows_msvc",
srcs = ["gen/src_binding_release_aarch64-pc-windows-msvc.rs"],
)