Skip to content

Commit b89ce9a

Browse files
authored
build(v8): update rusty_v8 to 149.2.0 (#26464)
1 parent cdc8ec0 commit b89ce9a

16 files changed

Lines changed: 495 additions & 299 deletions

.bazelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ common --@v8//:v8_enable_sandbox=True
214214
# artifact migration ships matching Rust feature selection for Cargo consumers.
215215
common:v8-release-compat --@v8//:v8_enable_pointer_compression=False
216216
common:v8-release-compat --@v8//:v8_enable_sandbox=False
217+
common:v8-target-x64 --@v8//bazel/config:v8_target_cpu=x64
218+
common:v8-target-arm64 --@v8//bazel/config:v8_target_cpu=arm64
217219

218220
# Match rusty_v8's upstream GN release contract for published artifacts: every
219221
# target object uses Chromium's custom libc++ headers and the archive folds in

.github/workflows/rusty-v8-release.yml

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,72 +73,84 @@ jobs:
7373
platform: linux_amd64
7474
sandbox: false
7575
target: x86_64-unknown-linux-gnu
76+
v8_cpu: x64
7677
variant: release
7778
- runner: ubuntu-24.04
7879
bazel_config: ci-v8
7980
platform: linux_amd64
8081
sandbox: true
8182
target: x86_64-unknown-linux-gnu
83+
v8_cpu: x64
8284
variant: ptrcomp-sandbox
8385
- runner: ubuntu-24.04-arm
8486
bazel_config: ci-v8
8587
platform: linux_arm64
8688
sandbox: false
8789
target: aarch64-unknown-linux-gnu
90+
v8_cpu: arm64
8891
variant: release
8992
- runner: ubuntu-24.04-arm
9093
bazel_config: ci-v8
9194
platform: linux_arm64
9295
sandbox: true
9396
target: aarch64-unknown-linux-gnu
97+
v8_cpu: arm64
9498
variant: ptrcomp-sandbox
9599
- runner: macos-15-xlarge
96100
bazel_config: ci-macos
97101
platform: macos_amd64
98102
sandbox: false
99103
target: x86_64-apple-darwin
104+
v8_cpu: x64
100105
variant: release
101106
- runner: macos-15-xlarge
102107
bazel_config: ci-macos
103108
platform: macos_amd64
104109
sandbox: true
105110
target: x86_64-apple-darwin
111+
v8_cpu: x64
106112
variant: ptrcomp-sandbox
107113
- runner: macos-15-xlarge
108114
bazel_config: ci-macos
109115
platform: macos_arm64
110116
sandbox: false
111117
target: aarch64-apple-darwin
118+
v8_cpu: arm64
112119
variant: release
113120
- runner: macos-15-xlarge
114121
bazel_config: ci-macos
115122
platform: macos_arm64
116123
sandbox: true
117124
target: aarch64-apple-darwin
125+
v8_cpu: arm64
118126
variant: ptrcomp-sandbox
119127
- runner: ubuntu-24.04
120128
bazel_config: ci-v8
121129
platform: linux_amd64_musl
122130
sandbox: false
123131
target: x86_64-unknown-linux-musl
132+
v8_cpu: x64
124133
variant: release
125134
- runner: ubuntu-24.04-arm
126135
bazel_config: ci-v8
127136
platform: linux_arm64_musl
128137
sandbox: false
129138
target: aarch64-unknown-linux-musl
139+
v8_cpu: arm64
130140
variant: release
131141
- runner: ubuntu-24.04
132142
bazel_config: ci-v8
133143
platform: linux_amd64_musl
134144
sandbox: true
135145
target: x86_64-unknown-linux-musl
146+
v8_cpu: x64
136147
variant: ptrcomp-sandbox
137148
- runner: ubuntu-24.04-arm
138149
bazel_config: ci-v8
139150
platform: linux_arm64_musl
140151
sandbox: true
141152
target: aarch64-unknown-linux-musl
153+
v8_cpu: arm64
142154
variant: ptrcomp-sandbox
143155

144156
steps:
@@ -167,6 +179,7 @@ jobs:
167179
PLATFORM: ${{ matrix.platform }}
168180
SANDBOX: ${{ matrix.sandbox }}
169181
TARGET: ${{ matrix.target }}
182+
V8_CPU: ${{ matrix.v8_cpu }}
170183
shell: bash
171184
run: |
172185
set -euo pipefail
@@ -184,6 +197,7 @@ jobs:
184197
opt
185198
"--platforms=@llvm//platforms:${PLATFORM}"
186199
--config=rusty-v8-upstream-libcxx
200+
"--config=v8-target-${V8_CPU}"
187201
"${pair_target}"
188202
--build_metadata=COMMIT_SHA=$(git rev-parse HEAD)
189203
)
@@ -203,6 +217,7 @@ jobs:
203217
PLATFORM: ${{ matrix.platform }}
204218
SANDBOX: ${{ matrix.sandbox }}
205219
TARGET: ${{ matrix.target }}
220+
V8_CPU: ${{ matrix.v8_cpu }}
206221
shell: bash
207222
run: |
208223
set -euo pipefail
@@ -213,6 +228,7 @@ jobs:
213228
--compilation-mode opt
214229
--output-dir "dist/${TARGET}"
215230
--bazel-config "${BAZEL_CONFIG}"
231+
--bazel-config "v8-target-${V8_CPU}"
216232
)
217233
if [[ "${SANDBOX}" == "true" ]]; then
218234
stage_args+=(--sandbox)
@@ -266,10 +282,150 @@ jobs:
266282
name: rusty-v8-${{ needs.metadata.outputs.v8_version }}-${{ matrix.variant }}-${{ matrix.target }}
267283
path: dist/${{ matrix.target }}/*
268284

285+
build-windows-source:
286+
name: Build ptrcomp-sandbox ${{ matrix.target }} from source
287+
needs: metadata
288+
runs-on: ${{ matrix.runner }}
289+
permissions:
290+
contents: read
291+
strategy:
292+
fail-fast: false
293+
matrix:
294+
include:
295+
- runner: windows-2022
296+
target: x86_64-pc-windows-msvc
297+
- runner: windows-2022
298+
target: aarch64-pc-windows-msvc
299+
300+
steps:
301+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
302+
with:
303+
persist-credentials: false
304+
305+
- name: Configure git for upstream checkout
306+
shell: bash
307+
run: git config --global core.symlinks true
308+
309+
- name: Check out upstream rusty_v8
310+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
311+
with:
312+
repository: denoland/rusty_v8
313+
ref: v${{ needs.metadata.outputs.v8_version }}
314+
path: upstream-rusty-v8
315+
submodules: recursive
316+
317+
- name: Set up Python
318+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
319+
with:
320+
python-version: "3.11"
321+
architecture: x64
322+
323+
- name: Set up Codex Rust toolchain for Cargo smoke
324+
uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
325+
with:
326+
toolchain: "1.95.0"
327+
targets: ${{ matrix.target }}
328+
329+
- name: Install rusty_v8 Rust toolchain
330+
env:
331+
TARGET: ${{ matrix.target }}
332+
shell: bash
333+
run: |
334+
set -euo pipefail
335+
rustup toolchain install 1.91.0 --profile minimal --no-self-update
336+
rustup target add --toolchain 1.91.0 "${TARGET}"
337+
338+
- name: Write upstream submodule status
339+
shell: bash
340+
working-directory: upstream-rusty-v8
341+
run: git submodule status --recursive > git_submodule_status.txt
342+
343+
- name: Restore upstream source-build cache
344+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
345+
with:
346+
path: |
347+
upstream-rusty-v8/target/sccache
348+
upstream-rusty-v8/target/${{ matrix.target }}/release/gn_out
349+
key: rusty-v8-source-${{ matrix.target }}-sandbox-${{ hashFiles('upstream-rusty-v8/Cargo.lock', 'upstream-rusty-v8/build.rs', 'upstream-rusty-v8/git_submodule_status.txt') }}
350+
restore-keys: |
351+
rusty-v8-source-${{ matrix.target }}-sandbox-
352+
353+
- name: Install and start sccache
354+
shell: pwsh
355+
env:
356+
SCCACHE_CACHE_SIZE: 256M
357+
SCCACHE_DIR: ${{ github.workspace }}/upstream-rusty-v8/target/sccache
358+
SCCACHE_IDLE_TIMEOUT: 0
359+
run: |
360+
$version = "v0.8.2"
361+
$platform = "x86_64-pc-windows-msvc"
362+
$basename = "sccache-$version-$platform"
363+
$url = "https://github.com/mozilla/sccache/releases/download/$version/$basename.tar.gz"
364+
cd ~
365+
curl -LO $url
366+
tar -xzvf "$basename.tar.gz"
367+
. $basename/sccache --start-server
368+
echo "$(pwd)/$basename" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
369+
370+
- name: Install Chromium clang for ARM64 MSVC cross build
371+
if: matrix.target == 'aarch64-pc-windows-msvc'
372+
shell: bash
373+
working-directory: upstream-rusty-v8
374+
run: python3 tools/clang/scripts/update.py
375+
376+
- name: Build upstream rusty_v8 sandbox release pair
377+
env:
378+
SCCACHE_IDLE_TIMEOUT: 0
379+
TARGET: ${{ matrix.target }}
380+
V8_FROM_SOURCE: "1"
381+
shell: bash
382+
working-directory: upstream-rusty-v8
383+
run: cargo +1.91.0 build --locked --release --target "${TARGET}" --features v8_enable_sandbox
384+
385+
- name: Stage upstream sandbox release pair
386+
env:
387+
TARGET: ${{ matrix.target }}
388+
shell: bash
389+
run: |
390+
set -euo pipefail
391+
python3 .github/scripts/rusty_v8_bazel.py stage-upstream-release-pair \
392+
--source-root upstream-rusty-v8 \
393+
--target "${TARGET}" \
394+
--output-dir "dist/${TARGET}" \
395+
--sandbox
396+
397+
- name: Smoke link staged artifact with Cargo
398+
env:
399+
TARGET: ${{ matrix.target }}
400+
shell: bash
401+
run: |
402+
set -euo pipefail
403+
404+
archive="$(find "dist/${TARGET}" -maxdepth 1 -type f -name 'rusty_v8_*.lib.gz' -print -quit)"
405+
binding="$(find "dist/${TARGET}" -maxdepth 1 -type f -name 'src_binding_*.rs' -print -quit)"
406+
if [[ -z "${archive}" || -z "${binding}" ]]; then
407+
echo "Missing staged archive or binding for ${TARGET}." >&2
408+
exit 1
409+
fi
410+
411+
(
412+
cd codex-rs
413+
RUSTY_V8_ARCHIVE="${GITHUB_WORKSPACE}/${archive}" \
414+
RUSTY_V8_SRC_BINDING_PATH="${GITHUB_WORKSPACE}/${binding}" \
415+
cargo +1.95.0 test -p codex-v8-poc --target "${TARGET}" --features sandbox --no-run
416+
)
417+
418+
- name: Upload staged artifacts
419+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
420+
with:
421+
name: rusty-v8-${{ needs.metadata.outputs.v8_version }}-ptrcomp-sandbox-${{ matrix.target }}
422+
path: dist/${{ matrix.target }}/*
423+
269424
publish-release:
270425
needs:
271426
- metadata
272427
- build
428+
- build-windows-source
273429
runs-on: ubuntu-latest
274430
permissions:
275431
contents: write

.github/workflows/v8-canary.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,72 +89,84 @@ jobs:
8989
platform: linux_amd64
9090
sandbox: false
9191
target: x86_64-unknown-linux-gnu
92+
v8_cpu: x64
9293
variant: release
9394
- runner: ubuntu-24.04
9495
bazel_config: ci-v8
9596
platform: linux_amd64
9697
sandbox: true
9798
target: x86_64-unknown-linux-gnu
99+
v8_cpu: x64
98100
variant: ptrcomp-sandbox
99101
- runner: ubuntu-24.04-arm
100102
bazel_config: ci-v8
101103
platform: linux_arm64
102104
sandbox: false
103105
target: aarch64-unknown-linux-gnu
106+
v8_cpu: arm64
104107
variant: release
105108
- runner: ubuntu-24.04-arm
106109
bazel_config: ci-v8
107110
platform: linux_arm64
108111
sandbox: true
109112
target: aarch64-unknown-linux-gnu
113+
v8_cpu: arm64
110114
variant: ptrcomp-sandbox
111115
- runner: macos-15-xlarge
112116
bazel_config: ci-macos
113117
platform: macos_amd64
114118
sandbox: false
115119
target: x86_64-apple-darwin
120+
v8_cpu: x64
116121
variant: release
117122
- runner: macos-15-xlarge
118123
bazel_config: ci-macos
119124
platform: macos_amd64
120125
sandbox: true
121126
target: x86_64-apple-darwin
127+
v8_cpu: x64
122128
variant: ptrcomp-sandbox
123129
- runner: macos-15-xlarge
124130
bazel_config: ci-macos
125131
platform: macos_arm64
126132
sandbox: false
127133
target: aarch64-apple-darwin
134+
v8_cpu: arm64
128135
variant: release
129136
- runner: macos-15-xlarge
130137
bazel_config: ci-macos
131138
platform: macos_arm64
132139
sandbox: true
133140
target: aarch64-apple-darwin
141+
v8_cpu: arm64
134142
variant: ptrcomp-sandbox
135143
- runner: ubuntu-24.04
136144
bazel_config: ci-v8
137145
platform: linux_amd64_musl
138146
sandbox: false
139147
target: x86_64-unknown-linux-musl
148+
v8_cpu: x64
140149
variant: release
141150
- runner: ubuntu-24.04
142151
bazel_config: ci-v8
143152
platform: linux_amd64_musl
144153
sandbox: true
145154
target: x86_64-unknown-linux-musl
155+
v8_cpu: x64
146156
variant: ptrcomp-sandbox
147157
- runner: ubuntu-24.04-arm
148158
bazel_config: ci-v8
149159
platform: linux_arm64_musl
150160
sandbox: false
151161
target: aarch64-unknown-linux-musl
162+
v8_cpu: arm64
152163
variant: release
153164
- runner: ubuntu-24.04-arm
154165
bazel_config: ci-v8
155166
platform: linux_arm64_musl
156167
sandbox: true
157168
target: aarch64-unknown-linux-musl
169+
v8_cpu: arm64
158170
variant: ptrcomp-sandbox
159171
steps:
160172
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -183,6 +195,7 @@ jobs:
183195
PLATFORM: ${{ matrix.platform }}
184196
SANDBOX: ${{ matrix.sandbox }}
185197
TARGET: ${{ matrix.target }}
198+
V8_CPU: ${{ matrix.v8_cpu }}
186199
shell: bash
187200
run: |
188201
set -euo pipefail
@@ -198,6 +211,7 @@ jobs:
198211
build
199212
"--platforms=@llvm//platforms:${PLATFORM}"
200213
--config=rusty-v8-upstream-libcxx
214+
"--config=v8-target-${V8_CPU}"
201215
"${pair_target}"
202216
--build_metadata=COMMIT_SHA=$(git rev-parse HEAD)
203217
)
@@ -217,6 +231,7 @@ jobs:
217231
PLATFORM: ${{ matrix.platform }}
218232
SANDBOX: ${{ matrix.sandbox }}
219233
TARGET: ${{ matrix.target }}
234+
V8_CPU: ${{ matrix.v8_cpu }}
220235
shell: bash
221236
run: |
222237
set -euo pipefail
@@ -226,6 +241,7 @@ jobs:
226241
--target "${TARGET}"
227242
--output-dir "dist/${TARGET}"
228243
--bazel-config "${BAZEL_CONFIG}"
244+
--bazel-config "v8-target-${V8_CPU}"
229245
)
230246
if [[ "${SANDBOX}" == "true" ]]; then
231247
stage_args+=(--sandbox)

0 commit comments

Comments
 (0)