mirror of
https://github.com/openai/codex.git
synced 2026-10-29 19:08:43 +00:00
## Why The Bazel V8 source build supported Windows GNU but lacked an MSVC-targeting toolchain to produce `*-pc-windows-msvc` archives. ## What changed - Add opt-in archive targets for native Windows x64 and ARM64 hosts, selected by `//third_party/v8:rusty_v8_native_windows_archive_for_target`. - Fetch pinned LLVM and scope its `clang-cl` toolchain to V8 artifacts, using the installed Microsoft SDK. Bundle Chromium libc++ and compiler-rt builtins into the resulting `.lib`. - Adapt V8 dependencies, assembly, snapshot generation, and platform feature settings for MSVC, and derive test metadata from the selected engine features. - Document the native build workflow. Existing MSVC consumers continue using prebuilt artifacts; generated Rust bindings and publishing integration remain separate. GitOrigin-RevId: abd5049245aece90a116fc3bfeac2b158a76f6af
46 lines
1.7 KiB
Python
46 lines
1.7 KiB
Python
"""Owned V8 source selection and test metadata derived from the engine policy."""
|
|
|
|
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
|
|
load("@v8//:bazel/defs.bzl", "FlagInfo", "build_config_content")
|
|
|
|
def _options_impl(ctx):
|
|
return FlagInfo(value = ctx.build_setting_value)
|
|
|
|
# Source-only features keep upstream select names without adding CLI options.
|
|
# ABI/runtime selections are internal settings controlled by artifact profiles.
|
|
v8_fixed_source_features = rule(
|
|
implementation = _options_impl,
|
|
build_setting = config.bool(flag = False),
|
|
)
|
|
|
|
def _v8_build_config_impl(ctx):
|
|
config = json.decode(build_config_content(json.encode(ctx.attr.arch), "true" if ctx.attr.icu else "false"))
|
|
defines = ctx.attr.config[CcInfo].compilation_context.defines.to_list()
|
|
config.update({
|
|
"cppgc_microtask_queue": "V8_CPPGC_MICROTASK_QUEUE" in defines,
|
|
"wasm_random_fuzzers": "V8_WASM_RANDOM_FUZZERS" in defines,
|
|
})
|
|
ctx.actions.write(ctx.outputs.out, json.encode(config) + "\n")
|
|
return [DefaultInfo(files = depset([ctx.outputs.out]))]
|
|
|
|
_v8_build_config = rule(
|
|
implementation = _v8_build_config_impl,
|
|
attrs = {
|
|
"arch": attr.string(mandatory = True),
|
|
"config": attr.label(mandatory = True, providers = [CcInfo]),
|
|
"icu": attr.bool(mandatory = True),
|
|
"out": attr.output(mandatory = True),
|
|
},
|
|
)
|
|
|
|
def v8_build_config(name, arch):
|
|
"""Keep upstream test metadata aligned with the owned platform features."""
|
|
for mode in ["icu", "noicu"]:
|
|
_v8_build_config(
|
|
name = mode + "/" + name,
|
|
arch = arch,
|
|
config = ":define_flags",
|
|
icu = mode == "icu",
|
|
out = mode + "/" + name + ".json",
|
|
)
|