4 Commits

Author SHA1 Message Date
Samuel Attard
57201b124c chore: fix lint 2023-11-20 17:02:16 -08:00
Jake
20b1b02c11 fix: ignore differences caused by merged machO files (#66)
* Ignore differences caused by merged machO files

* Fix filter indent

* Fix types & Fix error caught by type check
2023-11-20 16:59:14 -08:00
Samuel Attard
b6f0c88db4 feat: bump minimum node version to 16 and add tests (#86)
BREAKING CHANGE: Minimum node version is now 16
2023-11-09 11:08:39 -08:00
Samuel Attard
bb304ce10b fix: Revert "feat: bump minimum node version to 16 and add tests (#86)"
This reverts commit 8e2842b4a3.
2023-11-09 11:08:16 -08:00

View File

@@ -133,7 +133,7 @@ export const makeUniversalApp = async (opts: MakeUniversalOpts): Promise<void> =
);
}
}
const knownMergedMachOFiles = new Set();
for (const machOFile of x64Files.filter((f) => f.type === AppFileType.MACHO)) {
const first = await fs.realpath(path.resolve(tmpApp, machOFile.relativePath));
const second = await fs.realpath(path.resolve(opts.arm64AppPath, machOFile.relativePath));
@@ -170,6 +170,7 @@ export const makeUniversalApp = async (opts: MakeUniversalOpts): Promise<void> =
'-output',
await fs.realpath(path.resolve(tmpApp, machOFile.relativePath)),
]);
knownMergedMachOFiles.add(machOFile.relativePath);
}
/**
@@ -185,8 +186,18 @@ export const makeUniversalApp = async (opts: MakeUniversalOpts): Promise<void> =
path.resolve(opts.arm64AppPath, 'Contents', 'Resources', 'app'),
{ compareSize: true, compareContent: true },
);
const differences = comparison.diffSet!.filter((difference) => difference.state !== 'equal');
d(`Found ${differences.length} difference(s) between the x64 and arm64 folders`);
const nonMergedDifferences = differences.filter(
(difference) =>
!difference.name1 ||
!knownMergedMachOFiles.has(
path.join('Contents', 'Resources', 'app', difference.relativePath, difference.name1),
),
);
d(`After discluding MachO files merged with lipo ${nonMergedDifferences.length} remain.`);
if (!comparison.same) {
if (nonMergedDifferences.length > 0) {
d('x64 and arm64 app folders are different, creating dynamic entry ASAR');
await fs.move(
path.resolve(tmpApp, 'Contents', 'Resources', 'app'),