Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Jun 25, 2023

Conversation

koush
Copy link
Contributor

@koush koush commented Jan 31, 2023

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

One of my dependencies for some reason has two 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.

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

CAFEBABE and FEEDFACE magics for universal binaries. This will allow packaging to continue if both the arm and x64 packages have universal binaries.
@koush koush requested a review from a team as a code owner January 31, 2023 07:46
@koush
Copy link
Contributor Author

koush commented Jan 31, 2023

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.

@erickzhao erickzhao changed the title arm64/x64 inputs may contain universal binaries that are not the same fix: arm64/x64 inputs may contain universal binaries that are not the same Jan 31, 2023
@aprilandjan
Copy link

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

@MarshallOfSound MarshallOfSound merged commit fddff57 into electron:main Jun 25, 2023
@continuous-auth
Copy link

🎉 This PR is included in version 1.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants