Skip to content

Comments

🐛 fix(ci): Use isolated electron-builder installation to bypass workspace resolution#154

Merged
trickpatty merged 4 commits intomainfrom
claude/fix-electron-ci-build-I7DQZ
Jan 25, 2026
Merged

🐛 fix(ci): Use isolated electron-builder installation to bypass workspace resolution#154
trickpatty merged 4 commits intomainfrom
claude/fix-electron-ci-build-I7DQZ

Conversation

@trickpatty
Copy link
Owner

@trickpatty trickpatty commented Jan 24, 2026

Summary

  • Uses isolated electron-builder installation in temp directory to completely bypass npm workspace module resolution issues
  • Fixes persistent ENOENT errors for app-builder-bin binary that could not be resolved by previous attempts

Problem

The Electron CI builds have been failing consistently across all platforms (Linux, Windows, macOS Intel, macOS ARM) with the same error:

spawn …/clients/node_modules/app-builder-bin/…/app-builder ENOENT

Previous fix attempts included:

  1. Adding app-builder-bin as explicit workspace dependency
  2. Verifying/extracting binaries after npm ci
  3. Using npm pack + tar extraction as fallback
  4. Disabling npm cache

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:

  1. Install electron-builder in an isolated temp directory (/tmp/eb-tools on Unix, C:\eb-tools on Windows)
  2. This isolated installation has its own node_modules with app-builder-bin properly installed
  3. Run electron-builder from the isolated location

This works because:

  • No npm workspaces are involved in the isolated installation
  • electron-builder module resolution works correctly in a standard node_modules structure
  • The binary is guaranteed to be in the expected location relative to electron-builder

Test plan

  • Verify Linux build passes in CI
  • Verify Windows build passes in CI
  • Verify macOS Intel build passes in CI
  • Verify macOS ARM build passes in CI

…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
@trickpatty trickpatty changed the title Claude/fix electron ci build i7 dqz 🐛 fix(ci): Use isolated electron-builder installation to bypass workspace resolution Jan 24, 2026
@trickpatty trickpatty merged commit 190de3d into main Jan 25, 2026
12 checks passed
@trickpatty trickpatty deleted the claude/fix-electron-ci-build-I7DQZ branch January 25, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants