fix(desktop): recover from corrupt Electron cache in Windows bootstrap install (salvage #39134) - #39465
Merged
Conversation
…l (Windows) Windows counterpart of #39127: scripts/install.ps1 `Install-Desktop` runs `npm run pack` once and throws on the opaque ENOENT a corrupt cached Electron download produces, with no recovery. Add `Clear-ElectronBuildCache` plus a purge-and-retry-once on pack failure, mirroring the install.sh fix: remove the cached electron-*.zip (%LOCALAPPDATA%\electron\Cache + ELECTRON_CACHE / electron_config_cache overrides) and stale *-unpacked output, then retry so @electron/get re-downloads with its own SHASUM verification. Refs #37544. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
🔎 Lint report:
|
1 task
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.
Summary
The Windows installer now self-heals a corrupt Electron download cache instead of hard-failing the desktop build. Mirrors the merged
hermes desktopfix (#39032) and the shell installer path; Windows counterpart of #39127. Part of #37544.Root cause
A partial Electron download resumed into the same file leaves concatenated junk in
%LOCALAPPDATA%\electron\Cache.app-builder unpack-electronthen extracts a tree missing theelectronbinary, so the finalelectron→Hermesrename dies withENOENT— and every re-run reuses the poisoned cache forever.Install-Desktoppreviously justthrowd with no recovery.Changes
scripts/install.ps1: newClear-ElectronBuildCachehelper — removes cachedelectron-*.zip(loose copy +@electron/gethash-subdir copy) honoringelectron_config_cache/ELECTRON_CACHE/%LOCALAPPDATA%, plus stale*-unpackedoutput dirs. Onpackfailure, purge and retry once; if nothing was purged, fall through to the existing throw unchanged. No self-rolled zip validator —@electron/getre-downloads with its own SHASUM verification.scripts/release.py: AUTHOR_MAP entry for the contributor (CI gate).Validation
ParseFile(whole file)Clear-ElectronBuildCachefunctional test (real pwsh, planted fixtures)*-unpackeddirs; leavesSHASUMS256.txtand non-unpacked dirs; idempotent + no-throw on empty re-runFaithful PowerShell mirror of the tested shell logic (#39032 merged, #39127 open).
Closes #39134. Original PR authored by @youngstar-eth.
Infographic