Skip to content

fix(download): persist toolset archives in a predictable cache path#9861

Merged
mmaietta merged 2 commits into
masterfrom
fix/electron-get-caching
Jun 9, 2026
Merged

fix(download): persist toolset archives in a predictable cache path#9861
mmaietta merged 2 commits into
masterfrom
fix/electron-get-caching

Conversation

@mmaietta

@mmaietta mmaietta commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Fixes: #9860

  • Predictable archive cache — after each toolset download (winCodeSign, AppImage tools, etc.) electron-builder persists the archive at <ELECTRON_BUILDER_CACHE>/<releaseName>/<filename> alongside the extracted directory. On every subsequent build it checks this path first; if the archive is present (and its SHA-256 checksum matches when one is configured) the download and all @electron/get interaction is skipped entirely — no network call, no progress bar, no lock contention.
  • Checksum validation on cache hit — if a known-good SHA-256 was supplied and the cached archive doesn't match, the stale file is deleted and a fresh download is triggered automatically.
  • filenameWithExt path-traversal guarddownloadBuilderToolset rejects filenames containing /, \, or .. before any I/O.

…o repeated builds and offline environments skip the @electron/get network round-trip
@changeset-bot

changeset-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 10321bd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
app-builder-lib Patch
dmg-builder Patch
electron-builder-squirrel-windows Patch
electron-builder Patch
electron-forge-maker-appimage Patch
electron-forge-maker-nsis-web Patch
electron-forge-maker-nsis Patch
electron-forge-maker-snap Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mmaietta
mmaietta merged commit 9097daf into master Jun 9, 2026
110 of 111 checks passed
@mmaietta
mmaietta deleted the fix/electron-get-caching branch June 9, 2026 08:18
mmaietta added a commit that referenced this pull request Jun 10, 2026
…ache persistence

Merge conflicts resolved in favor of this branch's cascade-006 changes:
- configuration.ts: keep `nativeModules?: NativeModulesConfig` (not flat npmRebuild/nativeRebuilder)
- scheme.json: keep NativeModulesConfig $ref, drop top-level npmRebuild/nodeGypRebuild/snap entries
- yarn.ts: keep config.nativeModules?.rebuildMode (not config.nativeRebuilder)
- coreLegacy.ts: keep SnapOptionsLegacy import (SnapOptions was renamed)
- SnapTarget.ts: keep { base: "core24" } default (new default from cascade-006)
- LinuxTargetHelper.ts: keep SnapCore24 default routing with electron version guards

Also adds resolveFromArchiveCache + persistToArchiveCache to downloadBuilderToolset
(backport of fix #9861 that was missing from this branch). All three CI shards
(Linux/macOS/Windows) failed with the same two tests in electronGetTest.ts::toolset
archive cache — both now pass (39/39 locally).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

winCodeSign download always breaks electron build in offline environment

1 participant