🐛 fix(ci): Use isolated electron-builder installation to bypass workspace resolution#154
Merged
trickpatty merged 4 commits intomainfrom Jan 25, 2026
Merged
Conversation
…tion Root cause: GitHub Actions npm cache can corrupt or incompletely cache large binary packages like app-builder-bin (~50MB). When npm ci restores from this corrupted cache, the binaries are missing or incomplete. Evidence: - macOS builds failed at verification (binary didn't exist) - Linux/Windows passed verification but failed at build (corrupted binaries) - npm rebuild doesn't help because app-builder-bin has no build scripts Solution: Remove npm caching for the four electron build jobs (Linux, Windows, macOS Intel, macOS ARM). These jobs run infrequently (only on push to main or releases), so the performance impact is minimal. The build-and-test and security-audit jobs keep npm caching since they don't use electron-builder.
npm ci sometimes fails to extract large binary files from packages like app-builder-bin (~50MB). This fix adds a verification step that: 1. Checks if the platform-specific binary exists after npm ci 2. If missing, manually downloads and extracts the package using npm pack 3. Sets execute permissions on the binary This approach bypasses any npm extraction issues by using npm pack + tar which is more reliable for packages containing large binary files. Platform-specific binary paths: - Linux: linux/x64/app-builder - Windows: win/x64/app-builder.exe - macOS Intel: mac/app-builder_amd64 - macOS ARM: mac/app-builder_arm64
…pace resolution The previous fix attempts to verify/extract app-builder-bin didn't work because electron-builder's module resolution in npm workspaces context is fundamentally broken - even when binaries exist, it can't find them. This fix takes a completely different approach: - Install electron-builder in an isolated temp directory (/tmp/eb-tools or C:\eb-tools) - This isolated installation has its own node_modules with app-builder-bin properly installed - Run electron-builder from the isolated location, completely bypassing workspace hoisting - The isolated electron-builder will correctly resolve all its dependencies This approach works because: 1. No npm workspaces involved in the isolated installation 2. electron-builder's module resolution works correctly in a standard node_modules structure 3. The binary is guaranteed to be in the expected location relative to electron-builder
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
Problem
The Electron CI builds have been failing consistently across all platforms (Linux, Windows, macOS Intel, macOS ARM) with the same error:
Previous fix attempts included:
None of these worked because the fundamental issue is how electron-builder resolves app-builder-bin in an npm workspaces context - the module resolution is broken even when the binary exists at the expected path.
Solution
This PR takes a completely different approach:
/tmp/eb-toolson Unix,C:\eb-toolson Windows)This works because:
Test plan