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

ruckig pypi package for macos mislabeled as universal2 #175

Closed
hashb opened this issue Dec 27, 2023 · 1 comment
Closed

ruckig pypi package for macos mislabeled as universal2 #175

hashb opened this issue Dec 27, 2023 · 1 comment

Comments

@hashb
Copy link

hashb commented Dec 27, 2023

tl,dr: ruckig macos binaries uploaded to pypi are mislabeled as universal2 and do not work on M1 macs

I recently ran into issues when trying to use python 3.11 pypi package of ruckig.

$ python 01_position.py      main?
Traceback (most recent call last):
  File "/Users/<path>/ruckig/examples/01_position.py", line 3, in <module>
    from ruckig import InputParameter, OutputParameter, Result, Ruckig
ImportError: dlopen(/Users/<path>/lib/python3.11/site-packages/ruckig.cpython-311-darwin.so, 0x0002): tried: '/Users/<path>/lib/python3.11/site-packages/ruckig.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/<path>/lib/python3.11/site-packages/ruckig.cpython-311-darwin.so' (no such file), '/Users/<path>/lib/python3.11/site-packages/ruckig.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

I did a bit of digging into the pypi package ruckig-0.9.2-cp311-cp311-macosx_12_0_universal2.whl and it turns out it is not a real universal2 binary.

This is the output I get when I try to check the shared object's arch

$ file -b ruckig.cpython-311-darwin.so 
Mach-O 64-bit bundle x86_64

What the expected output of a universal binary should look like

$ file -b _sodium.abi3.so 
Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit bundle x86_64] [arm64:Mach-O 64-bit bundle arm64]
_sodium.abi3.so (for architecture x86_64):	Mach-O 64-bit bundle x86_64
_sodium.abi3.so (for architecture arm64):	Mach-O 64-bit bundle arm64

based on this post https://stackoverflow.com/a/65811061, I added "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64", to setup.py and was able to build universal binaries.

$ file -b ruckig.cpython-311-darwin.so                                                                                                                                                  main!?
Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit bundle x86_64] [arm64:Mach-O 64-bit bundle arm64]
ruckig.cpython-311-darwin.so (for architecture x86_64):	Mach-O 64-bit bundle x86_64
ruckig.cpython-311-darwin.so (for architecture arm64):	Mach-O 64-bit bundle arm64

related upstream issue pypa/wheel#406

@pantor
Copy link
Owner

pantor commented Jan 9, 2024

Thanks for pointing this out! I've reworked the complete Python wheel pipeline (now using scikit-build-core), and this should be fixed now.

@pantor pantor closed this as completed Jan 9, 2024
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

Successfully merging a pull request may close this issue.

2 participants