Add v8-poc consumer of our new built v8 (#15203)
This adds a dummy v8-poc project that in Cargo links against our prebuilt binaries and the ones provided by rusty_v8 for non musl platforms. This demonstrates that we can successfully link and use v8 on all platforms that we want to target. In bazel things are slightly more complicated. Since the libraries as published have libc++ linked in already we end up with a lot of double linked symbols if we try to use them in bazel land. Instead we fall back to building rusty_v8 and v8 from source (cached of course) on the platforms we ship to. There is likely some compatibility drift in the windows bazel builder that we'll need to reconcile before we can re-enable them. I'm happy to be on the hook to unwind that.
This commit is contained in:
parent
a941d8439d
commit
1350477150
15 changed files with 752 additions and 120 deletions
18
.github/workflows/rust-ci.yml
vendored
18
.github/workflows/rust-ci.yml
vendored
|
|
@ -447,6 +447,24 @@ jobs:
|
|||
echo "CFLAGS=${cflags}" >> "$GITHUB_ENV"
|
||||
echo "CXXFLAGS=${cxxflags}" >> "$GITHUB_ENV"
|
||||
|
||||
- if: ${{ matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl' }}
|
||||
name: Configure musl rusty_v8 artifact overrides
|
||||
env:
|
||||
TARGET: ${{ matrix.target }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
version="$(python3 "${GITHUB_WORKSPACE}/.github/scripts/rusty_v8_bazel.py" resolved-v8-crate-version)"
|
||||
release_tag="rusty-v8-v${version}"
|
||||
base_url="https://github.com/openai/codex/releases/download/${release_tag}"
|
||||
archive="https://github.com/openai/codex/releases/download/rusty-v8-v${version}/librusty_v8_release_${TARGET}.a.gz"
|
||||
binding_dir="${RUNNER_TEMP}/rusty_v8"
|
||||
binding_path="${binding_dir}/src_binding_release_${TARGET}.rs"
|
||||
mkdir -p "${binding_dir}"
|
||||
curl -fsSL "${base_url}/src_binding_release_${TARGET}.rs" -o "${binding_path}"
|
||||
echo "RUSTY_V8_ARCHIVE=${archive}" >> "$GITHUB_ENV"
|
||||
echo "RUSTY_V8_SRC_BINDING_PATH=${binding_path}" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Install cargo-chef
|
||||
if: ${{ matrix.profile == 'release' }}
|
||||
uses: taiki-e/install-action@44c6d64aa62cd779e873306675c7a58e86d6d532 # v2
|
||||
|
|
|
|||
18
.github/workflows/rust-release.yml
vendored
18
.github/workflows/rust-release.yml
vendored
|
|
@ -210,6 +210,24 @@ jobs:
|
|||
echo "CFLAGS=${cflags}" >> "$GITHUB_ENV"
|
||||
echo "CXXFLAGS=${cxxflags}" >> "$GITHUB_ENV"
|
||||
|
||||
- if: ${{ matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl' }}
|
||||
name: Configure musl rusty_v8 artifact overrides
|
||||
env:
|
||||
TARGET: ${{ matrix.target }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
version="$(python3 "${GITHUB_WORKSPACE}/.github/scripts/rusty_v8_bazel.py" resolved-v8-crate-version)"
|
||||
release_tag="rusty-v8-v${version}"
|
||||
base_url="https://github.com/openai/codex/releases/download/${release_tag}"
|
||||
archive="https://github.com/openai/codex/releases/download/rusty-v8-v${version}/librusty_v8_release_${TARGET}.a.gz"
|
||||
binding_dir="${RUNNER_TEMP}/rusty_v8"
|
||||
binding_path="${binding_dir}/src_binding_release_${TARGET}.rs"
|
||||
mkdir -p "${binding_dir}"
|
||||
curl -fsSL "${base_url}/src_binding_release_${TARGET}.rs" -o "${binding_path}"
|
||||
echo "RUSTY_V8_ARCHIVE=${archive}" >> "$GITHUB_ENV"
|
||||
echo "RUSTY_V8_SRC_BINDING_PATH=${binding_path}" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Cargo build
|
||||
shell: bash
|
||||
run: |
|
||||
|
|
|
|||
107
MODULE.bazel
107
MODULE.bazel
|
|
@ -144,6 +144,33 @@ crate.annotation(
|
|||
)
|
||||
|
||||
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||
http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
|
||||
new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")
|
||||
|
||||
new_local_repository(
|
||||
name = "v8_targets",
|
||||
build_file = "//third_party/v8:BUILD.bazel",
|
||||
path = "third_party/v8",
|
||||
)
|
||||
|
||||
crate.annotation(
|
||||
build_script_data = [
|
||||
"@v8_targets//:rusty_v8_archive_for_target",
|
||||
"@v8_targets//:rusty_v8_binding_for_target",
|
||||
],
|
||||
build_script_env = {
|
||||
"RUSTY_V8_ARCHIVE": "$(execpath @v8_targets//:rusty_v8_archive_for_target)",
|
||||
"RUSTY_V8_SRC_BINDING_PATH": "$(execpath @v8_targets//:rusty_v8_binding_for_target)",
|
||||
},
|
||||
crate = "v8",
|
||||
gen_build_script = "on",
|
||||
patch_args = ["-p1"],
|
||||
patches = [
|
||||
"//patches:rusty_v8_prebuilt_out_dir.patch",
|
||||
],
|
||||
)
|
||||
|
||||
inject_repo(crate, "v8_targets")
|
||||
|
||||
llvm = use_extension("@llvm//extensions:llvm.bzl", "llvm")
|
||||
use_repo(llvm, "llvm-project")
|
||||
|
|
@ -210,6 +237,86 @@ http_archive(
|
|||
urls = ["https://static.crates.io/crates/v8/v8-146.4.0.crate"],
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "rusty_v8_146_4_0_aarch64_apple_darwin_archive",
|
||||
downloaded_file_path = "librusty_v8_release_aarch64-apple-darwin.a.gz",
|
||||
urls = [
|
||||
"https://github.com/denoland/rusty_v8/releases/download/v146.4.0/librusty_v8_release_aarch64-apple-darwin.a.gz",
|
||||
],
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "rusty_v8_146_4_0_aarch64_unknown_linux_gnu_archive",
|
||||
downloaded_file_path = "librusty_v8_release_aarch64-unknown-linux-gnu.a.gz",
|
||||
urls = [
|
||||
"https://github.com/denoland/rusty_v8/releases/download/v146.4.0/librusty_v8_release_aarch64-unknown-linux-gnu.a.gz",
|
||||
],
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "rusty_v8_146_4_0_aarch64_pc_windows_msvc_archive",
|
||||
downloaded_file_path = "rusty_v8_release_aarch64-pc-windows-msvc.lib.gz",
|
||||
urls = [
|
||||
"https://github.com/denoland/rusty_v8/releases/download/v146.4.0/rusty_v8_release_aarch64-pc-windows-msvc.lib.gz",
|
||||
],
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "rusty_v8_146_4_0_x86_64_apple_darwin_archive",
|
||||
downloaded_file_path = "librusty_v8_release_x86_64-apple-darwin.a.gz",
|
||||
urls = [
|
||||
"https://github.com/denoland/rusty_v8/releases/download/v146.4.0/librusty_v8_release_x86_64-apple-darwin.a.gz",
|
||||
],
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "rusty_v8_146_4_0_x86_64_unknown_linux_gnu_archive",
|
||||
downloaded_file_path = "librusty_v8_release_x86_64-unknown-linux-gnu.a.gz",
|
||||
urls = [
|
||||
"https://github.com/denoland/rusty_v8/releases/download/v146.4.0/librusty_v8_release_x86_64-unknown-linux-gnu.a.gz",
|
||||
],
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "rusty_v8_146_4_0_x86_64_pc_windows_msvc_archive",
|
||||
downloaded_file_path = "rusty_v8_release_x86_64-pc-windows-msvc.lib.gz",
|
||||
urls = [
|
||||
"https://github.com/denoland/rusty_v8/releases/download/v146.4.0/rusty_v8_release_x86_64-pc-windows-msvc.lib.gz",
|
||||
],
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "rusty_v8_146_4_0_aarch64_unknown_linux_musl_archive",
|
||||
downloaded_file_path = "librusty_v8_release_aarch64-unknown-linux-musl.a.gz",
|
||||
urls = [
|
||||
"https://github.com/openai/codex/releases/download/rusty-v8-v146.4.0/librusty_v8_release_aarch64-unknown-linux-musl.a.gz",
|
||||
],
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "rusty_v8_146_4_0_aarch64_unknown_linux_musl_binding",
|
||||
downloaded_file_path = "src_binding_release_aarch64-unknown-linux-musl.rs",
|
||||
urls = [
|
||||
"https://github.com/openai/codex/releases/download/rusty-v8-v146.4.0/src_binding_release_aarch64-unknown-linux-musl.rs",
|
||||
],
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "rusty_v8_146_4_0_x86_64_unknown_linux_musl_archive",
|
||||
downloaded_file_path = "librusty_v8_release_x86_64-unknown-linux-musl.a.gz",
|
||||
urls = [
|
||||
"https://github.com/openai/codex/releases/download/rusty-v8-v146.4.0/librusty_v8_release_x86_64-unknown-linux-musl.a.gz",
|
||||
],
|
||||
)
|
||||
|
||||
http_file(
|
||||
name = "rusty_v8_146_4_0_x86_64_unknown_linux_musl_binding",
|
||||
downloaded_file_path = "src_binding_release_x86_64-unknown-linux-musl.rs",
|
||||
urls = [
|
||||
"https://github.com/openai/codex/releases/download/rusty-v8-v146.4.0/src_binding_release_x86_64-unknown-linux-musl.rs",
|
||||
],
|
||||
)
|
||||
|
||||
use_repo(crate, "crates")
|
||||
|
||||
bazel_dep(name = "libcap", version = "2.27.bcr.1")
|
||||
|
|
|
|||
19
MODULE.bazel.lock
generated
19
MODULE.bazel.lock
generated
File diff suppressed because one or more lines are too long
238
codex-rs/Cargo.lock
generated
238
codex-rs/Cargo.lock
generated
|
|
@ -949,6 +949,8 @@ dependencies = [
|
|||
"cexpr",
|
||||
"clang-sys",
|
||||
"itertools 0.13.0",
|
||||
"log",
|
||||
"prettyplease",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"regex",
|
||||
|
|
@ -1152,6 +1154,16 @@ version = "0.1.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0"
|
||||
|
||||
[[package]]
|
||||
name = "calendrical_calculations"
|
||||
version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3a0b39595c6ee54a8d0900204ba4c401d0ab4eb45adaf07178e8d017541529e7"
|
||||
dependencies = [
|
||||
"core_maths",
|
||||
"displaydoc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cassowary"
|
||||
version = "0.3.0"
|
||||
|
|
@ -1584,7 +1596,7 @@ dependencies = [
|
|||
"thiserror 2.0.18",
|
||||
"tokio",
|
||||
"url",
|
||||
"which",
|
||||
"which 8.0.0",
|
||||
"wiremock",
|
||||
"zip",
|
||||
]
|
||||
|
|
@ -1930,7 +1942,7 @@ dependencies = [
|
|||
"url",
|
||||
"uuid",
|
||||
"walkdir",
|
||||
"which",
|
||||
"which 8.0.0",
|
||||
"wildmatch",
|
||||
"windows-sys 0.52.0",
|
||||
"wiremock",
|
||||
|
|
@ -2179,7 +2191,7 @@ dependencies = [
|
|||
"serde_json",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"which",
|
||||
"which 8.0.0",
|
||||
"wiremock",
|
||||
]
|
||||
|
||||
|
|
@ -2432,7 +2444,7 @@ dependencies = [
|
|||
"tracing",
|
||||
"urlencoding",
|
||||
"webbrowser",
|
||||
"which",
|
||||
"which 8.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -2472,7 +2484,7 @@ dependencies = [
|
|||
"tree-sitter",
|
||||
"tree-sitter-bash",
|
||||
"url",
|
||||
"which",
|
||||
"which 8.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -2644,7 +2656,7 @@ dependencies = [
|
|||
"uuid",
|
||||
"vt100",
|
||||
"webbrowser",
|
||||
"which",
|
||||
"which 8.0.0",
|
||||
"windows-sys 0.52.0",
|
||||
"winsplit",
|
||||
]
|
||||
|
|
@ -2736,7 +2748,7 @@ dependencies = [
|
|||
"uuid",
|
||||
"vt100",
|
||||
"webbrowser",
|
||||
"which",
|
||||
"which 8.0.0",
|
||||
"windows-sys 0.52.0",
|
||||
"winsplit",
|
||||
]
|
||||
|
|
@ -2907,6 +2919,14 @@ dependencies = [
|
|||
"regex-lite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "codex-v8-poc"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"pretty_assertions",
|
||||
"v8",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "codex-windows-sandbox"
|
||||
version = "0.0.0"
|
||||
|
|
@ -3112,6 +3132,15 @@ version = "0.8.7"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
|
||||
|
||||
[[package]]
|
||||
name = "core_maths"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "77745e017f5edba1a9c1d854f6f3a52dac8a12dd5af5d2f54aecf61e43d80d30"
|
||||
dependencies = [
|
||||
"libm",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "core_test_support"
|
||||
version = "0.0.0"
|
||||
|
|
@ -3717,6 +3746,38 @@ dependencies = [
|
|||
"subtle",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "diplomat"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9adb46b05e2f53dcf6a7dfc242e4ce9eb60c369b6b6eb10826a01e93167f59c6"
|
||||
dependencies = [
|
||||
"diplomat_core",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.114",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "diplomat-runtime"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0569bd3caaf13829da7ee4e83dbf9197a0e1ecd72772da6d08f0b4c9285c8d29"
|
||||
|
||||
[[package]]
|
||||
name = "diplomat_core"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "51731530ed7f2d4495019abc7df3744f53338e69e2863a6a64ae91821c763df1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"serde",
|
||||
"smallvec",
|
||||
"strck",
|
||||
"syn 2.0.114",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dirs"
|
||||
version = "6.0.0"
|
||||
|
|
@ -4323,6 +4384,16 @@ dependencies = [
|
|||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fslock"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "04412b8935272e3a9bae6f48c7bfff74c2911f60525404edfdd28e49884c3bfb"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "futures"
|
||||
version = "0.3.31"
|
||||
|
|
@ -4551,6 +4622,15 @@ dependencies = [
|
|||
"regex-syntax 0.8.8",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gzip-header"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "95cc527b92e6029a62960ad99aa8a6660faa4555fe5f731aab13aa6a921795a2"
|
||||
dependencies = [
|
||||
"crc32fast",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "h2"
|
||||
version = "0.4.13"
|
||||
|
|
@ -5008,6 +5088,28 @@ dependencies = [
|
|||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "icu_calendar"
|
||||
version = "2.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d6f0e52e009b6b16ba9c0693578796f2dd4aaa59a7f8f920423706714a89ac4e"
|
||||
dependencies = [
|
||||
"calendrical_calculations",
|
||||
"displaydoc",
|
||||
"icu_calendar_data",
|
||||
"icu_locale",
|
||||
"icu_locale_core",
|
||||
"icu_provider",
|
||||
"tinystr",
|
||||
"zerovec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "icu_calendar_data"
|
||||
version = "2.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "527f04223b17edfe0bd43baf14a0cb1b017830db65f3950dc00224860a9a446d"
|
||||
|
||||
[[package]]
|
||||
name = "icu_collections"
|
||||
version = "2.1.1"
|
||||
|
|
@ -5442,6 +5544,12 @@ version = "1.0.17"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
|
||||
|
||||
[[package]]
|
||||
name = "ixdtf"
|
||||
version = "0.6.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "84de9d95a6d2547d9b77ee3f25fa0ee32e3c3a6484d47a55adebc0439c077992"
|
||||
|
||||
[[package]]
|
||||
name = "jiff"
|
||||
version = "0.2.18"
|
||||
|
|
@ -7167,6 +7275,16 @@ dependencies = [
|
|||
"yansi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prettyplease"
|
||||
version = "0.2.37"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"syn 2.0.114",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-crate"
|
||||
version = "3.4.0"
|
||||
|
|
@ -8000,6 +8118,16 @@ dependencies = [
|
|||
"webpki-roots 1.0.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "resb"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6a067ab3b5ca3b4dc307d0de9cf75f9f5e6ca9717b192b2f28a36c83e5de9e76"
|
||||
dependencies = [
|
||||
"potential_utf",
|
||||
"serde_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "resolv-conf"
|
||||
version = "0.7.6"
|
||||
|
|
@ -9380,6 +9508,15 @@ dependencies = [
|
|||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "strck"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "42316e70da376f3d113a68d138a60d8a9883c604fe97942721ec2068dab13a9f"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "streaming-iterator"
|
||||
version = "0.1.9"
|
||||
|
|
@ -9624,6 +9761,39 @@ dependencies = [
|
|||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "temporal_capi"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a151e402c2bdb6a3a2a2f3f225eddaead2e7ce7dd5d3fa2090deb11b17aa4ed8"
|
||||
dependencies = [
|
||||
"diplomat",
|
||||
"diplomat-runtime",
|
||||
"icu_calendar",
|
||||
"icu_locale",
|
||||
"num-traits",
|
||||
"temporal_rs",
|
||||
"timezone_provider",
|
||||
"writeable",
|
||||
"zoneinfo64",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "temporal_rs"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "88afde3bd75d2fc68d77a914bece426aa08aa7649ffd0cdd4a11c3d4d33474d1"
|
||||
dependencies = [
|
||||
"core_maths",
|
||||
"icu_calendar",
|
||||
"icu_locale",
|
||||
"ixdtf",
|
||||
"num-traits",
|
||||
"timezone_provider",
|
||||
"tinystr",
|
||||
"writeable",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "term"
|
||||
version = "0.7.0"
|
||||
|
|
@ -9831,6 +10001,18 @@ dependencies = [
|
|||
"time-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "timezone_provider"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "df9ba0000e9e73862f3e7ca1ff159e2ddf915c9d8bb11e38a7874760f445d993"
|
||||
dependencies = [
|
||||
"tinystr",
|
||||
"zerotrie",
|
||||
"zerovec",
|
||||
"zoneinfo64",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tiny-keccak"
|
||||
version = "2.0.2"
|
||||
|
|
@ -10630,6 +10812,23 @@ dependencies = [
|
|||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "v8"
|
||||
version = "146.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d97bcac5cdc5a195a4813f1855a6bc658f240452aac36caa12fd6c6f16026ab1"
|
||||
dependencies = [
|
||||
"bindgen",
|
||||
"bitflags 2.10.0",
|
||||
"fslock",
|
||||
"gzip-header",
|
||||
"home",
|
||||
"miniz_oxide",
|
||||
"paste",
|
||||
"temporal_capi",
|
||||
"which 6.0.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "valuable"
|
||||
version = "0.1.1"
|
||||
|
|
@ -10929,6 +11128,18 @@ version = "0.1.12"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88"
|
||||
|
||||
[[package]]
|
||||
name = "which"
|
||||
version = "6.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f"
|
||||
dependencies = [
|
||||
"either",
|
||||
"home",
|
||||
"rustix 0.38.44",
|
||||
"winsafe",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "which"
|
||||
version = "8.0.0"
|
||||
|
|
@ -11932,6 +12143,19 @@ version = "1.0.19"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3ff05f8caa9038894637571ae6b9e29466c1f4f829d26c9b28f869a29cbe3445"
|
||||
|
||||
[[package]]
|
||||
name = "zoneinfo64"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bb2e5597efbe7c421da8a7fd396b20b571704e787c21a272eecf35dfe9d386f0"
|
||||
dependencies = [
|
||||
"calendrical_calculations",
|
||||
"icu_locale_core",
|
||||
"potential_utf",
|
||||
"resb",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zopfli"
|
||||
version = "0.8.3"
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ members = [
|
|||
"otel",
|
||||
"tui",
|
||||
"tui_app_server",
|
||||
"v8-poc",
|
||||
"utils/absolute-path",
|
||||
"utils/cargo-bin",
|
||||
"utils/git",
|
||||
|
|
@ -137,6 +138,7 @@ codex-test-macros = { path = "test-macros" }
|
|||
codex-terminal-detection = { path = "terminal-detection" }
|
||||
codex-tui = { path = "tui" }
|
||||
codex-tui-app-server = { path = "tui_app_server" }
|
||||
codex-v8-poc = { path = "v8-poc" }
|
||||
codex-utils-absolute-path = { path = "utils/absolute-path" }
|
||||
codex-utils-approval-presets = { path = "utils/approval-presets" }
|
||||
codex-utils-cache = { path = "utils/cache" }
|
||||
|
|
@ -245,6 +247,7 @@ regex-lite = "0.1.8"
|
|||
reqwest = "0.12"
|
||||
rmcp = { version = "0.15.0", default-features = false }
|
||||
runfiles = { git = "https://github.com/dzbarsky/rules_rust", rev = "b56cbaa8465e74127f1ea216f813cd377295ad81" }
|
||||
v8 = "=146.4.0"
|
||||
rustls = { version = "0.23", default-features = false, features = [
|
||||
"ring",
|
||||
"std",
|
||||
|
|
@ -370,7 +373,8 @@ ignored = [
|
|||
"icu_provider",
|
||||
"openssl-sys",
|
||||
"codex-utils-readiness",
|
||||
"codex-secrets"
|
||||
"codex-secrets",
|
||||
"codex-v8-poc"
|
||||
]
|
||||
|
||||
[profile.release]
|
||||
|
|
|
|||
2
codex-rs/v8-poc/.gitignore
vendored
Normal file
2
codex-rs/v8-poc/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/target/
|
||||
/target-rs/
|
||||
12
codex-rs/v8-poc/BUILD.bazel
Normal file
12
codex-rs/v8-poc/BUILD.bazel
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
load("//:defs.bzl", "codex_rust_crate")
|
||||
|
||||
codex_rust_crate(
|
||||
name = "v8-poc",
|
||||
crate_name = "codex_v8_poc",
|
||||
deps_extra = ["@crates//:v8"],
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "v8-poc-rusty-v8",
|
||||
actual = ":v8-poc",
|
||||
)
|
||||
18
codex-rs/v8-poc/Cargo.toml
Normal file
18
codex-rs/v8-poc/Cargo.toml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
[package]
|
||||
name = "codex-v8-poc"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[lib]
|
||||
name = "codex_v8_poc"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
v8 = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
pretty_assertions = { workspace = true }
|
||||
65
codex-rs/v8-poc/src/lib.rs
Normal file
65
codex-rs/v8-poc/src/lib.rs
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
//! Bazel-wired proof-of-concept crate reserved for future V8 experiments.
|
||||
|
||||
/// Returns the Bazel label for this proof-of-concept crate.
|
||||
#[must_use]
|
||||
pub fn bazel_target() -> &'static str {
|
||||
"//codex-rs/v8-poc:v8-poc"
|
||||
}
|
||||
|
||||
/// Returns the embedded V8 version.
|
||||
#[must_use]
|
||||
pub fn embedded_v8_version() -> &'static str {
|
||||
v8::V8::get_version()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use pretty_assertions::assert_eq;
|
||||
use std::sync::Once;
|
||||
|
||||
use super::bazel_target;
|
||||
|
||||
fn initialize_v8() {
|
||||
static INIT: Once = Once::new();
|
||||
|
||||
INIT.call_once(|| {
|
||||
v8::V8::initialize_platform(v8::new_default_platform(0, false).make_shared());
|
||||
v8::V8::initialize();
|
||||
});
|
||||
}
|
||||
|
||||
fn evaluate_expression(expression: &str) -> String {
|
||||
initialize_v8();
|
||||
|
||||
let isolate = &mut v8::Isolate::new(Default::default());
|
||||
v8::scope!(let scope, isolate);
|
||||
|
||||
let context = v8::Context::new(scope, Default::default());
|
||||
let scope = &mut v8::ContextScope::new(scope, context);
|
||||
let source = v8::String::new(scope, expression).expect("expression should be valid UTF-8");
|
||||
let script = v8::Script::compile(scope, source, None).expect("expression should compile");
|
||||
let result = script.run(scope).expect("expression should evaluate");
|
||||
|
||||
result.to_rust_string_lossy(scope)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn exposes_expected_bazel_target() {
|
||||
assert_eq!(bazel_target(), "//codex-rs/v8-poc:v8-poc");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn exposes_embedded_v8_version() {
|
||||
assert!(!super::embedded_v8_version().is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn evaluates_integer_addition() {
|
||||
assert_eq!(evaluate_expression("1 + 2"), "3");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn evaluates_string_concatenation() {
|
||||
assert_eq!(evaluate_expression("'hello ' + 'world'"), "hello world");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
exports_files([
|
||||
"aws-lc-sys_memcmp_check.patch",
|
||||
"rusty_v8_prebuilt_out_dir.patch",
|
||||
"v8_bazel_rules.patch",
|
||||
"v8_module_deps.patch",
|
||||
"v8_source_portability.patch",
|
||||
|
|
|
|||
52
patches/rusty_v8_prebuilt_out_dir.patch
Normal file
52
patches/rusty_v8_prebuilt_out_dir.patch
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
--- a/build.rs
|
||||
+++ b/build.rs
|
||||
@@ -577,7 +577,23 @@
|
||||
path
|
||||
}
|
||||
|
||||
+fn out_dir_abs() -> PathBuf {
|
||||
+ let cwd = env::current_dir().unwrap();
|
||||
+
|
||||
+ // target/debug/build/rusty_v8-d9e5a424d4f96994/out/
|
||||
+ let out_dir = env::var_os("OUT_DIR").expect(
|
||||
+ "The 'OUT_DIR' environment is not set (it should be something like \
|
||||
+ 'target/debug/rusty_v8-{hash}').",
|
||||
+ );
|
||||
+
|
||||
+ cwd.join(out_dir)
|
||||
+}
|
||||
+
|
||||
fn static_lib_dir() -> PathBuf {
|
||||
+ if env::var_os("RUSTY_V8_ARCHIVE").is_some() {
|
||||
+ return out_dir_abs().join("gn_out").join("obj");
|
||||
+ }
|
||||
+
|
||||
build_dir().join("gn_out").join("obj")
|
||||
}
|
||||
|
||||
@@ -794,22 +810,23 @@
|
||||
}
|
||||
|
||||
fn print_link_flags() {
|
||||
+ let target = env::var("TARGET").unwrap();
|
||||
println!("cargo:rustc-link-lib=static=rusty_v8");
|
||||
let should_dyn_link_libcxx = env::var("CARGO_FEATURE_USE_CUSTOM_LIBCXX")
|
||||
.is_err()
|
||||
+ || (target.contains("apple") && env::var("RUSTY_V8_ARCHIVE").is_ok())
|
||||
|| env::var("GN_ARGS").is_ok_and(|gn_args| {
|
||||
gn_args
|
||||
.split_whitespace()
|
||||
.any(|ba| ba == "use_custom_libcxx=false")
|
||||
});
|
||||
|
||||
if should_dyn_link_libcxx {
|
||||
// Based on https://github.com/alexcrichton/cc-rs/blob/fba7feded71ee4f63cfe885673ead6d7b4f2f454/src/lib.rs#L2462
|
||||
if let Ok(stdlib) = env::var("CXXSTDLIB") {
|
||||
if !stdlib.is_empty() {
|
||||
println!("cargo:rustc-link-lib=dylib={stdlib}");
|
||||
}
|
||||
} else {
|
||||
- let target = env::var("TARGET").unwrap();
|
||||
if target.contains("msvc") {
|
||||
// nothing to link to
|
||||
} else if target.contains("apple")
|
||||
|
|
@ -121,7 +121,7 @@ index 85f31b7..7314584 100644
|
|||
],
|
||||
outs = [
|
||||
"include/inspector/Debugger.h",
|
||||
@@ -4426,15 +4426,19 @@ genrule(
|
||||
@@ -4426,15 +4426,18 @@ genrule(
|
||||
"src/inspector/protocol/Schema.cpp",
|
||||
"src/inspector/protocol/Schema.h",
|
||||
],
|
||||
|
|
@ -134,7 +134,7 @@ index 85f31b7..7314584 100644
|
|||
--config $(location :src/inspector/inspector_protocol_config.json) \
|
||||
--config_value protocol.path=$(location :include/js_protocol.pdl) \
|
||||
--output_base $(@D)/src/inspector",
|
||||
local = 1,
|
||||
- local = 1,
|
||||
message = "Generating inspector files",
|
||||
tools = [
|
||||
- ":code_generator",
|
||||
|
|
|
|||
244
third_party/v8/BUILD.bazel
vendored
244
third_party/v8/BUILD.bazel
vendored
|
|
@ -4,6 +4,158 @@ load("@rules_cc//cc:defs.bzl", "cc_library")
|
|||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
config_setting(
|
||||
name = "platform_aarch64_unknown_linux_musl",
|
||||
constraint_values = [
|
||||
"@platforms//cpu:aarch64",
|
||||
"@platforms//os:linux",
|
||||
"@llvm//constraints/libc:musl",
|
||||
],
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "platform_x86_64_unknown_linux_musl",
|
||||
constraint_values = [
|
||||
"@platforms//cpu:x86_64",
|
||||
"@platforms//os:linux",
|
||||
"@llvm//constraints/libc:musl",
|
||||
],
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "v8_146_4_0_x86_64_apple_darwin",
|
||||
actual = "@rusty_v8_146_4_0_x86_64_apple_darwin_archive//file",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "v8_146_4_0_aarch64_apple_darwin",
|
||||
actual = "@rusty_v8_146_4_0_aarch64_apple_darwin_archive//file",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "v8_146_4_0_x86_64_unknown_linux_gnu",
|
||||
actual = "@rusty_v8_146_4_0_x86_64_unknown_linux_gnu_archive//file",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "v8_146_4_0_aarch64_unknown_linux_gnu",
|
||||
actual = "@rusty_v8_146_4_0_aarch64_unknown_linux_gnu_archive//file",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "v8_146_4_0_x86_64_unknown_linux_musl",
|
||||
actual = "@rusty_v8_146_4_0_x86_64_unknown_linux_musl_archive//file",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "v8_146_4_0_aarch64_unknown_linux_musl",
|
||||
actual = "@rusty_v8_146_4_0_aarch64_unknown_linux_musl_archive//file",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "v8_146_4_0_x86_64_pc_windows_msvc",
|
||||
actual = "@rusty_v8_146_4_0_x86_64_pc_windows_msvc_archive//file",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "v8_146_4_0_aarch64_pc_windows_msvc",
|
||||
actual = "@rusty_v8_146_4_0_aarch64_pc_windows_msvc_archive//file",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "v8_146_4_0_aarch64_pc_windows_gnullvm",
|
||||
actual = ":v8_146_4_0_aarch64_pc_windows_msvc",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "v8_146_4_0_x86_64_pc_windows_gnullvm",
|
||||
actual = ":v8_146_4_0_x86_64_pc_windows_msvc",
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "src_binding_release_x86_64_apple_darwin",
|
||||
srcs = ["@v8_crate_146_4_0//:src_binding_release_x86_64_apple_darwin"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "src_binding_release_aarch64_apple_darwin",
|
||||
srcs = ["@v8_crate_146_4_0//:src_binding_release_aarch64_apple_darwin"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "src_binding_release_aarch64_unknown_linux_gnu",
|
||||
srcs = ["@v8_crate_146_4_0//:src_binding_release_aarch64_unknown_linux_gnu"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "src_binding_release_x86_64_unknown_linux_gnu",
|
||||
srcs = ["@v8_crate_146_4_0//:src_binding_release_x86_64_unknown_linux_gnu"],
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "src_binding_release_x86_64_unknown_linux_musl",
|
||||
actual = "@rusty_v8_146_4_0_x86_64_unknown_linux_musl_binding//file",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "src_binding_release_aarch64_unknown_linux_musl",
|
||||
actual = "@rusty_v8_146_4_0_aarch64_unknown_linux_musl_binding//file",
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "src_binding_release_x86_64_pc_windows_msvc",
|
||||
srcs = ["@v8_crate_146_4_0//:src_binding_release_x86_64_pc_windows_msvc"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "src_binding_release_aarch64_pc_windows_msvc",
|
||||
srcs = ["@v8_crate_146_4_0//:src_binding_release_aarch64_pc_windows_msvc"],
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "src_binding_release_x86_64_pc_windows_gnullvm",
|
||||
actual = ":src_binding_release_x86_64_pc_windows_msvc",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "src_binding_release_aarch64_pc_windows_gnullvm",
|
||||
actual = ":src_binding_release_aarch64_pc_windows_msvc",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "rusty_v8_archive_for_target",
|
||||
actual = select({
|
||||
"@rules_rs//rs/experimental/platforms/config:aarch64-apple-darwin": ":v8_146_4_0_aarch64_apple_darwin_bazel",
|
||||
"@rules_rs//rs/experimental/platforms/config:aarch64-pc-windows-gnullvm": ":v8_146_4_0_aarch64_pc_windows_gnullvm",
|
||||
"@rules_rs//rs/experimental/platforms/config:aarch64-pc-windows-msvc": ":v8_146_4_0_aarch64_pc_windows_msvc",
|
||||
"@rules_rs//rs/experimental/platforms/config:aarch64-unknown-linux-gnu": ":v8_146_4_0_aarch64_unknown_linux_gnu_bazel",
|
||||
":platform_aarch64_unknown_linux_musl": ":v8_146_4_0_aarch64_unknown_linux_musl_release_base",
|
||||
"@rules_rs//rs/experimental/platforms/config:x86_64-apple-darwin": ":v8_146_4_0_x86_64_apple_darwin_bazel",
|
||||
"@rules_rs//rs/experimental/platforms/config:x86_64-pc-windows-gnullvm": ":v8_146_4_0_x86_64_pc_windows_gnullvm",
|
||||
"@rules_rs//rs/experimental/platforms/config:x86_64-pc-windows-msvc": ":v8_146_4_0_x86_64_pc_windows_msvc",
|
||||
"@rules_rs//rs/experimental/platforms/config:x86_64-unknown-linux-gnu": ":v8_146_4_0_x86_64_unknown_linux_gnu_bazel",
|
||||
":platform_x86_64_unknown_linux_musl": ":v8_146_4_0_x86_64_unknown_linux_musl_release",
|
||||
"//conditions:default": ":v8_146_4_0_x86_64_unknown_linux_gnu_bazel",
|
||||
}),
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "rusty_v8_binding_for_target",
|
||||
actual = select({
|
||||
"@rules_rs//rs/experimental/platforms/config:aarch64-apple-darwin": ":src_binding_release_aarch64_apple_darwin",
|
||||
"@rules_rs//rs/experimental/platforms/config:aarch64-pc-windows-gnullvm": ":src_binding_release_aarch64_pc_windows_gnullvm",
|
||||
"@rules_rs//rs/experimental/platforms/config:aarch64-pc-windows-msvc": ":src_binding_release_aarch64_pc_windows_msvc",
|
||||
"@rules_rs//rs/experimental/platforms/config:aarch64-unknown-linux-gnu": ":src_binding_release_aarch64_unknown_linux_gnu",
|
||||
":platform_aarch64_unknown_linux_musl": ":src_binding_release_aarch64_unknown_linux_musl",
|
||||
"@rules_rs//rs/experimental/platforms/config:x86_64-apple-darwin": ":src_binding_release_x86_64_apple_darwin",
|
||||
"@rules_rs//rs/experimental/platforms/config:x86_64-pc-windows-gnullvm": ":src_binding_release_x86_64_pc_windows_gnullvm",
|
||||
"@rules_rs//rs/experimental/platforms/config:x86_64-pc-windows-msvc": ":src_binding_release_x86_64_pc_windows_msvc",
|
||||
"@rules_rs//rs/experimental/platforms/config:x86_64-unknown-linux-gnu": ":src_binding_release_x86_64_unknown_linux_gnu",
|
||||
":platform_x86_64_unknown_linux_musl": ":src_binding_release_x86_64_unknown_linux_musl",
|
||||
"//conditions:default": ":src_binding_release_x86_64_unknown_linux_gnu",
|
||||
}),
|
||||
)
|
||||
|
||||
V8_COPTS = ["-std=c++20"]
|
||||
|
||||
V8_STATIC_LIBRARY_FEATURES = [
|
||||
|
|
@ -45,39 +197,39 @@ cc_library(
|
|||
)
|
||||
|
||||
cc_static_library(
|
||||
name = "v8_146_4_0_x86_64_apple_darwin",
|
||||
name = "v8_146_4_0_aarch64_apple_darwin_bazel",
|
||||
deps = [":v8_146_4_0_binding"],
|
||||
features = V8_STATIC_LIBRARY_FEATURES,
|
||||
)
|
||||
|
||||
cc_static_library(
|
||||
name = "v8_146_4_0_aarch64_apple_darwin",
|
||||
name = "v8_146_4_0_aarch64_unknown_linux_gnu_bazel",
|
||||
deps = [":v8_146_4_0_binding"],
|
||||
features = V8_STATIC_LIBRARY_FEATURES,
|
||||
)
|
||||
|
||||
cc_static_library(
|
||||
name = "v8_146_4_0_aarch64_unknown_linux_gnu",
|
||||
name = "v8_146_4_0_x86_64_apple_darwin_bazel",
|
||||
deps = [":v8_146_4_0_binding"],
|
||||
features = V8_STATIC_LIBRARY_FEATURES,
|
||||
)
|
||||
|
||||
cc_static_library(
|
||||
name = "v8_146_4_0_x86_64_unknown_linux_gnu",
|
||||
name = "v8_146_4_0_x86_64_unknown_linux_gnu_bazel",
|
||||
deps = [":v8_146_4_0_binding"],
|
||||
features = V8_STATIC_LIBRARY_FEATURES,
|
||||
)
|
||||
|
||||
cc_static_library(
|
||||
name = "v8_146_4_0_aarch64_unknown_linux_musl_base",
|
||||
name = "v8_146_4_0_aarch64_unknown_linux_musl_release_base",
|
||||
deps = [":v8_146_4_0_binding"],
|
||||
features = V8_STATIC_LIBRARY_FEATURES,
|
||||
)
|
||||
|
||||
genrule(
|
||||
name = "v8_146_4_0_aarch64_unknown_linux_musl",
|
||||
name = "v8_146_4_0_aarch64_unknown_linux_musl_release",
|
||||
srcs = [
|
||||
":v8_146_4_0_aarch64_unknown_linux_musl_base",
|
||||
":v8_146_4_0_aarch64_unknown_linux_musl_release_base",
|
||||
"@llvm//runtimes/compiler-rt:clang_rt.builtins.static",
|
||||
],
|
||||
tools = [
|
||||
|
|
@ -88,7 +240,7 @@ genrule(
|
|||
cmd = """
|
||||
cat > "$(@D)/merge.mri" <<'EOF'
|
||||
create $@
|
||||
addlib $(location :v8_146_4_0_aarch64_unknown_linux_musl_base)
|
||||
addlib $(location :v8_146_4_0_aarch64_unknown_linux_musl_release_base)
|
||||
addlib $(location @llvm//runtimes/compiler-rt:clang_rt.builtins.static)
|
||||
save
|
||||
end
|
||||
|
|
@ -99,83 +251,21 @@ EOF
|
|||
)
|
||||
|
||||
cc_static_library(
|
||||
name = "v8_146_4_0_x86_64_unknown_linux_musl",
|
||||
name = "v8_146_4_0_x86_64_unknown_linux_musl_release",
|
||||
deps = [":v8_146_4_0_binding"],
|
||||
features = V8_STATIC_LIBRARY_FEATURES,
|
||||
)
|
||||
|
||||
cc_static_library(
|
||||
name = "v8_146_4_0_aarch64_pc_windows_msvc",
|
||||
deps = [":v8_146_4_0_binding"],
|
||||
features = V8_STATIC_LIBRARY_FEATURES,
|
||||
)
|
||||
|
||||
cc_static_library(
|
||||
name = "v8_146_4_0_x86_64_pc_windows_msvc",
|
||||
deps = [":v8_146_4_0_binding"],
|
||||
features = V8_STATIC_LIBRARY_FEATURES,
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "v8_146_4_0_aarch64_pc_windows_gnullvm",
|
||||
actual = ":v8_146_4_0_aarch64_pc_windows_msvc",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "v8_146_4_0_x86_64_pc_windows_gnullvm",
|
||||
actual = ":v8_146_4_0_x86_64_pc_windows_msvc",
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "src_binding_release_x86_64_apple_darwin",
|
||||
srcs = ["@v8_crate_146_4_0//:src_binding_release_x86_64_apple_darwin"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "src_binding_release_aarch64_apple_darwin",
|
||||
srcs = ["@v8_crate_146_4_0//:src_binding_release_aarch64_apple_darwin"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "src_binding_release_aarch64_unknown_linux_gnu",
|
||||
name = "src_binding_release_aarch64_unknown_linux_musl_release",
|
||||
srcs = ["@v8_crate_146_4_0//:src_binding_release_aarch64_unknown_linux_gnu"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "src_binding_release_x86_64_unknown_linux_gnu",
|
||||
name = "src_binding_release_x86_64_unknown_linux_musl_release",
|
||||
srcs = ["@v8_crate_146_4_0//:src_binding_release_x86_64_unknown_linux_gnu"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "src_binding_release_aarch64_unknown_linux_musl",
|
||||
srcs = ["@v8_crate_146_4_0//:src_binding_release_aarch64_unknown_linux_gnu"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "src_binding_release_x86_64_unknown_linux_musl",
|
||||
srcs = ["@v8_crate_146_4_0//:src_binding_release_x86_64_unknown_linux_gnu"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "src_binding_release_x86_64_pc_windows_msvc",
|
||||
srcs = ["@v8_crate_146_4_0//:src_binding_release_x86_64_pc_windows_msvc"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "src_binding_release_aarch64_pc_windows_msvc",
|
||||
srcs = ["@v8_crate_146_4_0//:src_binding_release_aarch64_pc_windows_msvc"],
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "src_binding_release_x86_64_pc_windows_gnullvm",
|
||||
actual = ":src_binding_release_x86_64_pc_windows_msvc",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "src_binding_release_aarch64_pc_windows_gnullvm",
|
||||
actual = ":src_binding_release_aarch64_pc_windows_msvc",
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "rusty_v8_release_pair_x86_64_apple_darwin",
|
||||
srcs = [
|
||||
|
|
@ -211,16 +301,16 @@ filegroup(
|
|||
filegroup(
|
||||
name = "rusty_v8_release_pair_x86_64_unknown_linux_musl",
|
||||
srcs = [
|
||||
":v8_146_4_0_x86_64_unknown_linux_musl",
|
||||
":src_binding_release_x86_64_unknown_linux_musl",
|
||||
":v8_146_4_0_x86_64_unknown_linux_musl_release",
|
||||
":src_binding_release_x86_64_unknown_linux_musl_release",
|
||||
],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "rusty_v8_release_pair_aarch64_unknown_linux_musl",
|
||||
srcs = [
|
||||
":v8_146_4_0_aarch64_unknown_linux_musl",
|
||||
":src_binding_release_aarch64_unknown_linux_musl",
|
||||
":v8_146_4_0_aarch64_unknown_linux_musl_release",
|
||||
":src_binding_release_aarch64_unknown_linux_musl_release",
|
||||
],
|
||||
)
|
||||
|
||||
|
|
|
|||
68
third_party/v8/README.md
vendored
68
third_party/v8/README.md
vendored
|
|
@ -1,45 +1,47 @@
|
|||
# `rusty_v8` Release Artifacts
|
||||
# `rusty_v8` Consumer Artifacts
|
||||
|
||||
This directory contains the Bazel packaging used to build and stage
|
||||
target-specific `rusty_v8` release artifacts for Bazel-managed consumers.
|
||||
This directory wires the `v8` crate to exact-version Bazel inputs.
|
||||
Bazel consumer builds use:
|
||||
|
||||
- upstream `denoland/rusty_v8` release archives on Windows
|
||||
- source-built V8 archives on Darwin, GNU Linux, and musl Linux
|
||||
- `openai/codex` release assets for published musl release pairs
|
||||
|
||||
Cargo builds still use prebuilt `rusty_v8` archives by default. Only Bazel
|
||||
overrides `RUSTY_V8_ARCHIVE`/`RUSTY_V8_SRC_BINDING_PATH` in `MODULE.bazel` to
|
||||
select source-built local archives for its consumer builds.
|
||||
|
||||
Current pinned versions:
|
||||
|
||||
- Rust crate: `v8 = =146.4.0`
|
||||
- Embedded upstream V8 source: `14.6.202.9`
|
||||
- Embedded upstream V8 source for musl release builds: `14.6.202.9`
|
||||
|
||||
The generated release pairs include:
|
||||
The consumer-facing selectors are:
|
||||
|
||||
- `//third_party/v8:rusty_v8_archive_for_target`
|
||||
- `//third_party/v8:rusty_v8_binding_for_target`
|
||||
|
||||
Musl release assets are expected at the tag:
|
||||
|
||||
- `rusty-v8-v<crate_version>`
|
||||
|
||||
with these raw asset names:
|
||||
|
||||
- `librusty_v8_release_<target>.a.gz`
|
||||
- `src_binding_release_<target>.rs`
|
||||
|
||||
The dedicated publishing workflow is `.github/workflows/rusty-v8-release.yml`.
|
||||
It builds musl release pairs from source and keeps the release artifacts as the
|
||||
statically linked form:
|
||||
|
||||
- `//third_party/v8:rusty_v8_release_pair_x86_64_apple_darwin`
|
||||
- `//third_party/v8:rusty_v8_release_pair_aarch64_apple_darwin`
|
||||
- `//third_party/v8:rusty_v8_release_pair_x86_64_unknown_linux_gnu`
|
||||
- `//third_party/v8:rusty_v8_release_pair_aarch64_unknown_linux_gnu`
|
||||
- `//third_party/v8:rusty_v8_release_pair_x86_64_unknown_linux_musl`
|
||||
- `//third_party/v8:rusty_v8_release_pair_aarch64_unknown_linux_musl`
|
||||
- `//third_party/v8:rusty_v8_release_pair_x86_64_pc_windows_msvc`
|
||||
- `//third_party/v8:rusty_v8_release_pair_aarch64_pc_windows_msvc`
|
||||
|
||||
Each release pair contains:
|
||||
|
||||
- a static library built from source
|
||||
- a Rust binding file copied from the exact same `v8` crate version for that
|
||||
target
|
||||
Cargo musl builds use `RUSTY_V8_ARCHIVE` plus a downloaded
|
||||
`RUSTY_V8_SRC_BINDING_PATH` to point at those `openai/codex` release assets
|
||||
directly. We do not use `RUSTY_V8_MIRROR` for musl because the upstream `v8`
|
||||
crate hardcodes a `v<crate_version>` tag layout, while our musl artifacts are
|
||||
published under `rusty-v8-v<crate_version>`.
|
||||
|
||||
Do not mix artifacts across crate versions. The archive and binding must match
|
||||
the exact pinned `v8` crate version used by this repo.
|
||||
|
||||
The dedicated publishing workflow is:
|
||||
|
||||
- `.github/workflows/rusty-v8-release.yml`
|
||||
|
||||
That workflow currently stages musl artifacts:
|
||||
|
||||
- `librusty_v8_release_x86_64-unknown-linux-musl.a.gz`
|
||||
- `librusty_v8_release_aarch64-unknown-linux-musl.a.gz`
|
||||
- `src_binding_release_x86_64-unknown-linux-musl.rs`
|
||||
- `src_binding_release_aarch64-unknown-linux-musl.rs`
|
||||
|
||||
During musl staging, the produced static archive is merged with the target's
|
||||
LLVM `libc++` and `libc++abi` static runtime archives. Rust's musl toolchain
|
||||
already provides the matching `libunwind`, so staging does not bundle a second
|
||||
copy.
|
||||
the exact resolved `v8` crate version in `codex-rs/Cargo.lock`.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue