Repository navigation
fix(desktop): never fail the Windows build on NSIS stage cleanup - #438
Conversation
Windows can still hold a handle on the uninstaller generator exe right after it runs (AV scan, process teardown), so the stage-dir rmSync in buildWindowsUninstaller failed with EPERM on the v0.0.25 release run. Node's rmSync only retries EPERM/EBUSY/ENOTEMPTY when maxRetries is set, so every NSIS stage-dir removal now passes maxRetries: 10, retryDelay: 250. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The v0.0.25 release failed twice, deterministically, with EPERM when the finally block removed out/.nsis-uninst/.nsis-uninst-stage right after uninst-gen.exe exited. The stage dir is outside appPath and nothing reads it later (package-windows.ts and the workflow use only the exact Uninstall.exe path), so after the retries a remaining handle only warns. The pre-clean before each build stays strict. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Problem
The v0.0.25 Desktop Release (run 46222864673) failed in
Package Windows ARM64on both attempts with the same error:The two-pass NSIS signing code from #432 never ran in a desktop release before v0.0.25. The
finallyblock removes the stage dir about 1 s afteruninst-gen.exeexits, and Windows still holds a handle on that freshly written and executed exe.npm 0.0.25 is published; only the desktop installers are blocked.
Fix
rmSyncgetsmaxRetries: 10, retryDelay: 250(about 14 s with linear back-off). Node retriesEPERM/EBUSYonly withmaxRetries.finallyblocks, a handle that outlives the retries only warns. The stage dir is outsideappPath, and later steps use only the exactUninstall.exepath (package-windows.ts:303-325,desktop-release.yml:360-367), so a leftover dir is never packaged or signed.Verification
windows-nsis.test.ts: 11 passed. Typecheck and format are clean.desktop-releaseenvironment (onlymainandv*), so a branch dry run cannot run it. After merge, I will dispatch a desktop dry run frommain(dry_run=true,sign_windows=false) to prove the Windows packaging, then cut 0.0.26.🤖 Generated with Claude Code