codebytere

#52872: fix: let custom V8 snapshots reach the main process again

Merged
Created: Aug 16, 2026, 4:11:16 PM
Merged: Aug 16, 2026, 7:34:37 PM
7 comments
Target: main

Description of Change

Since the main process started booting from the embedded Node.js startup snapshot (#51703), its context is deserialized from that blob, which is built on top of the stock snapshot_blob.bin at build time. Anything a custom snapshot puts into the default context — electron-mksnapshot users, and the browser_v8_context_snapshot.bin that the loadBrowserProcessSpecificV8Snapshot fuse selects — therefore never showed up in the main process on native-built targets (mac arm64, linux x64, win x64), while cross-built targets, which ship without the Node snapshot, kept working. spec/fixtures/snapshot-items-available reproduces it (ReferenceError: f is not defined), but CI has only been running verify-mksnapshot.py --create-snapshot-only since the GHA migration, so nothing noticed.

This:

  • skips the embedded Node snapshot for the main process when the fuse is on or the loaded v8 context snapshot is not the one this build shipped, and bootstraps Node from scratch on the loaded blob as snapshot-less builds do. The check is a size + V8-blob-header comparison against constants that build/checksum_header.py now emits next to the existing SHA-256, so there is no hashing at startup;
  • re-adds the full verify-mksnapshot.py run (create the custom blobs and launch Electron with them) to one native test leg (linux x64);
  • documents in fuses.md that a custom snapshot means the main process gives up the startup snapshot's boot-time win.

Verified locally on linux x64: verify-mksnapshot.py end-to-end goes from not ok … f is not defined to ok successfully used custom snapshot, and a stock build still boots the main process from the embedded snapshot.

Checklist

Release Notes

Notes: Fixed custom V8 snapshots (electron-mksnapshot, and the loadBrowserProcessSpecificV8Snapshot fuse) having no effect in the main process on macOS arm64, Linux x64 and Windows x64.

Backports

42-x-y
Merged
PR Number
#52876
Merged At
Aug 16, 2026, 9:12:00 PM
Released In
Not yet
Release Date
Not yet
43-x-y
Merged
PR Number
#52877
Merged At
Aug 16, 2026, 9:17:31 PM
Released In
Not yet
Release Date
Not yet
44-x-y
Merged
PR Number
#52878
Merged At
Aug 16, 2026, 9:21:12 PM
Released In
Not yet
Release Date
Not yet

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