From 55ac932c1d5f1e961cea64ec3b4aca19b49ea3cc Mon Sep 17 00:00:00 2001 From: Andrew Beyer Date: Wed, 28 Apr 2021 21:35:42 -0600 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20lipo=20fat=20binaries=20or=20fi?= =?UTF-8?q?les=20that=20are=20the=20same=20arch.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some Mach-O files may have already been fat binaries and will throw an error if lipoed again. Co-authored-by: Mitch Cohen Co-authored-by: Nick McGuire --- src/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/index.ts b/src/index.ts index 91f733b..f18305e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -114,6 +114,17 @@ export const makeUniversalApp = async (opts: MakeUniversalOpts): Promise = 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,