Skip to content

Commit 68512b8

Browse files
committed
V8: disable Temporal in monolith to keep it self-contained
V8 13+ (Node.js 25+) enables the Temporal proposal by default, backed by the Rust //third_party/rust/temporal_capi crate. That crate is a separate static library that is NOT linked into v8_monolith, so embedders linking the standalone monolith get ~250 unresolved temporal_rs_* externals (the win-x86 v8-v25.6.1 package is affected; full libnode bundles it instead). Generate args.gn from a pwsh step and add v8_enable_temporal_support=false when the V8 major version is >= 13 (guarded, since gn errors on unknown args and the flag does not exist on older V8 / Node.js 22 builds).
1 parent 2d0aae1 commit 68512b8

1 file changed

Lines changed: 42 additions & 16 deletions

File tree

.github/workflows/build.yml

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -356,28 +356,54 @@ jobs:
356356
(Get-Content $buildGn -Raw) -replace 'configs = \[ ":static_crt" \]', 'configs = [ ":dynamic_crt" ]' | Set-Content $buildGn
357357
Write-Host "Patched $buildGn to use dynamic CRT (/MD)"
358358
359+
- name: Generate V8 build args
360+
shell: pwsh
361+
run: |
362+
$branch = "${{ steps.v8ver.outputs.v8_branch }}"
363+
$major = [int]($branch.Split('.')[0])
364+
365+
New-Item -ItemType Directory -Force -Path "v8-src/v8/out/release" | Out-Null
366+
367+
$gnArgs = @(
368+
'is_debug = false'
369+
'target_cpu = "${{ matrix.arch }}"'
370+
'is_clang = true'
371+
'is_component_build = false'
372+
'v8_monolithic = true'
373+
'v8_static_library = true'
374+
'v8_use_external_startup_data = false'
375+
'v8_enable_i18n_support = false'
376+
'v8_enable_sandbox = false'
377+
'v8_enable_pointer_compression = false'
378+
'use_custom_libcxx = false'
379+
'treat_warnings_as_errors = false'
380+
'symbol_level = 0'
381+
)
382+
383+
# V8 13+ (Node.js 25+) ships the Temporal proposal, enabled here by default,
384+
# backed by the Rust //third_party/rust/temporal_capi crate. That crate is a
385+
# SEPARATE static library that is NOT linked into v8_monolith, so embedders
386+
# linking the monolith get unresolved temporal_rs_* externals. Sandboxed
387+
# embedding does not need Temporal, so disable it to keep the monolith
388+
# self-contained. The GN arg only exists on V8 13+ (gn errors on unknown
389+
# args), so guard it by the V8 major version.
390+
if ($major -ge 13) {
391+
$gnArgs += 'v8_enable_temporal_support = false'
392+
Write-Host "V8 $branch: disabling Temporal (drops temporal_capi/temporal_rs)"
393+
} else {
394+
Write-Host "V8 $branch predates the Temporal Rust backend; leaving args.gn unchanged"
395+
}
396+
397+
Set-Content -Path "v8-src/v8/out/release/args.gn" -Value $gnArgs -Encoding ascii
398+
Write-Host "=== args.gn ==="
399+
Get-Content "v8-src/v8/out/release/args.gn"
400+
359401
- name: Build V8 monolith
360402
shell: cmd
361403
env:
362404
GYP_MSVS_OVERRIDE_PATH: ${{ steps.vsdetect.outputs.vs_path }}
363405
run: |
364406
cd v8-src\v8 || exit /b 1
365-
mkdir out\release
366-
(echo is_debug = false
367-
echo target_cpu = "${{ matrix.arch }}"
368-
echo is_clang = true
369-
echo is_component_build = false
370-
echo v8_monolithic = true
371-
echo v8_static_library = true
372-
echo v8_use_external_startup_data = false
373-
echo v8_enable_i18n_support = false
374-
echo v8_enable_sandbox = false
375-
echo v8_enable_pointer_compression = false
376-
echo use_custom_libcxx = false
377-
echo treat_warnings_as_errors = false
378-
echo symbol_level = 0) > out\release\args.gn
379-
echo === args.gn ===
380-
type out\release\args.gn
381407
echo === gn gen ===
382408
call gn gen out\release || exit /b 1
383409
echo === ninja ===

0 commit comments

Comments
 (0)