Skip to content

Commit f3a56ef

Browse files
authored
feat: electron/universal has a new minimatch option 'x64ArchFiles' (#6913)
* electron/universal has a new minimatch option 'x64ArchFiles' Some projects need to ship x64 binaries which will be run under Rosetta2 on arm64 Macs. This option allows a packager to specify that they're aware that certain files in their distribution which are included in both x64 and arm64 builds are actually x64 binaries in both builds. Without this option, electron/universal will attempt to lipo the two binaries together, resulting in a build failure.
1 parent 0b6db59 commit f3a56ef

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.changeset/famous-cheetahs-run.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"app-builder-lib": minor
3+
---
4+
5+
Expose electron/universal's new "x64ArchFiles" option to allow building universal binaries with single-architecture dependencies

packages/app-builder-lib/src/macPackager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export default class MacPackager extends PlatformPackager<MacConfiguration> {
129129
force: true,
130130
mergeASARs: platformSpecificBuildOptions.mergeASARs ?? true,
131131
singleArchFiles: platformSpecificBuildOptions.singleArchFiles,
132+
x64ArchFiles: platformSpecificBuildOptions.x64ArchFiles,
132133
})
133134
await fs.rm(x64AppOutDir, { recursive: true, force: true })
134135
await fs.rm(arm64AppOutPath, { recursive: true, force: true })

packages/app-builder-lib/src/options/macOptions.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,15 @@ export interface MacConfiguration extends PlatformSpecificBuildOptions {
192192
* only if `mergeASARs` is `true`.
193193
*/
194194
readonly singleArchFiles?: string
195+
196+
/**
197+
* Minimatch pattern of paths that are allowed to be x64 binaries in both
198+
* ASAR files
199+
*
200+
* This option has no effect unless building for "universal" arch and applies
201+
* only if `mergeASARs` is `true`.
202+
*/
203+
readonly x64ArchFiles?: string
195204
}
196205

197206
export interface DmgOptions extends TargetSpecificOptions {

0 commit comments

Comments
 (0)