Visitar URL original
fix: add Electron 44 version gates for win32/ia32 and linux/armv7l by claude[bot] · Pull Request #1935 · electron/packager · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ Electron Packager is known to run on the following **host** platforms:

It generates executables/bundles for the following **target** platforms:

- Windows (also known as `win32`, for x86, x86_64, and arm64 architectures)
- Windows (also known as `win32`, for x86[^ia32], x86_64, and arm64 architectures)
- macOS (also known as `darwin`) / [Mac App Store](https://electronjs.org/docs/tutorial/mac-app-store-submission-guide/) (also known as `mas`)<sup>\*</sup> (for x86_64, arm64, and universal architectures)
- Linux (for x86, x86_64, armv7l, arm64, and mips64el architectures)
- Linux (for x86, x86_64, armv7l[^ia32], arm64, and mips64el architectures)

<sup>*</sup> *Note for macOS / Mac App Store target bundles: the `.app` bundle can only be signed when building on a host macOS platform.\*

[^ia32]: Windows x86 (`ia32`) and Linux `armv7l` builds are only published for Electron <= 43 — starting with Electron 44.0.0-alpha.4, official builds for these architectures are no longer provided.

## Installation

This module requires Node.js 22.12.0 or higher to run.
Expand Down
2 changes: 2 additions & 0 deletions src/targets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const buildVersions = {
},
linux: {
arm64: '>= 1.8.0',
armv7l: '<44.0.0-alpha.4',
ia32: '<19.0.0-beta.1',
mips64el: '^1.8.2-beta.5',
},
Expand All @@ -44,6 +45,7 @@ const buildVersions = {
},
win32: {
arm64: '>= 6.0.8',
ia32: '<44.0.0-alpha.4',
},
} as Record<SupportedPlatform, Record<SupportedArch, string>>;

Expand Down
56 changes: 56 additions & 0 deletions test/targets.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,32 @@ describe('allOfficialArchsForPlatformAndVersion', () => {
const result2 = allOfficialArchsForPlatformAndVersion('mas', '10.0.0');
expect(result2).not.toContain('arm64');
});

it('supports win32/ia32 for the correct versions', () => {
const result = allOfficialArchsForPlatformAndVersion('win32', '43.0.0');
expect(result).toContain('ia32');
const result2 = allOfficialArchsForPlatformAndVersion('win32', '44.0.0-alpha.3');
expect(result2).toContain('ia32');
const result3 = allOfficialArchsForPlatformAndVersion('win32', '44.0.0-alpha.4');
expect(result3).not.toContain('ia32');
const result4 = allOfficialArchsForPlatformAndVersion('win32', '44.0.0');
expect(result4).not.toContain('ia32');
const result5 = allOfficialArchsForPlatformAndVersion('win32', '45.0.0-nightly.20260714');
expect(result5).not.toContain('ia32');
});

it('supports linux/armv7l for the correct versions', () => {
const result = allOfficialArchsForPlatformAndVersion('linux', '43.0.0');
expect(result).toContain('armv7l');
const result2 = allOfficialArchsForPlatformAndVersion('linux', '44.0.0-alpha.3');
expect(result2).toContain('armv7l');
const result3 = allOfficialArchsForPlatformAndVersion('linux', '44.0.0-alpha.4');
expect(result3).not.toContain('armv7l');
const result4 = allOfficialArchsForPlatformAndVersion('linux', '44.0.0');
expect(result4).not.toContain('armv7l');
const result5 = allOfficialArchsForPlatformAndVersion('linux', '45.0.0-nightly.20260714');
expect(result5).not.toContain('armv7l');
});
});

describe('validateListFromOptions', () => {
Expand Down Expand Up @@ -106,6 +132,36 @@ describe('createPlatformArchPairs', () => {
extraOpts: { platform: 'linux', arch: 'all' },
expectedLength: 3,
},
{
testCase: 'all win32 arches in a version without ia32 support',
extraOpts: { platform: 'win32', arch: 'all', electronVersion: '44.0.0-alpha.4' },
expectedLength: 2,
},
{
testCase: 'all linux arches in a version without ia32, armv7l, or mips64el support',
extraOpts: { platform: 'linux', arch: 'all', electronVersion: '45.0.0-nightly.20260714' },
expectedLength: 2,
},
{
testCase: 'win32/ia32 in the last version that supports it',
extraOpts: { platform: 'win32', arch: 'ia32', electronVersion: '44.0.0-alpha.3' },
expectedLength: 1,
},
{
testCase: 'win32/ia32 in a version that no longer supports it',
extraOpts: { platform: 'win32', arch: 'ia32', electronVersion: '44.0.0-alpha.4' },
expectedLength: 0,
},
{
testCase: 'linux/armv7l in the last version that supports it',
extraOpts: { platform: 'linux', arch: 'armv7l', electronVersion: '44.0.0-alpha.3' },
expectedLength: 1,
},
{
testCase: 'linux/armv7l in a version that no longer supports it',
extraOpts: { platform: 'linux', arch: 'armv7l', electronVersion: '45.0.0-nightly.20260714' },
expectedLength: 0,
},
{
testCase: 'platform/arch combinations (arrays)',
extraOpts: { platform: ['darwin', 'win32'], arch: ['arm64', 'x64'] },
Expand Down
Loading