codebytere

#52902: build: generate the Node startup snapshot once per build

Merged
Created: Aug 17, 2026, 5:27:10 AM
Merged: Aug 17, 2026, 8:17:54 AM
6 comments
Target: main

Description of Change

run_node_mksnapshot was defined in every toolchain that pulled in :node_snapshot, so a cross build ran it twice: once in the default toolchain for the shipped framework and once in v8_snapshot_toolchain for the host tool that generates the browser process's js2c code cache. Two runs aren't guaranteed to produce the same snapshot, and on Windows they don't, so the tool built its cache against a read-only heap the framework never embedded. V8 then rejected every entry at startup with a read-only snapshot checksum mismatch and the browser process compiled browser_init, utility_init and node_init from source instead - which is what the js2c build-time code cache specs caught on windows-arm64 (https://github.com/electron/electron/actions/runs/32001222846/job/95314127255).

This defines the action only in the default toolchain and has each toolchain's :node_snapshot compile that one output, so the snapshot the cache is keyed to is the snapshot the framework ships.

Checklist

Release Notes

Notes: none

Backports

42-x-y
In-flight
PR Number
#52880
Waiting to be merged
43-x-y
In-flight
PR Number
#52881
Waiting to be merged
44-x-y
In-flight
PR Number
#
Waiting to be merged

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron