Compare commits

...

1 Commits

Author SHA1 Message Date
pakrym-oai
d77129d3c9 Add Bazel musl V8 build workflow 2026-03-12 16:41:10 -07:00
7 changed files with 558 additions and 0 deletions

125
.github/scripts/rusty_v8_bazel.py vendored Normal file
View File

@@ -0,0 +1,125 @@
#!/usr/bin/env python3
from __future__ import annotations
import argparse
import gzip
import re
import shutil
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
MODULE_BAZEL = ROOT / "MODULE.bazel"
def parse_v8_crate_version() -> str:
text = MODULE_BAZEL.read_text()
match = re.search(
r"https://static\.crates\.io/crates/v8/v8-([0-9.]+)\.crate",
text,
)
if match is None:
raise SystemExit("could not determine v8 crate version from MODULE.bazel")
return match.group(1)
def bazel_execroot() -> Path:
result = subprocess.run(
["bazel", "info", "execution_root"],
cwd=ROOT,
check=True,
capture_output=True,
text=True,
)
return Path(result.stdout.strip())
def bazel_output_files(platform: str, labels: list[str]) -> list[Path]:
expression = "set(" + " ".join(labels) + ")"
result = subprocess.run(
[
"bazel",
"cquery",
f"--platforms=@llvm//platforms:{platform}",
"--output=files",
expression,
],
cwd=ROOT,
check=True,
capture_output=True,
text=True,
)
execroot = bazel_execroot()
return [execroot / line.strip() for line in result.stdout.splitlines() if line.strip()]
def stage_release_assets(platform: str, target: str, output_dir: Path) -> None:
target_suffix = target.replace("-", "_")
version_suffix = parse_v8_crate_version().replace(".", "_")
lib_label = f"//third_party/v8:v8_{version_suffix}_{target_suffix}"
binding_label = f"//third_party/v8:src_binding_release_{target_suffix}"
outputs = bazel_output_files(platform, [lib_label, binding_label])
try:
lib_path = next(path for path in outputs if path.suffix == ".a")
except StopIteration as exc:
raise SystemExit(f"missing static archive output for {target}") from exc
try:
binding_path = next(path for path in outputs if path.suffix == ".rs")
except StopIteration as exc:
raise SystemExit(f"missing binding output for {target}") from exc
output_dir.mkdir(parents=True, exist_ok=True)
archive_name = f"librusty_v8_release_{target}.a.gz"
binding_name = f"src_binding_release_{target}.rs"
with lib_path.open("rb") as src, (output_dir / archive_name).open("wb") as dst:
with gzip.GzipFile(
filename="",
mode="wb",
fileobj=dst,
compresslevel=9,
mtime=0,
) as gz:
shutil.copyfileobj(src, gz)
shutil.copyfile(binding_path, output_dir / binding_name)
print(output_dir / archive_name)
print(output_dir / binding_name)
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest="command", required=True)
subparsers.add_parser("print-version")
stage_parser = subparsers.add_parser("stage")
stage_parser.add_argument("--platform", required=True)
stage_parser.add_argument("--target", required=True)
stage_parser.add_argument("--output-dir", required=True)
return parser.parse_args()
def main() -> int:
args = parse_args()
if args.command == "print-version":
print(parse_v8_crate_version())
return 0
if args.command == "stage":
stage_release_assets(
platform=args.platform,
target=args.target,
output_dir=Path(args.output_dir),
)
return 0
raise SystemExit(f"unsupported command: {args.command}")
if __name__ == "__main__":
sys.exit(main())

View File

@@ -0,0 +1,98 @@
name: rusty-v8-bazel-build
on:
pull_request: {}
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}::${{ github.ref_name }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
permissions:
contents: read
actions: read
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-24.04
platform: linux_amd64_musl
target: x86_64-unknown-linux-musl
- runner: ubuntu-24.04-arm
platform: linux_aarch64_musl
target: aarch64-unknown-linux-musl
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Bazel
uses: bazelbuild/setup-bazelisk@v3
- name: Build Bazel V8 musl artifacts
env:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
PLATFORM: ${{ matrix.platform }}
TARGET: ${{ matrix.target }}
shell: bash
run: |
set -euo pipefail
version="$(python3 .github/scripts/rusty_v8_bazel.py print-version)"
version_suffix="${version//./_}"
target_suffix="${TARGET//-/_}"
lib_target="//third_party/v8:v8_${version_suffix}_${target_suffix}"
binding_target="//third_party/v8:src_binding_release_${target_suffix}"
bazel_args=(
build
"--platforms=@llvm//platforms:${PLATFORM}"
"${lib_target}"
"${binding_target}"
--build_metadata=REPO_URL=https://github.com/${GITHUB_REPOSITORY}.git
--build_metadata=COMMIT_SHA=$(git rev-parse HEAD)
--build_metadata=ROLE=CI
--build_metadata=VISIBILITY=PUBLIC
)
if [[ -n "${BUILDBUDDY_API_KEY:-}" ]]; then
bazel \
--noexperimental_remote_repo_contents_cache \
--bazelrc=.github/workflows/ci.bazelrc \
"${bazel_args[@]}" \
"--remote_header=x-buildbuddy-api-key=${BUILDBUDDY_API_KEY}"
else
bazel \
--noexperimental_remote_repo_contents_cache \
"${bazel_args[@]}" \
--remote_cache= \
--remote_executor=
fi
- name: Stage rusty_v8 release assets
env:
PLATFORM: ${{ matrix.platform }}
TARGET: ${{ matrix.target }}
shell: bash
run: |
set -euo pipefail
output_dir="dist/${TARGET}"
python3 .github/scripts/rusty_v8_bazel.py stage \
--platform "${PLATFORM}" \
--target "${TARGET}" \
--output-dir "${output_dir}"
- name: Upload staged artifacts
uses: actions/upload-artifact@v7
with:
name: rusty-v8-${{ matrix.target }}
path: dist/${{ matrix.target }}/*

View File

@@ -1,5 +1,7 @@
module(name = "codex")
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "llvm", version = "0.6.1")
single_version_override(
@@ -182,6 +184,230 @@ crate.annotation(
inject_repo(crate, "alsa_lib")
bazel_dep(name = "v8", version = "14.6.202.11")
archive_override(
module_name = "v8",
integrity = "sha256-Ju45oFJMyCWyT/r+d+MDsCbCeoDBisGaj4+KZYIIYSU=",
patch_cmds = ["""
python3 - <<'PY'
from pathlib import Path
module = Path("MODULE.bazel")
text = module.read_text()
start = text.index("# Define the local LLVM toolchain repository\\n")
end = text.index('libcxx_repository(\\n name = "libcxx",\\n)\\n') + len('libcxx_repository(\\n name = "libcxx",\\n)\\n')
text = text[:start] + text[end:]
fast_float_build = '''load("@rules_cc//cc:defs.bzl", "cc_library")
cc_library(
name = "fast_float",
hdrs = glob(["include/fast_float/*.h"]),
includes = ["include"],
visibility = ["//visibility:public"],
)
'''
simdutf_build = '''load("@rules_cc//cc:defs.bzl", "cc_library")
cc_library(
name = "simdutf",
srcs = ["simdutf.cpp"],
hdrs = ["simdutf.h"],
copts = ["-std=c++20"],
includes = ["."],
visibility = ["//visibility:public"],
)
'''
dragonbox_build = '''load("@rules_cc//cc:defs.bzl", "cc_library")
cc_library(
name = "dragonbox",
hdrs = ["include/dragonbox/dragonbox.h"],
includes = ["include"],
visibility = ["//visibility:public"],
)
'''
fp16_build = '''load("@rules_cc//cc:defs.bzl", "cc_library")
cc_library(
name = "fp16",
hdrs = glob(["include/**/*.h"]),
includes = ["include"],
visibility = ["//visibility:public"],
)
'''
highway_patch_cmd = '''python3 - <<'PY'
from pathlib import Path
build = Path("BUILD")
text = build.read_text()
text = text.replace(
'load("@rules_cc//cc:defs.bzl", "cc_test")',
'load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")',
)
build.write_text(text)
PY'''
module_insertion = f'''bazel_dep(name = "rules_license", version = "0.0.4")
git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "highway",
patch_cmds = [{highway_patch_cmd!r}],
sha256 = "7e0be78b8318e8bdbf6fa545d2ecb4c90f947df03f7aadc42c1967f019e63343",
strip_prefix = "highway-1.2.0",
urls = ["https://github.com/google/highway/archive/refs/tags/1.2.0.tar.gz"],
)
git_repository(
name = "icu",
build_file = "@v8//:bazel/BUILD.icu",
commit = "a86a32e67b8d1384b33f8fa48c83a6079b86f8cd",
patch_cmds = ["find source -name BUILD.bazel | xargs rm"],
patch_cmds_win = ["Get-ChildItem -Path source -File -Include BUILD.bazel -Recurse | Remove-Item"],
remote = "https://chromium.googlesource.com/chromium/deps/icu.git",
)
http_archive(
name = "fast_float",
build_file_content = {fast_float_build!r},
sha256 = "e14a33089712b681d74d94e2a11362643bd7d769ae8f7e7caefe955f57f7eacd",
strip_prefix = "fast_float-8.0.2",
urls = ["https://github.com/fastfloat/fast_float/archive/refs/tags/v8.0.2.tar.gz"],
)
git_repository(
name = "simdutf",
build_file_content = {simdutf_build!r},
commit = "93b35aec29256f705c97f675fe4623578bd7a395",
remote = "https://chromium.googlesource.com/chromium/src/third_party/simdutf",
)
git_repository(
name = "dragonbox",
build_file_content = {dragonbox_build!r},
commit = "beeeef91cf6fef89a4d4ba5e95d47ca64ccb3a44",
remote = "https://chromium.googlesource.com/external/github.com/jk-jeon/dragonbox.git",
)
git_repository(
name = "fp16",
build_file_content = {fp16_build!r},
commit = "3d2de1816307bac63c16a297e8c4dc501b4076df",
remote = "https://chromium.googlesource.com/external/github.com/Maratyszcza/FP16.git",
)
'''
text = text.replace('bazel_dep(name = "highway", version = "1.2.0")\\n', module_insertion)
module.write_text(text)
defs = Path("bazel/defs.bzl")
text = defs.read_text()
text = text.replace(' deps = [":define_flags", "@libcxx//:libc++"],\\n', ' deps = [":define_flags"],\\n')
defs.write_text(text)
build = Path("BUILD.bazel")
text = build.read_text()
text = text.replace(' default = "none",\\n', ' default = "False",\\n', 1)
text = text.replace("//external:icu", "@icu//:icu")
text = text.replace("//third_party/fast_float/src:fast_float", "@fast_float//:fast_float")
text = text.replace(
'alias(\\n name = "core_lib_icu",\\n actual = "icu/v8",\\n)\\n',
'alias(\\n name = "core_lib_icu",\\n actual = "icu/v8",\\n visibility = ["//visibility:public"],\\n)\\n',
)
text = text.replace(
' srcs = [\\n "include/js_protocol.pdl",\\n "src/inspector/inspector_protocol_config.json",\\n ],\\n',
' srcs = [\\n "include/js_protocol.pdl",\\n "src/inspector/inspector_protocol_config.json",\\n "third_party/inspector_protocol/code_generator.py",\\n "third_party/inspector_protocol/pdl.py",\\n "third_party/inspector_protocol/lib/Forward_h.template",\\n "third_party/inspector_protocol/lib/Object_cpp.template",\\n "third_party/inspector_protocol/lib/Object_h.template",\\n "third_party/inspector_protocol/lib/Protocol_cpp.template",\\n "third_party/inspector_protocol/lib/ValueConversions_cpp.template",\\n "third_party/inspector_protocol/lib/ValueConversions_h.template",\\n "third_party/inspector_protocol/lib/Values_cpp.template",\\n "third_party/inspector_protocol/lib/Values_h.template",\\n "third_party/inspector_protocol/templates/Exported_h.template",\\n "third_party/inspector_protocol/templates/Imported_h.template",\\n "third_party/inspector_protocol/templates/TypeBuilder_cpp.template",\\n "third_party/inspector_protocol/templates/TypeBuilder_h.template",\\n ],\\n',
1,
)
text = text.replace(
' cmd = "$(location :code_generator) --jinja_dir . \\\\\\n --inspector_protocol_dir third_party/inspector_protocol \\\\\\n --config $(location :src/inspector/inspector_protocol_config.json) \\\\\\n --config_value protocol.path=$(location :include/js_protocol.pdl) \\\\\\n --output_base $(@D)/src/inspector",\\n',
' cmd = "INSPECTOR_PROTOCOL_DIR=$$(dirname $(execpath third_party/inspector_protocol/code_generator.py)); \\\\\\n PYTHONPATH=$$INSPECTOR_PROTOCOL_DIR:external/rules_python++pip+v8_python_deps_311_jinja2/site-packages:external/rules_python++pip+v8_python_deps_311_markupsafe/site-packages:$${PYTHONPATH-} \\\\\\n python3 $(execpath third_party/inspector_protocol/code_generator.py) --jinja_dir . \\\\\\n --inspector_protocol_dir $$INSPECTOR_PROTOCOL_DIR \\\\\\n --config $(location :src/inspector/inspector_protocol_config.json) \\\\\\n --config_value protocol.path=$(location :include/js_protocol.pdl) \\\\\\n --output_base $(@D)/src/inspector",\\n',
1,
)
text = text.replace(
' tools = [\\n ":code_generator",\\n ],\\n',
' tools = [\\n requirement("jinja2"),\\n requirement("markupsafe"),\\n ],\\n',
1,
)
text = text.replace(
'cc_library(\\n name = "simdutf",\\n srcs = ["third_party/simdutf/simdutf.cpp"],\\n hdrs = ["third_party/simdutf/simdutf.h"],\\n copts = select({\\n "@v8//bazel/config:is_clang": ["-std=c++20"],\\n "@v8//bazel/config:is_gcc": ["-std=gnu++2a"],\\n "@v8//bazel/config:is_windows": ["/std:c++20"],\\n "//conditions:default": [],\\n }),\\n)\\n',
'alias(\\n name = "simdutf",\\n actual = "@simdutf//:simdutf",\\n)\\n',
1,
)
text = text.replace(
'v8_library(\\n name = "lib_dragonbox",\\n srcs = ["third_party/dragonbox/src/include/dragonbox/dragonbox.h"],\\n hdrs = [\\n "third_party/dragonbox/src/include/dragonbox/dragonbox.h",\\n ],\\n includes = [\\n "third_party/dragonbox/src/include",\\n ],\\n)\\n',
'alias(\\n name = "lib_dragonbox",\\n actual = "@dragonbox//:dragonbox",\\n)\\n',
1,
)
text = text.replace(
'v8_library(\\n name = "lib_fp16",\\n srcs = ["third_party/fp16/src/include/fp16.h"],\\n hdrs = [\\n "third_party/fp16/src/include/fp16/fp16.h",\\n "third_party/fp16/src/include/fp16/bitcasts.h",\\n "third_party/fp16/src/include/fp16/macros.h",\\n ],\\n includes = [\\n "third_party/fp16/src/include",\\n ],\\n)\\n',
'alias(\\n name = "lib_fp16",\\n actual = "@fp16//:fp16",\\n)\\n',
1,
)
needle = 'filegroup(\\n name = "d8_files",\\n'
insert = 'cc_library(\\n name = "rusty_v8_internal_headers",\\n hdrs = [\\n "src/libplatform/default-platform.h",\\n ],\\n strip_include_prefix = "",\\n visibility = ["//visibility:public"],\\n)\\n\\n'
if needle not in text:
raise SystemExit("could not find d8_files insertion point")
build.write_text(text.replace(needle, insert + needle, 1))
stack_trace = Path("src/base/debug/stack_trace_posix.cc")
text = stack_trace.read_text()
text = text.replace(
'bool dump_stack_in_signal_handler = true;\\n\\n// The prefix used for mangled symbols, per the Itanium C++ ABI:\\n// http://www.codesourcery.com/cxx-abi/abi.html#mangling\\nconst char kMangledSymbolPrefix[] = "_Z";\\n\\n// Characters that can be used for symbols, generated by Ruby:\\n// ((\\'a\\'..\\'z\\').to_a+(\\'A\\'..\\'Z\\').to_a+(\\'0\\'..\\'9\\').to_a + [\\'_\\']).join\\nconst char kSymbolCharacters[] =\\n "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";\\n\\n#if HAVE_EXECINFO_H\\n',
'bool dump_stack_in_signal_handler = true;\\n\\n#if HAVE_EXECINFO_H\\n// The prefix used for mangled symbols, per the Itanium C++ ABI:\\n// http://www.codesourcery.com/cxx-abi/abi.html#mangling\\nconst char kMangledSymbolPrefix[] = "_Z";\\n\\n// Characters that can be used for symbols, generated by Ruby:\\n// ((\\'a\\'..\\'z\\').to_a+(\\'A\\'..\\'Z\\').to_a+(\\'0\\'..\\'9\\').to_a + [\\'_\\']).join\\nconst char kSymbolCharacters[] =\\n "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";\\n\\n',
1,
)
stack_trace.write_text(text)
thread_isolated_allocator = Path("src/libplatform/default-thread-isolated-allocator.cc")
text = thread_isolated_allocator.read_text()
text = text.replace(
"bool KernelHasPkruFix() {\\n",
"[[maybe_unused]] bool KernelHasPkruFix() {\\n",
1,
)
thread_isolated_allocator.write_text(text)
for path in Path("src").rglob("*"):
if not path.is_file():
continue
text = path.read_text()
text = text.replace('"third_party/fp16/src/include/fp16.h"', '"fp16.h"')
text = text.replace('"third_party/simdutf/simdutf.h"', '"simdutf.h"')
text = text.replace(
'"third_party/fast_float/src/include/fast_float/fast_float.h"',
'"fast_float/fast_float.h"',
)
text = text.replace(
'"third_party/fast_float/src/include/fast_float/float_common.h"',
'"fast_float/float_common.h"',
)
text = text.replace(
'"third_party/dragonbox/src/include/dragonbox/dragonbox.h"',
'"dragonbox/dragonbox.h"',
)
path.write_text(text)
icu_build = Path("bazel/BUILD.icu")
text = icu_build.read_text()
if 'load("@rules_cc//cc:defs.bzl", "cc_library")\\n\\n' not in text:
text = 'load("@rules_cc//cc:defs.bzl", "cc_library")\\n\\n' + text
icu_build.write_text(text)
PY
"""],
strip_prefix = "v8-14.6.202.11",
urls = ["https://github.com/v8/v8/archive/refs/tags/14.6.202.11.tar.gz"],
)
http_archive(
name = "v8_crate_146_4_0",
build_file = "//third_party/v8:v8_crate.BUILD.bazel",
sha256 = "d97bcac5cdc5a195a4813f1855a6bc658f240452aac36caa12fd6c6f16026ab1",
strip_prefix = "v8-146.4.0",
type = "tar.gz",
urls = ["https://static.crates.io/crates/v8/v8-146.4.0.crate"],
)
use_repo(crate, "crates")
rbe_platform_repository = use_repo_rule("//:rbe.bzl", "rbe_platform_repository")

5
MODULE.bazel.lock generated
View File

@@ -12,6 +12,7 @@
"https://bcr.bazel.build/modules/abseil-cpp/20240116.2/MODULE.bazel": "73939767a4686cd9a520d16af5ab440071ed75cec1a876bf2fcfaf1f71987a16",
"https://bcr.bazel.build/modules/abseil-cpp/20250127.1/MODULE.bazel": "c4a89e7ceb9bf1e25cf84a9f830ff6b817b72874088bf5141b314726e46a57c1",
"https://bcr.bazel.build/modules/abseil-cpp/20250512.1/MODULE.bazel": "d209fdb6f36ffaf61c509fcc81b19e81b411a999a934a032e10cd009a0226215",
"https://bcr.bazel.build/modules/abseil-cpp/20250814.0/MODULE.bazel": "c43c16ca2c432566cdb78913964497259903ebe8fb7d9b57b38e9f1425b427b8",
"https://bcr.bazel.build/modules/abseil-cpp/20250814.1/MODULE.bazel": "51f2312901470cdab0dbdf3b88c40cd21c62a7ed58a3de45b365ddc5b11bcab2",
"https://bcr.bazel.build/modules/abseil-cpp/20250814.1/source.json": "cea3901d7e299da7320700abbaafe57a65d039f10d0d7ea601c4a66938ea4b0c",
"https://bcr.bazel.build/modules/alsa_lib/1.2.9.bcr.4/MODULE.bazel": "66842efc2b50b7c12274a5218d468119a5d6f9dc46a5164d9496fb517f64aba6",
@@ -112,6 +113,7 @@
"https://bcr.bazel.build/modules/platforms/1.0.0/source.json": "f4ff1fd412e0246fd38c82328eb209130ead81d62dcd5a9e40910f867f733d96",
"https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7",
"https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c",
"https://bcr.bazel.build/modules/protobuf/27.1/MODULE.bazel": "703a7b614728bb06647f965264967a8ef1c39e09e8f167b3ca0bb1fd80449c0d",
"https://bcr.bazel.build/modules/protobuf/29.0-rc2/MODULE.bazel": "6241d35983510143049943fc0d57937937122baf1b287862f9dc8590fc4c37df",
"https://bcr.bazel.build/modules/protobuf/29.0-rc3/MODULE.bazel": "33c2dfa286578573afc55a7acaea3cada4122b9631007c594bf0729f41c8de92",
"https://bcr.bazel.build/modules/protobuf/29.1/MODULE.bazel": "557c3457560ff49e122ed76c0bc3397a64af9574691cb8201b4e46d4ab2ecb95",
@@ -176,6 +178,7 @@
"https://bcr.bazel.build/modules/rules_kotlin/1.9.6/MODULE.bazel": "d269a01a18ee74d0335450b10f62c9ed81f2321d7958a2934e44272fe82dcef3",
"https://bcr.bazel.build/modules/rules_kotlin/1.9.6/source.json": "2faa4794364282db7c06600b7e5e34867a564ae91bda7cae7c29c64e9466b7d5",
"https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0",
"https://bcr.bazel.build/modules/rules_license/0.0.4/MODULE.bazel": "6a88dd22800cf1f9f79ba32cacad0d3a423ed28efa2c2ed5582eaa78dd3ac1e5",
"https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d",
"https://bcr.bazel.build/modules/rules_license/1.0.0/MODULE.bazel": "a7fda60eefdf3d8c827262ba499957e4df06f659330bbe6cdbdb975b768bb65c",
"https://bcr.bazel.build/modules/rules_license/1.0.0/source.json": "a52c89e54cc311196e478f8382df91c15f7a2bfdf4c6cd0e2675cc2ff0b56efb",
@@ -190,6 +193,7 @@
"https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7",
"https://bcr.bazel.build/modules/rules_proto/6.0.0-rc1/MODULE.bazel": "1e5b502e2e1a9e825eef74476a5a1ee524a92297085015a052510b09a1a09483",
"https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73",
"https://bcr.bazel.build/modules/rules_proto/7.0.2/MODULE.bazel": "bf81793bd6d2ad89a37a40693e56c61b0ee30f7a7fdbaf3eabbf5f39de47dea2",
"https://bcr.bazel.build/modules/rules_proto/7.1.0/MODULE.bazel": "002d62d9108f75bb807cd56245d45648f38275cb3a99dcd45dfb864c5d74cb96",
"https://bcr.bazel.build/modules/rules_proto/7.1.0/source.json": "39f89066c12c24097854e8f57ab8558929f9c8d474d34b2c00ac04630ad8940e",
"https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f",
@@ -199,6 +203,7 @@
"https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel": "93a43dc47ee570e6ec9f5779b2e64c1476a6ce921c48cc9a1678a91dd5f8fd58",
"https://bcr.bazel.build/modules/rules_python/0.33.2/MODULE.bazel": "3e036c4ad8d804a4dad897d333d8dce200d943df4827cb849840055be8d2e937",
"https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c",
"https://bcr.bazel.build/modules/rules_python/1.0.0/MODULE.bazel": "898a3d999c22caa585eb062b600f88654bf92efb204fa346fb55f6f8edffca43",
"https://bcr.bazel.build/modules/rules_python/1.3.0/MODULE.bazel": "8361d57eafb67c09b75bf4bbe6be360e1b8f4f18118ab48037f2bd50aa2ccb13",
"https://bcr.bazel.build/modules/rules_python/1.4.1/MODULE.bazel": "8991ad45bdc25018301d6b7e1d3626afc3c8af8aaf4bc04f23d0b99c938b73a6",
"https://bcr.bazel.build/modules/rules_python/1.6.0/MODULE.bazel": "7e04ad8f8d5bea40451cf80b1bd8262552aa73f841415d20db96b7241bd027d8",

View File

@@ -0,0 +1,5 @@
exports_files([
"aws-lc-sys_memcmp_check.patch",
"toolchains_llvm_bootstrapped_resource_dir.patch",
"windows-link.patch",
])

73
third_party/v8/BUILD.bazel vendored Normal file
View File

@@ -0,0 +1,73 @@
load("@rules_cc//cc:cc_static_library.bzl", "cc_static_library")
load("@rules_cc//cc:defs.bzl", "cc_library")
package(default_visibility = ["//visibility:public"])
genrule(
name = "binding_cc",
srcs = ["@v8_crate_146_4_0//:binding_cc"],
outs = ["binding.cc"],
cmd = """
sed \
-e '/#include "v8\\/src\\/flags\\/flags.h"/d' \
-e 's|"v8/src/libplatform/default-platform.h"|"src/libplatform/default-platform.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_146_4_0//:binding_cc) > "$@"
""",
)
genrule(
name = "support_h",
srcs = ["@v8_crate_146_4_0//:support_h"],
outs = ["support.h"],
cmd = "cp $(location @v8_crate_146_4_0//:support_h) $@",
)
cc_library(
name = "v8_146_4_0_binding",
srcs = [":binding_cc"],
hdrs = [":support_h"],
copts = select({
"@v8//bazel/config:is_clang": ["-std=c++20"],
"@v8//bazel/config:is_gcc": ["-std=gnu++2a"],
"@v8//bazel/config:is_windows": ["/std:c++20"],
"//conditions:default": [],
}),
deps = [
"@v8//:core_lib_icu",
"@v8//:rusty_v8_internal_headers",
],
)
cc_static_library(
name = "v8_146_4_0_aarch64_apple_darwin",
deps = [":v8_146_4_0_binding"],
)
cc_static_library(
name = "v8_146_4_0_aarch64_unknown_linux_musl",
deps = [":v8_146_4_0_binding"],
)
cc_static_library(
name = "v8_146_4_0_x86_64_unknown_linux_musl",
deps = [":v8_146_4_0_binding"],
)
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_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"],
)

26
third_party/v8/v8_crate.BUILD.bazel vendored Normal file
View File

@@ -0,0 +1,26 @@
package(default_visibility = ["//visibility:public"])
filegroup(
name = "binding_cc",
srcs = ["src/binding.cc"],
)
filegroup(
name = "support_h",
srcs = ["src/support.h"],
)
filegroup(
name = "src_binding_release_aarch64_apple_darwin",
srcs = ["gen/src_binding_release_aarch64-apple-darwin.rs"],
)
filegroup(
name = "src_binding_release_aarch64_unknown_linux_gnu",
srcs = ["gen/src_binding_release_aarch64-unknown-linux-gnu.rs"],
)
filegroup(
name = "src_binding_release_x86_64_unknown_linux_gnu",
srcs = ["gen/src_binding_release_x86_64-unknown-linux-gnu.rs"],
)