@@ -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
0 commit comments