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

Python universal fat binary >= 1.17.1? #133

Open
walt-jones opened this issue Oct 10, 2024 · 2 comments
Open

Python universal fat binary >= 1.17.1? #133

walt-jones opened this issue Oct 10, 2024 · 2 comments

Comments

@walt-jones
Copy link

We're trying to compile a universal2 executable and have been unable to find/install a fat binary for cffi. arch -x86_64 -arm64 pip3 install cffi still gives us separate architectures so files and Pyinstaller builds fail with a IncompatibleBinaryArchError error on /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/_cffi_backend.cpython-312-darwin.so. Any way to get a fat binary of cffi for MacOS?

@mattip
Copy link
Contributor

mattip commented Oct 10, 2024

There is some discussion of the pros and cons of universal2 wheels for extension modules here. CFFI itself comes only in either arm64 or x86_64 variants, there is no universal2 wheel. You can use arch -x86_64 python -m pip to force a x86_64 installation on a universal2 python, then be sure to use that formula for subsequent invocations.

For building your software, I think the recommended way to do this, if you really want, is to us cibuildwheel (for a python extension module) or lipo for executables.

@walt-jones
Copy link
Author

Thanks Matti. We were able to use lipo to combine architectures into a single .so and that satisfied Pyinstaller's requirements for fat binary.

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

No branches or pull requests

2 participants