Skip to content

Commit f248a3a

Browse files
committed
Probably fix macOS 11 legacy build
1 parent 050fbb8 commit f248a3a

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

release-automation/build.mjs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,17 @@ const afterPack = async (context) => {
158158
recursivelySetFileTimes(context.appOutDir, sourceDateEpoch);
159159
};
160160

161+
const afterPackForUniversalMac = async (context) => {
162+
// For universal binaries on macOS, we should only need to apply fuses at the end of the build,
163+
// not on each child build that happens for Intel and ARM.
164+
// https://github.com/electron-userland/electron-builder/issues/6365#issuecomment-1191747089
165+
if (context.arch === Arch.universal) {
166+
await flipFuses(context);
167+
}
168+
169+
recursivelySetFileTimes(context.appOutDir, sourceDateEpoch);
170+
};
171+
161172
const afterSign = async (context) => {
162173
// Ensure that modification times are still reproducible after signing and resource
163174
// editing.
@@ -200,7 +211,7 @@ const build = async ({
200211
tw_warn_legacy: isProduction,
201212
tw_update: isProduction && manageUpdates
202213
},
203-
afterPack,
214+
afterPack: arch === Arch.universal ? afterPackForUniversalMac : afterPack,
204215
afterSign,
205216
...extraConfig,
206217
...await prepare(archName)
@@ -260,16 +271,7 @@ const buildMicrosoftStore = () => build({
260271
const buildMac = () => build({
261272
platformName: 'MAC',
262273
platformType: 'dmg',
263-
manageUpdates: true,
264-
extraConfig: {
265-
afterPack: async (context) => {
266-
// For non-legacy macOS we should only need to apply fuses on the universal build at the end
267-
// https://github.com/electron-userland/electron-builder/issues/6365#issuecomment-1191747089
268-
if (context.arch === Arch.universal) {
269-
await afterPack(context);
270-
}
271-
}
272-
}
274+
manageUpdates: true
273275
});
274276

275277
const buildMacLegacy10131014 = () => build({

0 commit comments

Comments
 (0)