Skip to content

Commit 38f087e

Browse files
committed
ci: extract Electron with system unzip (extract-zip drops the binary)
The downloaded electron zip is complete and valid (96MB, integrity OK), but electron's postinstall via extract-zip leaves node_modules/electron/dist without the electron binary on this runner, so launch fails. Let install.js fetch the zip into the cache, then extract it with the system unzip and write path.txt. Note: AI-assisted (Claude Code). Diagnosed from CI: zip ZIP_OK + 74 files but dist/electron 'No such file'; extract-zip is the failing step, system unzip is the workaround.
1 parent c5e21af commit 38f087e

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,20 @@ jobs:
3737
# not the `electron` binary), and its postinstall then skips re-extraction
3838
# because path.txt already exists, so launch fails with "Electron failed to
3939
# install correctly". Force a clean download and verify the binary exists.
40-
- name: Install the Electron binary (clean)
41-
env:
42-
DEBUG: '@electron/get:*'
40+
# electron's postinstall (extract-zip) leaves dist without the `electron`
41+
# binary on this runner even though the downloaded zip is complete and
42+
# valid. Let install.js fetch the zip into the cache, then extract it with
43+
# the system `unzip` and point path.txt at the binary.
44+
- name: Install the Electron binary
4345
run: |
44-
set -x
45-
rm -rf node_modules/electron/dist node_modules/electron/path.txt ~/.cache/electron
46-
cat node_modules/electron/package.json | grep '"version"'
47-
node node_modules/electron/install.js; echo "install.js exit=$?"
48-
Z=$(ls ~/.cache/electron/*/*.zip 2>/dev/null | head -1); echo "ZIP=$Z"
49-
ls -la "$Z" 2>&1; du -h "$Z" 2>&1
50-
unzip -t "$Z" >/dev/null 2>&1 && echo "ZIP_OK" || echo "ZIP_CORRUPT"
51-
unzip -l "$Z" 2>&1 | tail -3
52-
test -x node_modules/electron/dist/electron && echo "BINARY OK" || echo "BINARY MISSING"
46+
set -euo pipefail
47+
node node_modules/electron/install.js || true
48+
zip=$(ls ~/.cache/electron/*/electron-*-linux-x64.zip | head -1)
49+
rm -rf node_modules/electron/dist
50+
mkdir -p node_modules/electron/dist
51+
unzip -q -o "$zip" -d node_modules/electron/dist
52+
printf 'electron' > node_modules/electron/path.txt
53+
test -x node_modules/electron/dist/electron
5354
- run: yarn build
5455
# Electron needs system libraries; xvfb provides a display on the headless
5556
# runner. The app launches up to four windows, so a real display beats

0 commit comments

Comments
 (0)