-
Notifications
You must be signed in to change notification settings - Fork 43
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: Don’t lipo binaries that are already a universal file or the same arch #18
Conversation
…e arch electron#17 Some Mach-O files may have already been fat binaries and will throw an error if lipoed again. Co-authored-by: Mitch Cohen <[email protected]> Co-authored-by: Nick McGuire <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should instead try to determine the arch
of the given file and if it is already universal skip. If both builds contain an x64 binary we should probably error out?
I considered that, and I'd be happy to make that change. However, some folks might want to ship part of their codebase in x64. For example, if they have a stray library that they can't yet build for arm64. That's why we went for a log instead of erroring out. In my experience, I've still seen a stray dylib in x64 even after building for Universal in Xcode. Thoughts? FWIW: it's a an easy process to verify the arch using:
|
@beyera Hm, reasonable point, I'd like to err on the side of highlighting these things to the user somehow though. How about this as a proposal:
That way folks adding x64 only packages without realizing will still get warnings / errors but if they want to bypass that warning for reasons you've outlined above they still can? |
That sounds very reasonable. Thanks for your input. I probably won’t get to it tonight, but I’ll make those changes within the next day or two. Cheers! |
Hey @beyera, it would be great to get this in! |
@MarshallOfSound |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarshallOfSound Please merge this pr
@gaodeng Please do not spam maintainers, my comment above stands and spamming will only annoy me, not make me want to help you. If someone either updates this PR or raises a new one with the changes / modifications that were requested that PR can be considered. Until then there is no action to be taken here. |
@beyera are you able to make the requested changes? This PR would unblock a lot of things for us. |
Implemented in #47 |
Currently, there is no check in place to prevent from attempting to lipo Mach-O files that may have already been by another stage in the build process.
Additionally, we believe there is a use case for having some libraries that can't be run through lipo due to only having an x86_64 version.
This MR adds a check that will prevent lipo from being run on files that are the same and therefore don't have a chance to lipo successfully.
Resolves: #17