electron / universal

Create Universal macOS applications from two x64 and arm64 Electron applications
MIT License
112 stars 43 forks source link

fix: arm64/x64 inputs may contain universal binaries that are not the same #62

Closed koush closed 1 year ago

koush commented 1 year ago

One of my dependencies for some reason has universal binaries per platform, and they are not exactly the same bytewise. I'm unsure why. But I am certain they are functional.

In any case, this error is erroneously being thrown since it fails the previous byte comparison match.

      throw new Error(`Can't reconcile two non-macho files ${file}`);

CAFEBABE is the magic for universal binaries. This patch also checks to see if both binaries are CAFEBABE. This will allow packaging to continue if both the arm and x64 packages have universal binaries.

https://github.com/apple-opensource-mirror/llvmCore/blob/0c60489d96c87140db9a6a14c6e82b15f5e5d252/include/llvm/Object/MachOFormat.h#L108-L112

koush commented 1 year ago

My actual commit message is incorrect. Feel free to change it or whatever. Just submitted the patch in the GitHub code editor after verifying it by editing the javascript files in my node_modules.

aprilandjan commented 1 year ago

Yeah these is indeed such cases. Hope this could be fixed.

continuous-auth[bot] commented 1 year ago

:tada: This PR is included in version 1.4.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: