mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
7cdeab33d1
## Summary Move the rusty_v8 artifact production into hermetic Bazel path and bump the `v8` crate to `147.4.0` The new flow builds V8 release artifacts from source for Darwin and Linux targets, publishes both the current release-compatible artifacts and sandbox-enabled variants, and keeps Cargo consumers on prebuilt binaries by continuing to feed the `v8` crate the archive and generated binding files it already expects. ## Why We need control over V8 build-time features without giving up prebuilt artifacts for downstream Cargo builds. Upstream `rusty_v8` already supports source-only features such as `v8_enable_sandbox`, but its normal prebuilt release assets do not cover every feature combination we need. Building the artifacts ourselves lets us enable settings such as the V8 sandbox and pointer compression at artifact build time, then publish those outputs so ordinary Cargo builds can still consume prebuilts instead of compiling V8 locally. This keeps the fast consumer experience of prebuilt `rusty_v8` archives while giving us a reproducible path to ship featureful variants that upstream does not currently publish for us. ## Implementation Notes The Bazel graph in this PR is not copied wholesale from `rusty_v8`; `rusty_v8`'s normal source build is still GN/Ninja-based. Instead, this change starts from upstream V8's Bazel rules and adapts them to Codex's hermetic toolchains and dependency layout. Where we intentionally follow `rusty_v8`, we mirror its existing artifact contract: - the same `v8` crate version and generated binding expectations - the same sandbox feature relationship, where sandboxing requires pointer compression - the same custom libc++ model expected by Cargo's default `use_custom_libcxx` feature - the same release-style archive plus `src_binding` outputs consumed by the `v8` crate To preserve that contract, the Bazel release path pins the libc++, libc++abi, and llvm-libc revisions used by `rusty_v8 v147.4.0`, builds release artifacts with `--config=rusty-v8-upstream-libcxx`, and folds the matching runtime objects into the final static archive. ## Windows Windows is annoyingly handled differently. Codex's current hermetic Bazel Windows C++ platform is `windows-gnullvm` / `x86_64-w64-windows-gnu`, while upstream `rusty_v8` publishes Windows prebuilts for `*-pc-windows-msvc`. Those are different ABIs, so the Bazel graph cannot truthfully reproduce the upstream MSVC artifacts until we add a real MSVC-targeting C++ toolchain. For now: - Windows MSVC consumers continue to use upstream `rusty_v8` release archives. - Windows GNU targets are built in-tree so they link against a matching GNU ABI. - The canary workflow separately exercises upstream `rusty_v8` source builds for MSVC sandbox artifacts, but MSVC is not yet part of the Bazel-produced release matrix. ## Validation This PR is technically self validating through CI. I have already published it as a release tag so the artifacts from this branch are published to https://github.com/openai/codex/releases/tag/rusty-v8-v147.4.0 CI for this PR should therefore consume our own release targets. I have also locally tested for linux and darwin. --------- Co-authored-by: Codex <noreply@openai.com>
56 lines
1.4 KiB
Plaintext
56 lines
1.4 KiB
Plaintext
#ifndef _LIBCPP_CONFIG_SITE
|
|
#define _LIBCPP_CONFIG_SITE
|
|
|
|
#define _LIBCPP_ABI_NAMESPACE __Cr
|
|
#define _LIBCPP_ABI_VERSION 2
|
|
|
|
#define _LIBCPP_ABI_FORCE_ITANIUM 0
|
|
#define _LIBCPP_ABI_FORCE_MICROSOFT 0
|
|
#define _LIBCPP_HAS_THREADS 1
|
|
#define _LIBCPP_HAS_MONOTONIC_CLOCK 1
|
|
#define _LIBCPP_HAS_TERMINAL 1
|
|
|
|
#ifdef ANDROID_HOST_MUSL
|
|
#define _LIBCPP_HAS_MUSL_LIBC 1
|
|
#else
|
|
#define _LIBCPP_HAS_MUSL_LIBC 0
|
|
#endif
|
|
|
|
#ifdef _WIN32
|
|
#define _LIBCPP_HAS_THREAD_API_PTHREAD 0
|
|
#define _LIBCPP_HAS_THREAD_API_EXTERNAL 0
|
|
#define _LIBCPP_HAS_THREAD_API_WIN32 1
|
|
#else
|
|
#define _LIBCPP_HAS_THREAD_API_PTHREAD 1
|
|
#define _LIBCPP_HAS_THREAD_API_EXTERNAL 0
|
|
#define _LIBCPP_HAS_THREAD_API_WIN32 0
|
|
#endif
|
|
|
|
#define _LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS 0
|
|
#define _LIBCPP_HAS_FILESYSTEM 1
|
|
#define _LIBCPP_HAS_RANDOM_DEVICE 1
|
|
#define _LIBCPP_HAS_LOCALIZATION 1
|
|
#define _LIBCPP_HAS_UNICODE 1
|
|
#define _LIBCPP_HAS_WIDE_CHARACTERS 1
|
|
#define _LIBCPP_HAS_TIME_ZONE_DATABASE 1
|
|
|
|
#if defined(__APPLE__)
|
|
#define _LIBCPP_PSTL_BACKEND_LIBDISPATCH
|
|
#else
|
|
#define _LIBCPP_PSTL_BACKEND_STD_THREAD
|
|
#endif
|
|
|
|
#define _LIBCPP_ASSERTION_SEMANTIC_DEFAULT \
|
|
_LIBCPP_ASSERTION_SEMANTIC_HARDENING_DEPENDENT
|
|
|
|
#define _LIBCPP_LIBC_PICOLIBC 0
|
|
#define _LIBCPP_LIBC_NEWLIB 0
|
|
|
|
#define _LIBCPP_NO_AUTO_LINK
|
|
#define _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
|
|
#define _LIBCPP_NO_ABI_TAG
|
|
#define _LIBCPP_VERBOSE_ABORT(...) ::std::__libcpp_verbose_abort(__VA_ARGS__)
|
|
#define _LIBCPP_HAS_NO_INCOMPLETE_PSTL
|
|
|
|
#endif // _LIBCPP_CONFIG_SITE
|