diff --git a/src/targets.ts b/src/targets.ts index 6410932a..634ee4cf 100644 --- a/src/targets.ts +++ b/src/targets.ts @@ -1,4 +1,4 @@ -import { warning } from './common'; +import { debug, warning } from './common'; import { getHostArch } from '@electron/get'; import semver from 'semver'; import { @@ -68,6 +68,12 @@ export function createPlatformArchPairs( const combinations: Array<[SupportedPlatform, SupportedArch]> = []; for (const arch of selectedArchs) { + if (arch === 'universal' && process.platform !== 'darwin') { + debug( + `Skipping universal arch for ${process.platform} because @electron/universal only works on darwin`, + ); + continue; + } for (const platform of selectedPlatforms) { if (usingOfficialElectronPackages(opts)) { if (!validOfficialPlatformArch(platform, arch)) { diff --git a/test/targets.js b/test/targets.js index d0190c09..6f7f8557 100644 --- a/test/targets.js +++ b/test/targets.js @@ -113,7 +113,9 @@ test( 'build for all available official targets', testMultiTarget( { all: true, electronVersion: config.version }, - util.allPlatformArchCombosCount - 2, + util.allPlatformArchCombosCount - + 2 - + (process.platform === 'darwin' ? 0 : 2), 'Packages should be generated for all possible platforms (except linux/ia32 and linux/mips64el)', ), ); @@ -308,14 +310,17 @@ test( ), ); -test( - 'platform=darwin and arch=universal with a supported official Electron version', - testMultiTarget( - { arch: 'universal', platform: 'darwin' }, - 1, - 'Package should be generated for darwin/universal', - ), -); +if (process.platform === 'darwin') { + test( + 'platform=darwin and arch=universal with a supported official Electron version', + testMultiTarget( + { arch: 'universal', platform: 'darwin' }, + 1, + 'Package should be generated for darwin/universal', + ), + ); +} + test( 'platform=darwin and arch=universal with an unsupported official Electron version', testMultiTarget( @@ -325,14 +330,17 @@ test( ), ); -test( - 'platform=mas and arch=universal with a supported official Electron version', - testMultiTarget( - { arch: 'universal', platform: 'mas' }, - 1, - 'Package should be generated for mas/universal', - ), -); +if (process.platform === 'darwin') { + test( + 'platform=mas and arch=universal with a supported official Electron version', + testMultiTarget( + { arch: 'universal', platform: 'mas' }, + 1, + 'Package should be generated for mas/universal', + ), + ); +} + test( 'platform=mas and arch=universal with an unsupported official Electron version', testMultiTarget(