Skip to content

fix(desktop): recover from corrupt Electron cache in Windows bootstrap install (salvage #39134) - #39465

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-eba33459
Jun 5, 2026
Merged

fix(desktop): recover from corrupt Electron cache in Windows bootstrap install (salvage #39134)#39465
teknium1 merged 2 commits into
mainfrom
hermes/hermes-eba33459

Conversation

@teknium1

@teknium1 teknium1 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

The Windows installer now self-heals a corrupt Electron download cache instead of hard-failing the desktop build. Mirrors the merged hermes desktop fix (#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-electron then extracts a tree missing the electron binary, so the final electronHermes rename dies with ENOENT — and every re-run reuses the poisoned cache forever. Install-Desktop previously just throwd with no recovery.

Changes

  • scripts/install.ps1: new Clear-ElectronBuildCache helper — removes cached electron-*.zip (loose copy + @electron/get hash-subdir copy) honoring electron_config_cache / ELECTRON_CACHE / %LOCALAPPDATA%, plus stale *-unpacked output dirs. On pack failure, purge and retry once; if nothing was purged, fall through to the existing throw unchanged. No self-rolled zip validator — @electron/get re-downloads with its own SHASUM verification.
  • scripts/release.py: AUTHOR_MAP entry for the contributor (CI gate).

Validation

Check Result
PowerShell 7.4.6 ParseFile (whole file) no syntax errors
Clear-ElectronBuildCache functional test (real pwsh, planted fixtures) removes both zip copies + both *-unpacked dirs; leaves SHASUMS256.txt and non-unpacked dirs; idempotent + no-throw on empty re-run

Faithful PowerShell mirror of the tested shell logic (#39032 merged, #39127 open).

Closes #39134. Original PR authored by @youngstar-eth.

Infographic

desktop-corrupt-electron-cache-self-heal-windows

youngstar-eth and others added 2 commits June 4, 2026 18:35
…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>
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-eba33459 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9841 on HEAD, 9841 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 5103 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists area/config Config system, migrations, profiles labels Jun 5, 2026
@teknium1
teknium1 merged commit facd011 into main Jun 5, 2026
23 checks passed
@teknium1
teknium1 deleted the hermes/hermes-eba33459 branch June 5, 2026 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants