mirror of
https://github.com/openai/codex.git
synced 2026-10-22 17:58:46 +00:00
Keep non-Windows rusty-v8 consumers on the resolved 147.4.0 source-built graph. Avoid mixing LLVM's default libc++ headers into rusty-v8's custom libc++ build, propagate that configuration to external C++ deps, and export the musl-specific libc++ define through the shared header target. Also make checksum validation follow the remaining prebuilt asset version while the source-build migration is in progress. Co-authored-by: Codex <noreply@openai.com>
45 lines
1.6 KiB
Diff
45 lines
1.6 KiB
Diff
diff --git a/cc/cc_library.bzl b/cc/cc_library.bzl
|
|
index c45c5fd954..2e3a01f12a 100644
|
|
--- a/cc/cc_library.bzl
|
|
+++ b/cc/cc_library.bzl
|
|
@@ -15,5 +15,39 @@
|
|
|
|
load("@cc_compatibility_proxy//:proxy.bzl", _cc_library = "cc_library")
|
|
|
|
+_RUSTY_V8_CUSTOM_LIBCXX_COPTS = select({
|
|
+ "@@//third_party/v8: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": [],
|
|
+})
|
|
+
|
|
+_RUSTY_V8_CUSTOM_LIBCXX_DEPS = select({
|
|
+ "@@//third_party/v8:use_rusty_v8_custom_libcxx": [
|
|
+ "@@//third_party/v8:rusty_v8_custom_libcxx_headers",
|
|
+ ],
|
|
+ "//conditions:default": [],
|
|
+})
|
|
+
|
|
+_RUSTY_V8_CUSTOM_LIBCXX_REPOS = [
|
|
+ # V8 and ICU are patched in-tree. These external C++ dependencies still
|
|
+ # build inside the artifact closure once the LLVM toolchain's default
|
|
+ # libc++ headers are suppressed.
|
|
+ "@abseil-cpp+",
|
|
+ "@v8++http_archive+highway",
|
|
+ "@v8++http_archive+simdutf",
|
|
+]
|
|
+
|
|
+def _should_use_rusty_v8_custom_libcxx():
|
|
+ return native.repository_name() in _RUSTY_V8_CUSTOM_LIBCXX_REPOS
|
|
+
|
|
def cc_library(**kwargs):
|
|
+ if _should_use_rusty_v8_custom_libcxx():
|
|
+ kwargs["copts"] = (kwargs.get("copts", []) or []) + _RUSTY_V8_CUSTOM_LIBCXX_COPTS
|
|
+ kwargs["deps"] = (kwargs.get("deps", []) or []) + _RUSTY_V8_CUSTOM_LIBCXX_DEPS
|
|
+ kwargs["features"] = (kwargs.get("features", []) or []) + ["-module_maps"]
|
|
_cc_library(**kwargs)
|