Skip to content

fix: add 32-bit Linux (ia32 + armv7l) prebuilds#7

Merged
dsanders11 merged 2 commits into
mainfrom
claude/slack-session-gdzqcy
Jun 12, 2026
Merged

fix: add 32-bit Linux (ia32 + armv7l) prebuilds#7
dsanders11 merged 2 commits into
mainfrom
claude/slack-session-gdzqcy

Conversation

@MarshallOfSound

@MarshallOfSound MarshallOfSound commented Jun 11, 2026

Copy link
Copy Markdown
Member

Old release lines (notably Electron's armv7l builds) still install @electron-internal/extract-zip, but no 32-bit prebuild was being shipped, so it failed to load on 32-bit Linux. Add cross-compiled prebuilds for both 32-bit Linux targets:

  • i686-unknown-linux-gnu (linux/ia32) via gcc-multilib
  • armv7-unknown-linux-gnueabihf (linux/arm) via napi's --use-napi-cross

Both run in the shared CI build matrix (reused by the Release workflow via workflow_call) and are flagged cross: true so the smoke-test step is skipped — there are no native 32-bit runners and the host's 64-bit node can't load a 32-bit .node.

napi's generated loader has no process.arch === 'ia32' branch under Linux, so strip-binding-fallbacks.js now also splices that branch in; otherwise the ia32 prebuild would be unreachable. package.json targets and the check-prebuilds publish gate are updated to match.

Fixes #6
Refs electron/electron#51963

Old release lines (notably Electron's armv7l builds) still install
@electron-internal/extract-zip, but no 32-bit prebuild was being shipped,
so it failed to load on 32-bit Linux. Add cross-compiled prebuilds for
both 32-bit Linux targets:

- i686-unknown-linux-gnu (linux/ia32) via gcc-multilib
- armv7-unknown-linux-gnueabihf (linux/arm) via napi's --use-napi-cross

Both run in the shared CI build matrix (reused by the Release workflow via
workflow_call) and are flagged `cross: true` so the smoke-test step is
skipped — there are no native 32-bit runners and the host's 64-bit node
can't load a 32-bit .node.

napi's generated loader has no `process.arch === 'ia32'` branch under
Linux, so strip-binding-fallbacks.js now also splices that branch in;
otherwise the ia32 prebuild would be unreachable. package.json targets
and the check-prebuilds publish gate are updated to match.
@MarshallOfSound MarshallOfSound requested a review from a team as a code owner June 11, 2026 22:32
Comment thread scripts/strip-binding-fallbacks.js Outdated
Comment on lines +30 to +51
// ── 2) Inject the linux/ia32 branch ───────────────────────────────────────
const ia32Marker = "require('./index.linux-ia32-gnu.node')";
if (src.includes(ia32Marker)) {
console.log('strip-binding-fallbacks: linux/ia32 branch already present');
} else {
// Anchor on the Linux-specific "unsupported arch" else; insert before it.
const anchor =
' } else {\n loadErrors.push(new Error(`Unsupported architecture on Linux:';
if (!src.includes(anchor)) {
console.error('strip-binding-fallbacks: linux unsupported-arch anchor not found — generator output changed?');
process.exit(1);
}
const ia32Branch =
" } else if (process.arch === 'ia32') {\n" +
' try {\n' +
` return ${ia32Marker}\n` +
' } catch (e) {\n' +
' loadErrors.push(e)\n' +
' }\n';
src = src.replace(anchor, ia32Branch + anchor);
console.log('strip-binding-fallbacks: added linux/ia32 branch to binding.js');
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be more maintainable as a patch to @napi-rs/cli, since Yarn v4 makes it easy enough to patch dependencies.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call — done in 923fc8a. Patched @napi-rs/cli's loader template via Yarn's patch protocol so napi now emits the process.arch === 'ia32' Linux branch natively (consistent with every other arch, fallback and all), and reverted strip-binding-fallbacks.js back to its original single responsibility. The @electron-internal fallback that the patched branch generates is still stripped by the existing step.


Generated by Claude Code

Address review feedback: instead of splicing the missing 32-bit x86 Linux
branch into the generated binding.js from strip-binding-fallbacks.js, patch
@napi-rs/cli's loader template directly (via Yarn's patch protocol) so napi
emits the `process.arch === 'ia32'` branch natively, consistent with every
other arch (including its @electron-internal fallback, which the existing
strip step then removes).

strip-binding-fallbacks.js is reverted to its original single responsibility.
@nikwen

nikwen commented Jun 11, 2026

Copy link
Copy Markdown
Member

Can we add the following to the PR description?

Fixes #6
Refs electron/electron#51963

@erickzhao

Copy link
Copy Markdown
Member

Done!

@dsanders11 dsanders11 changed the title ci: add 32-bit Linux (ia32 + armv7l) prebuilds fix: add 32-bit Linux (ia32 + armv7l) prebuilds Jun 12, 2026
@dsanders11

Copy link
Copy Markdown
Member

Changing this from ci: to fix: for the semantic prefix so it'll trigger a release.

@dsanders11 dsanders11 merged commit f4a8781 into main Jun 12, 2026
20 checks passed
@dsanders11 dsanders11 deleted the claude/slack-session-gdzqcy branch June 12, 2026 04:01
@electron-npm-package-publisher

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide Linux 32-bit binaries (armv7l)

5 participants