mirror of
https://github.com/openai/codex.git
synced 2026-11-10 21:00:47 +00:00
## Why Windows MSVC builds relied on installed C++ toolchains, and V8 snapshot generation required native Windows execution. Cross-compiling V8 also needs a Windows snapshot generator to preserve Windows unwind metadata. ## What changed - Use the registered hermetic LLVM toolchain and declared Microsoft SDK for Windows MSVC builds, with static CRT linkage and the toolchain's declared `lld-link` for Rust. - Run Windows V8 snapshot generators natively or through `rules_wine` on Linux, preserving target CPU, OS, and sandbox settings. Keep separate archive and binding pairs for the workspace's ISO stdio ABI and the distributed MSVC stdio ABI. - Update build dependencies and bindgen, scope V8's Chromium libc++ settings to its own targets, and adapt native voice dependencies for clang-cl and Windows ARM64. - Build SQLite directly with Bazel and give `openssl-sys` an explicit build using Bazel's OpenSSL. - Remove build-worker source-directory dependencies from Bazel resource lookup, schema output discovery, and snapshot paths; embed assets in debug builds as well. GitOrigin-RevId: fd224d9d28d73a67baf90f6d73c6079d60f20351
802 lines
27 KiB
Python
802 lines
27 KiB
Python
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_import", "cc_library")
|
|
load("@rules_rs//rs:rules_rust_bindgen.bzl", "rust_bindgen")
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
exports_files([
|
|
"abseil.BUILD.bazel",
|
|
"abseil_lifetime_capture.patch",
|
|
"abseil_repository.bzl",
|
|
"artifact_profile.bzl",
|
|
"binary.bzl",
|
|
"dependencies.bzl",
|
|
"dependency_config.bzl",
|
|
"dragonbox.BUILD.bazel",
|
|
"engine.BUILD.bazel",
|
|
"engine_repository.bzl",
|
|
"engine_rules.bzl",
|
|
"fast_float.BUILD.bazel",
|
|
"fp16.BUILD.bazel",
|
|
"highway.BUILD.bazel",
|
|
"icu.BUILD.bazel",
|
|
"libcxx_rules.bzl",
|
|
"native_windows.bzl",
|
|
"windows_snapshot.bzl",
|
|
"v8_windows_snapshot_wine.patch",
|
|
"push_registers_gnullvm.S",
|
|
"simdutf.BUILD.bazel",
|
|
"v8_defs.patch",
|
|
])
|
|
|
|
config_setting(
|
|
name = "platform_windows_msvc",
|
|
constraint_values = [
|
|
"@platforms//os:windows",
|
|
"@llvm//constraints/windows/abi:msvc",
|
|
],
|
|
)
|
|
|
|
config_setting(
|
|
name = "use_rusty_v8_custom_libcxx",
|
|
flag_values = {
|
|
"@v8//:v8_use_rusty_v8_custom_libcxx": "True",
|
|
},
|
|
)
|
|
|
|
config_setting(
|
|
name = "use_rusty_v8_custom_libcxx_native_windows",
|
|
constraint_values = [
|
|
"@platforms//os:windows",
|
|
"@llvm//constraints/windows/abi:msvc",
|
|
],
|
|
flag_values = {
|
|
"@v8//:v8_use_rusty_v8_custom_libcxx": "True",
|
|
},
|
|
)
|
|
|
|
alias(
|
|
name = "v8_152_2_0_x86_64_pc_windows_msvc",
|
|
actual = "@rusty_v8_152_2_0_x86_64_pc_windows_msvc_archive//file",
|
|
)
|
|
|
|
alias(
|
|
name = "v8_152_2_0_aarch64_pc_windows_msvc",
|
|
actual = "@rusty_v8_152_2_0_aarch64_pc_windows_msvc_archive//file",
|
|
)
|
|
|
|
alias(
|
|
name = "v8_152_2_0_aarch64_pc_windows_gnullvm",
|
|
# `rusty_v8` only ships prebuilt Windows archives for MSVC. Build the
|
|
# GNU-flavored archive in-tree so windows-gnullvm consumers can link
|
|
# against a matching ABI instead of trying to reuse the MSVC release.
|
|
actual = ":v8_152_2_0_aarch64_pc_windows_gnullvm_bazel",
|
|
)
|
|
|
|
alias(
|
|
name = "v8_152_2_0_x86_64_pc_windows_gnullvm",
|
|
actual = ":v8_152_2_0_x86_64_pc_windows_gnullvm_bazel",
|
|
)
|
|
|
|
alias(
|
|
name = "rusty_v8_archive_for_target",
|
|
actual = ":rusty_v8_source_archive_for_target",
|
|
)
|
|
|
|
# Use LLVM's libc-aware Linux selectors for archives and bindings: LLVM musl
|
|
# platforms omit rules_rs' separate libc constraint, which defaults to glibc.
|
|
alias(
|
|
name = "rusty_v8_prebuilt_archive_for_target",
|
|
actual = select({
|
|
"@rules_rs//rs/platforms/config:aarch64-pc-windows-msvc": ":v8_152_2_0_aarch64_pc_windows_msvc",
|
|
"@rules_rs//rs/platforms/config:x86_64-pc-windows-msvc": ":v8_152_2_0_x86_64_pc_windows_msvc",
|
|
"@rules_rs//rs/platforms/config:aarch64-apple-darwin": "@rusty_v8_152_2_0_aarch64_apple_darwin_archive//file",
|
|
"@llvm//platforms/config:linux_aarch64_gnu": ":v8_152_2_0_aarch64_unknown_linux_gnu_prebuilt",
|
|
"@rules_rs//rs/platforms/config:x86_64-apple-darwin": "@rusty_v8_152_2_0_x86_64_apple_darwin_archive//file",
|
|
"@llvm//platforms/config:linux_x86_64_gnu": ":v8_152_2_0_x86_64_unknown_linux_gnu_prebuilt",
|
|
"@llvm//platforms/config:linux_aarch64_musl": ":v8_152_2_0_aarch64_unknown_linux_musl_prebuilt",
|
|
"@llvm//platforms/config:linux_x86_64_musl": ":v8_152_2_0_x86_64_unknown_linux_musl_prebuilt",
|
|
"//conditions:default": ":rusty_v8_source_archive_for_target",
|
|
}),
|
|
)
|
|
|
|
# A Linux Codex release archive carries Chromium's namespaced libc++ runtime.
|
|
# Bazel also links its own libc++. Both keep their exception classes in std::,
|
|
# so prefer the toolchain definitions of just those shared ABI entry points.
|
|
# Inputs remain checksum-verified and immutable; only the Bazel output changes.
|
|
[
|
|
genrule(
|
|
name = "v8_152_2_0_%s_unknown_linux_%s_prebuilt" % (arch, libc),
|
|
srcs = [
|
|
":gnu_libcxx_shared_exception_symbols.txt",
|
|
"@rusty_v8_152_2_0_%s_unknown_linux_%s_archive//file" % (arch, libc),
|
|
],
|
|
outs = ["libv8_152_2_0_%s_unknown_linux_%s_prebuilt.a" % (arch, libc)],
|
|
cmd = """
|
|
gzip -dc "$(location @rusty_v8_152_2_0_%s_unknown_linux_%s_archive//file)" > "$@.unadjusted"
|
|
$(location @llvm//tools:llvm-objcopy) \
|
|
--weaken-symbols="$(location :gnu_libcxx_shared_exception_symbols.txt)" \
|
|
"$@.unadjusted" "$@"
|
|
rm "$@.unadjusted"
|
|
""" % (arch, libc),
|
|
tools = ["@llvm//tools:llvm-objcopy"],
|
|
)
|
|
for arch in [
|
|
"aarch64",
|
|
"x86_64",
|
|
]
|
|
for libc in [
|
|
"gnu",
|
|
"musl",
|
|
]
|
|
]
|
|
|
|
alias(
|
|
name = "rusty_v8_source_archive_for_target",
|
|
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_workspace",
|
|
"@llvm//platforms/config:linux_aarch64_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.
|
|
"@llvm//platforms/config:linux_aarch64_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_workspace",
|
|
"@llvm//platforms/config:linux_x86_64_gnu": ":v8_152_2_0_x86_64_unknown_linux_gnu_bazel",
|
|
"@llvm//platforms/config:linux_x86_64_musl": ":v8_152_2_0_x86_64_unknown_linux_musl_release",
|
|
"//conditions:default": ":v8_152_2_0_x86_64_unknown_linux_gnu_bazel",
|
|
}),
|
|
)
|
|
|
|
alias(
|
|
name = "rusty_v8_binding_for_target",
|
|
actual = ":rusty_v8_source_binding_for_target",
|
|
)
|
|
|
|
alias(
|
|
name = "rusty_v8_prebuilt_binding_for_target",
|
|
actual = select({
|
|
"@rules_rs//rs/platforms/config:aarch64-pc-windows-msvc": "@rusty_v8_152_2_0_aarch64_pc_windows_msvc_binding//file",
|
|
"@rules_rs//rs/platforms/config:x86_64-pc-windows-msvc": "@rusty_v8_152_2_0_x86_64_pc_windows_msvc_binding//file",
|
|
"@rules_rs//rs/platforms/config:aarch64-apple-darwin": "@rusty_v8_152_2_0_aarch64_apple_darwin_binding//file",
|
|
"@llvm//platforms/config:linux_aarch64_gnu": "@rusty_v8_152_2_0_aarch64_unknown_linux_gnu_binding//file",
|
|
"@rules_rs//rs/platforms/config:x86_64-apple-darwin": "@rusty_v8_152_2_0_x86_64_apple_darwin_binding//file",
|
|
"@llvm//platforms/config:linux_x86_64_gnu": "@rusty_v8_152_2_0_x86_64_unknown_linux_gnu_binding//file",
|
|
"@llvm//platforms/config:linux_aarch64_musl": "@rusty_v8_152_2_0_aarch64_unknown_linux_musl_binding//file",
|
|
"@llvm//platforms/config:linux_x86_64_musl": "@rusty_v8_152_2_0_x86_64_unknown_linux_musl_binding//file",
|
|
"//conditions:default": ":rusty_v8_source_binding_for_target",
|
|
}),
|
|
)
|
|
|
|
alias(
|
|
name = "rusty_v8_source_binding_for_target",
|
|
actual = select({
|
|
"@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_workspace",
|
|
"@llvm//platforms/config:linux_aarch64_gnu": ":src_binding_aarch64_unknown_linux_gnu_152_2_0_bazel",
|
|
"@llvm//platforms/config:linux_aarch64_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_workspace",
|
|
"@llvm//platforms/config:linux_x86_64_gnu": ":src_binding_x86_64_unknown_linux_gnu_152_2_0_bazel",
|
|
"@llvm//platforms/config:linux_x86_64_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",
|
|
}),
|
|
)
|
|
|
|
V8_COPTS = select({
|
|
":platform_windows_msvc": [
|
|
"/std:c++20",
|
|
"/Zc:__cplusplus",
|
|
],
|
|
"//conditions:default": ["-std=c++20"],
|
|
})
|
|
|
|
V8_CUSTOM_LIBCXX_COPTS = select({
|
|
":use_rusty_v8_custom_libcxx_native_windows": [
|
|
"/D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
|
|
"/D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE",
|
|
"/D_LIBCPP_INSTRUMENTED_WITH_ASAN=0",
|
|
],
|
|
":use_rusty_v8_custom_libcxx": [
|
|
"-nostdinc++",
|
|
"-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
|
|
"-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE",
|
|
"-D_LIBCPP_INSTRUMENTED_WITH_ASAN=0",
|
|
"-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
|
|
],
|
|
"//conditions:default": [],
|
|
})
|
|
|
|
V8_STATIC_LIBRARY_FEATURES = [
|
|
"-symbol_check",
|
|
"-validate-static-library",
|
|
]
|
|
|
|
alias(
|
|
name = "rusty_v8_llvm_libc_headers",
|
|
actual = "@rusty_v8_llvm_libc//:v8_headers",
|
|
)
|
|
|
|
cc_library(
|
|
name = "rusty_v8_custom_libcxx_headers",
|
|
defines = select({
|
|
"@llvm//platforms/config:linux_aarch64_musl": ["ANDROID_HOST_MUSL"],
|
|
"@llvm//platforms/config:linux_x86_64_musl": ["ANDROID_HOST_MUSL"],
|
|
"//conditions:default": [],
|
|
}),
|
|
visibility = ["//visibility:public"],
|
|
deps = ["@rusty_v8_libcxx//:headers"] + select({
|
|
":use_rusty_v8_custom_libcxx_native_windows": [],
|
|
"//conditions:default": ["@rusty_v8_libcxxabi//:headers"],
|
|
}),
|
|
)
|
|
|
|
cc_library(
|
|
name = "rusty_v8_custom_libcxx_runtime",
|
|
visibility = ["//visibility:public"],
|
|
deps = ["@rusty_v8_libcxx//:libcxx"] + select({
|
|
":use_rusty_v8_custom_libcxx_native_windows": [],
|
|
"//conditions:default": ["@rusty_v8_libcxxabi//:libcxxabi"],
|
|
}),
|
|
)
|
|
|
|
genrule(
|
|
name = "binding_cc_152_2_0",
|
|
srcs = ["@v8_crate_152_2_0//:binding_cc"],
|
|
outs = ["binding_152_2_0.cc"],
|
|
cmd = " ".join([
|
|
"sed",
|
|
"-e '/#include \"v8\\/src\\/flags\\/flags.h\"/d'",
|
|
"-e 's|\"v8/src/libplatform/default-platform.h\"|\"src/libplatform/default-platform.h\"|'",
|
|
"-e 's|#include \"support.h\"|#include \"support_152_2_0.h\"|'",
|
|
"-e 's| namespace i = v8::internal;| (void)usage;|'",
|
|
"-e '/using HelpOptions = i::FlagList::HelpOptions;/d'",
|
|
"-e '/HelpOptions help_options = HelpOptions(HelpOptions::kExit, usage);/d'",
|
|
"-e 's| i::FlagList::SetFlagsFromCommandLine(argc, argv, true, help_options);| v8::V8::SetFlagsFromCommandLine(argc, argv, true);|'",
|
|
"$(location @v8_crate_152_2_0//:binding_cc)",
|
|
">",
|
|
'"$@"',
|
|
]),
|
|
)
|
|
|
|
genrule(
|
|
name = "crdtp_binding_cc_152_2_0",
|
|
srcs = ["@v8_crate_152_2_0//:crdtp_binding_cc"],
|
|
outs = ["crdtp_binding_152_2_0.cc"],
|
|
cmd = " ".join([
|
|
"sed",
|
|
"-e 's|#include \"support.h\"|#include \"support_152_2_0.h\"|'",
|
|
"-e 's|\"v8/third_party/inspector_protocol/|\"third_party/inspector_protocol/|g'",
|
|
"$(location @v8_crate_152_2_0//:crdtp_binding_cc)",
|
|
">",
|
|
'"$@"',
|
|
]),
|
|
)
|
|
|
|
copy_file(
|
|
name = "support_h_152_2_0",
|
|
src = "@v8_crate_152_2_0//:support_h",
|
|
out = "support_152_2_0.h",
|
|
)
|
|
|
|
cc_library(
|
|
name = "v8_152_2_0_binding",
|
|
srcs = [
|
|
":binding_cc_152_2_0",
|
|
":crdtp_binding_cc_152_2_0",
|
|
],
|
|
hdrs = [":support_h_152_2_0"],
|
|
copts = V8_COPTS + V8_CUSTOM_LIBCXX_COPTS,
|
|
deps = [
|
|
"@v8//:core_lib_icu",
|
|
"@v8//:rusty_v8_crdtp_headers",
|
|
"@v8//:rusty_v8_internal_headers",
|
|
] + select({
|
|
":use_rusty_v8_custom_libcxx": [
|
|
":rusty_v8_custom_libcxx_headers",
|
|
],
|
|
"//conditions:default": [],
|
|
}),
|
|
)
|
|
|
|
cc_import(
|
|
name = "native_windows_compiler_builtins",
|
|
static_library = "@llvm//runtimes/compiler-rt:clang_rt.builtins.static",
|
|
tags = ["manual"],
|
|
target_compatible_with = select({
|
|
":platform_windows_msvc": [],
|
|
"//conditions:default": ["@platforms//:incompatible"],
|
|
}),
|
|
)
|
|
|
|
# Compile the pinned Chromium libc++ into V8 with the Microsoft CRT.
|
|
cc_static_library(
|
|
name = "v8_152_2_0_native_windows_objects",
|
|
features = V8_STATIC_LIBRARY_FEATURES,
|
|
tags = ["manual"],
|
|
target_compatible_with = select({
|
|
":platform_windows_msvc": [],
|
|
"//conditions:default": ["@platforms//:incompatible"],
|
|
}),
|
|
deps = [
|
|
":rusty_v8_custom_libcxx_runtime",
|
|
":v8_152_2_0_binding",
|
|
],
|
|
)
|
|
|
|
# cc_static_library does not collect objects from imported archives. Merge the
|
|
# source-built compiler-rt archive with the declared exec-platform llvm-lib.
|
|
genrule(
|
|
name = "v8_152_2_0_native_windows_library",
|
|
srcs = [
|
|
":v8_152_2_0_native_windows_objects",
|
|
"@llvm//runtimes/compiler-rt:clang_rt.builtins.static",
|
|
],
|
|
outs = ["rusty_v8_native_windows.lib"],
|
|
cmd = '"$(execpath @llvm//tools:llvm-lib)" /NOLOGO /OUT:"$@" "$(location :v8_152_2_0_native_windows_objects)" "$(location @llvm//runtimes/compiler-rt:clang_rt.builtins.static)"',
|
|
cmd_bat = '""$(execpath @llvm//tools:llvm-lib)" /NOLOGO /OUT:"$@" "$(location :v8_152_2_0_native_windows_objects)" "$(location @llvm//runtimes/compiler-rt:clang_rt.builtins.static)""',
|
|
tags = ["manual"],
|
|
target_compatible_with = [
|
|
"@platforms//os:windows",
|
|
"@llvm//constraints/windows/abi:msvc",
|
|
],
|
|
tools = ["@llvm//tools:llvm-lib"],
|
|
)
|
|
|
|
# Workspace binaries use the hermetic toolchain's ISO stdio ABI. Distributed
|
|
# archives must link with the stock MSVC CRT. Generate a matching binding for
|
|
# each archive under the same profile.
|
|
[
|
|
v8_artifact_files(
|
|
name = label_pattern % (arch, suffix),
|
|
srcs = [source],
|
|
profile = profile,
|
|
tags = ["manual"],
|
|
target_compatible_with = [
|
|
"@platforms//cpu:%s" % arch,
|
|
"@platforms//os:windows",
|
|
"@llvm//constraints/windows/abi:msvc",
|
|
],
|
|
v8_cpu = cpu,
|
|
)
|
|
for arch, cpu in [
|
|
("x86_64", "x64"),
|
|
("aarch64", "arm64"),
|
|
]
|
|
for label_pattern, source in [
|
|
("v8_152_2_0_%s_pc_windows_msvc_%s", ":v8_152_2_0_native_windows_library"),
|
|
("src_binding_%s_pc_windows_msvc_152_2_0_%s", ":binding_generated_152_2_0"),
|
|
]
|
|
for suffix, profile in [
|
|
("workspace", "source"),
|
|
("bazel", "sandbox_release"),
|
|
]
|
|
]
|
|
|
|
# Producer selectors never fall back to published inputs. Keep them separate
|
|
# from the consumer aliases so a version upgrade can build before publishing.
|
|
alias(
|
|
name = "rusty_v8_native_windows_archive_for_target",
|
|
actual = select({
|
|
"@rules_rs//rs/platforms/config:aarch64-pc-windows-msvc": ":v8_152_2_0_aarch64_pc_windows_msvc_bazel",
|
|
"@rules_rs//rs/platforms/config:x86_64-pc-windows-msvc": ":v8_152_2_0_x86_64_pc_windows_msvc_bazel",
|
|
}),
|
|
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++",
|
|
] + V8_COPTS + 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_gnu": ["--target=aarch64-unknown-linux-gnu"],
|
|
"@llvm//platforms/config:linux_aarch64_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_gnu": ["--target=x86_64-unknown-linux-gnu"],
|
|
"@llvm//platforms/config:linux_x86_64_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_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,
|
|
visibility = ["//visibility:private"],
|
|
deps = [
|
|
":rusty_v8_custom_libcxx_runtime",
|
|
":v8_152_2_0_binding",
|
|
],
|
|
)
|
|
|
|
cc_static_library(
|
|
name = "_v8_152_2_0_aarch64_unknown_linux_gnu_bazel_base",
|
|
features = V8_STATIC_LIBRARY_FEATURES,
|
|
visibility = ["//visibility:private"],
|
|
deps = [
|
|
":rusty_v8_custom_libcxx_runtime",
|
|
":v8_152_2_0_binding",
|
|
],
|
|
)
|
|
|
|
cc_static_library(
|
|
name = "_v8_152_2_0_aarch64_pc_windows_gnullvm_bazel",
|
|
features = V8_STATIC_LIBRARY_FEATURES,
|
|
visibility = ["//visibility:private"],
|
|
deps = [":v8_152_2_0_binding"],
|
|
)
|
|
|
|
cc_static_library(
|
|
name = "_v8_152_2_0_aarch64_unknown_linux_musl_release_base",
|
|
features = V8_STATIC_LIBRARY_FEATURES,
|
|
visibility = ["//visibility:private"],
|
|
deps = [
|
|
":rusty_v8_custom_libcxx_runtime",
|
|
":v8_152_2_0_binding",
|
|
],
|
|
)
|
|
|
|
# Rust's compiler-builtins omit __clear_cache on ARM64 Linux, while V8 calls
|
|
# it to flush generated code. Carry compiler-rt in both native archive inputs.
|
|
# llvm-ar's L modifier merges archive members; s writes the symbol index.
|
|
genrule(
|
|
name = "_v8_152_2_0_aarch64_unknown_linux_gnu_bazel",
|
|
srcs = [
|
|
":_v8_152_2_0_aarch64_unknown_linux_gnu_bazel_base",
|
|
"@llvm//runtimes/compiler-rt:clang_rt.builtins.static",
|
|
],
|
|
outs = ["libv8_152_2_0_aarch64_unknown_linux_gnu.a"],
|
|
cmd = '$(location @llvm//tools:llvm-ar) qcsL "$@" $(SRCS)',
|
|
tools = ["@llvm//tools:llvm-ar"],
|
|
visibility = ["//visibility:private"],
|
|
)
|
|
|
|
genrule(
|
|
name = "_v8_152_2_0_aarch64_unknown_linux_musl_release",
|
|
srcs = [
|
|
":_v8_152_2_0_aarch64_unknown_linux_musl_release_base",
|
|
"@llvm//runtimes/compiler-rt:clang_rt.builtins.static",
|
|
],
|
|
outs = ["libv8_152_2_0_aarch64_unknown_linux_musl.a"],
|
|
cmd = '$(location @llvm//tools:llvm-ar) qcsL "$@" $(SRCS)',
|
|
tools = ["@llvm//tools:llvm-ar"],
|
|
visibility = ["//visibility:private"],
|
|
)
|
|
|
|
cc_static_library(
|
|
name = "_v8_152_2_0_x86_64_apple_darwin_bazel",
|
|
features = V8_STATIC_LIBRARY_FEATURES,
|
|
visibility = ["//visibility:private"],
|
|
deps = [
|
|
":rusty_v8_custom_libcxx_runtime",
|
|
":v8_152_2_0_binding",
|
|
],
|
|
)
|
|
|
|
cc_static_library(
|
|
name = "_v8_152_2_0_x86_64_unknown_linux_gnu_bazel",
|
|
features = V8_STATIC_LIBRARY_FEATURES,
|
|
visibility = ["//visibility:private"],
|
|
deps = [
|
|
":rusty_v8_custom_libcxx_runtime",
|
|
":v8_152_2_0_binding",
|
|
],
|
|
)
|
|
|
|
cc_static_library(
|
|
name = "_v8_152_2_0_x86_64_pc_windows_gnullvm_bazel",
|
|
features = V8_STATIC_LIBRARY_FEATURES,
|
|
visibility = ["//visibility:private"],
|
|
deps = [":v8_152_2_0_binding"],
|
|
)
|
|
|
|
cc_static_library(
|
|
name = "_v8_152_2_0_x86_64_unknown_linux_musl_release",
|
|
features = V8_STATIC_LIBRARY_FEATURES,
|
|
visibility = ["//visibility:private"],
|
|
deps = [
|
|
":rusty_v8_custom_libcxx_runtime",
|
|
":v8_152_2_0_binding",
|
|
],
|
|
)
|
|
|
|
# Local source producers match the Rust consumer's sandbox ABI, and use the
|
|
# workspace C++ runtime. Release pairs below select pinned Chromium libc++ and
|
|
# build the private source nodes directly under their own profiles.
|
|
[
|
|
v8_artifact_files(
|
|
name = name,
|
|
srcs = [":_" + name],
|
|
profile = "source",
|
|
v8_cpu = cpu,
|
|
)
|
|
for name, cpu in [
|
|
("v8_152_2_0_aarch64_apple_darwin_bazel", "arm64"),
|
|
("v8_152_2_0_aarch64_unknown_linux_gnu_bazel", "arm64"),
|
|
("v8_152_2_0_aarch64_pc_windows_gnullvm_bazel", "arm64"),
|
|
("v8_152_2_0_aarch64_unknown_linux_musl_release", "arm64"),
|
|
("v8_152_2_0_x86_64_apple_darwin_bazel", "x64"),
|
|
("v8_152_2_0_x86_64_unknown_linux_gnu_bazel", "x64"),
|
|
("v8_152_2_0_x86_64_pc_windows_gnullvm_bazel", "x64"),
|
|
("v8_152_2_0_x86_64_unknown_linux_musl_release", "x64"),
|
|
]
|
|
]
|
|
|
|
v8_artifact_files(
|
|
name = "rusty_v8_release_pair_x86_64_apple_darwin",
|
|
srcs = [
|
|
":_v8_152_2_0_x86_64_apple_darwin_bazel",
|
|
":binding_generated_152_2_0",
|
|
],
|
|
profile = "release",
|
|
v8_cpu = "x64",
|
|
)
|
|
|
|
v8_artifact_files(
|
|
name = "rusty_v8_release_pair_aarch64_apple_darwin",
|
|
srcs = [
|
|
":_v8_152_2_0_aarch64_apple_darwin_bazel",
|
|
":binding_generated_152_2_0",
|
|
],
|
|
profile = "release",
|
|
v8_cpu = "arm64",
|
|
)
|
|
|
|
v8_artifact_files(
|
|
name = "rusty_v8_release_pair_x86_64_unknown_linux_gnu",
|
|
srcs = [
|
|
":_v8_152_2_0_x86_64_unknown_linux_gnu_bazel",
|
|
":binding_generated_152_2_0",
|
|
],
|
|
profile = "release",
|
|
v8_cpu = "x64",
|
|
)
|
|
|
|
v8_artifact_files(
|
|
name = "rusty_v8_release_pair_aarch64_unknown_linux_gnu",
|
|
srcs = [
|
|
":_v8_152_2_0_aarch64_unknown_linux_gnu_bazel",
|
|
":binding_generated_152_2_0",
|
|
],
|
|
profile = "release",
|
|
v8_cpu = "arm64",
|
|
)
|
|
|
|
v8_artifact_files(
|
|
name = "rusty_v8_release_pair_x86_64_unknown_linux_musl",
|
|
srcs = [
|
|
":_v8_152_2_0_x86_64_unknown_linux_musl_release",
|
|
":binding_generated_152_2_0",
|
|
],
|
|
profile = "release",
|
|
v8_cpu = "x64",
|
|
)
|
|
|
|
v8_artifact_files(
|
|
name = "rusty_v8_release_pair_aarch64_unknown_linux_musl",
|
|
srcs = [
|
|
":_v8_152_2_0_aarch64_unknown_linux_musl_release",
|
|
":binding_generated_152_2_0",
|
|
],
|
|
profile = "release",
|
|
v8_cpu = "arm64",
|
|
)
|
|
|
|
filegroup(
|
|
name = "rusty_v8_release_pair_x86_64_pc_windows_msvc",
|
|
srcs = [
|
|
":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 = [
|
|
":v8_152_2_0_aarch64_pc_windows_msvc",
|
|
"@rusty_v8_152_2_0_aarch64_pc_windows_msvc_binding//file",
|
|
],
|
|
)
|
|
|
|
v8_artifact_files(
|
|
name = "rusty_v8_sandbox_release_pair_x86_64_apple_darwin",
|
|
srcs = [
|
|
":_v8_152_2_0_x86_64_apple_darwin_bazel",
|
|
":binding_generated_152_2_0",
|
|
],
|
|
profile = "sandbox_release",
|
|
v8_cpu = "x64",
|
|
)
|
|
|
|
v8_artifact_files(
|
|
name = "rusty_v8_sandbox_release_pair_aarch64_apple_darwin",
|
|
srcs = [
|
|
":_v8_152_2_0_aarch64_apple_darwin_bazel",
|
|
":binding_generated_152_2_0",
|
|
],
|
|
profile = "sandbox_release",
|
|
v8_cpu = "arm64",
|
|
)
|
|
|
|
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",
|
|
":binding_generated_152_2_0",
|
|
],
|
|
profile = "sandbox_release",
|
|
v8_cpu = "x64",
|
|
)
|
|
|
|
v8_artifact_files(
|
|
name = "rusty_v8_sandbox_release_pair_aarch64_unknown_linux_gnu",
|
|
srcs = [
|
|
":_v8_152_2_0_aarch64_unknown_linux_gnu_bazel",
|
|
":binding_generated_152_2_0",
|
|
],
|
|
profile = "sandbox_release",
|
|
v8_cpu = "arm64",
|
|
)
|
|
|
|
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",
|
|
":binding_generated_152_2_0",
|
|
],
|
|
profile = "sandbox_release",
|
|
v8_cpu = "x64",
|
|
)
|
|
|
|
v8_artifact_files(
|
|
name = "rusty_v8_sandbox_release_pair_aarch64_unknown_linux_musl",
|
|
srcs = [
|
|
":_v8_152_2_0_aarch64_unknown_linux_musl_release",
|
|
":binding_generated_152_2_0",
|
|
],
|
|
profile = "sandbox_release",
|
|
v8_cpu = "arm64",
|
|
)
|