fix(electron): extract fallback archives with zip extractor on Linux - #525
Conversation
GNU tar cannot unpack Electron's .zip artifacts, so the archive fallback path failed on Linux CI when the primary installer left no runtime binary. Use Electron's bundled @electron-internal/extract-zip helper instead of tar or platform-specific shell extractors. Co-authored-by: Zortos <zortosdev@proton.me>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Capy auto-review is paused for this organization because the usage-cycle auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d1004ef5a4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| shell: false, | ||
| }); | ||
| const electronRequire = createRequire(electronPackageJson); | ||
| const { extract } = await import(pathToFileURL(electronRequire.resolve("@electron-internal/extract-zip")).href); |
There was a problem hiding this comment.
Load a declared zip extractor in fallback
When the installer falls through to the archive fallback, this import is not reliable: Electron 42.3.3 declares extract-zip as its dependency, not @electron-internal/extract-zip, so installs without some unrelated hoisted transitive package throw MODULE_NOT_FOUND here after deleting dist. Even if that internal package is present, it is ESM default-only, so { extract } is undefined and the next line fails. This makes the fallback path unable to recover on the Linux machines it is meant to fix.
Useful? React with 👍 / 👎.
…penCloudGaming#525) Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Summary
Fixes the Electron archive fallback path in
ensure-electron-installed.mjswhen the primary installer exits successfully but leaves no runtime binary.GNU
tarcannot unpack Electron's.zipartifacts on Linux, so the fallback failed exactly in the CI/dev environments it was meant to repair. This change uses Electron's bundled@electron-internal/extract-ziphelper (the same extractor used byelectron/install.js) instead oftaror platform-specific shell extractors.Test plan
node scripts/ensure-electron-installed.mjssucceeds when Electron is already installed@electron-internal/extract-zipresolves and imports from the Electron packagenpm --prefix opennow-stable run typechecknpm --prefix opennow-stable test