From 63b93973f17ddafa3b77c1d24ea08ad523dcb514 Mon Sep 17 00:00:00 2001 From: Andrew Beyer Date: Wed, 28 Apr 2021 21:35:42 -0600 Subject: [PATCH] =?UTF-8?q?fix:=20Don=E2=80=99t=20lipo=20binaries=20that?= =?UTF-8?q?=20are=20already=20a=20universal=20file=20or=20the=20same=20arc?= =?UTF-8?q?h=20#17?= 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,