build: generate the Node startup snapshot once per build - #52902
Merged
Conversation
run_node_mksnapshot was instantiated in every toolchain that pulled in ":node_snapshot", so a cross build ran it twice: once in the default toolchain for the shipped framework, once in v8_snapshot_toolchain for the host tool that generates the browser process's js2c code cache. Two runs are not guaranteed to produce the same snapshot, and on Windows they do not, so the tool built its cache against a read-only heap the framework never embedded and V8 rejected every entry at startup with a read-only snapshot checksum mismatch - the browser process compiled browser_init, utility_init and node_init from source instead. Define the action only in the default toolchain and have each toolchain's ":node_snapshot" compile that one output, so the snapshot the cache is keyed to is the snapshot the framework ships. Notes: none
MarshallOfSound
approved these changes
Aug 17, 2026
|
No Release Notes |
Contributor
|
I was unable to backport this PR to "44-x-y" cleanly; |
Contributor
|
I was unable to backport this PR to "43-x-y" cleanly; |
Contributor
|
I was unable to backport this PR to "42-x-y" cleanly; |
This was referenced Aug 17, 2026
Contributor
|
@MarshallOfSound has manually backported this PR to "43-x-y", please check out #52881 |
Contributor
|
@MarshallOfSound has manually backported this PR to "42-x-y", please check out #52880 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
run_node_mksnapshotwas 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 inv8_snapshot_toolchainfor 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 compiledbrowser_init,utility_initandnode_initfrom source instead - which is what thejs2c build-time code cachespecs 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_snapshotcompile that one output, so the snapshot the cache is keyed to is the snapshot the framework ships.Checklist
Release Notes
Notes: none