Skip to content

Commit

Permalink
Merge pull request #1 from agilebits/bemini/electron#17-limit-lipo
Browse files Browse the repository at this point in the history
Don’t lipo fat binaries or files that are the same arch.
  • Loading branch information
beyera authored Apr 29, 2021
2 parents b445fa1 + 55ac932 commit a0d7f04
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@ export const makeUniversalApp = async (opts: MakeUniversalOpts): Promise<void> =
const first = await fs.realpath(path.resolve(tmpApp, machOFile.relativePath));
const second = await fs.realpath(path.resolve(opts.arm64AppPath, machOFile.relativePath));

const x64Sha = await sha(path.resolve(opts.x64AppPath, machOFile.relativePath));
const arm64Sha = await sha(path.resolve(opts.arm64AppPath, machOFile.relativePath));
if (x64Sha === arm64Sha) {
d(
'SHA for Mach-O file',
machOFile.relativePath,
`matches across builds ${x64Sha}===${arm64Sha}, skipping lipo`,
);
continue;
}

d('joining two MachO files with lipo', {
first,
second,
Expand Down

0 comments on commit a0d7f04

Please sign in to comment.