#52902: build: generate the Node startup snapshot once per build
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
- PR description included and stakeholders cc'd
- PR title follows semantic commit guidelines
- PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, and past tense.
Release Notes
Notes: none
Backports
Semver Impact
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