-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
Add support for macOS universal2 wheel #403
Conversation
@@ -193,6 +209,7 @@ impl Target { | |||
(OS::Linux, _) => format!("{}_{}", manylinux, self.arch), | |||
(OS::Macos, Arch::X86_64) => "macosx_10_7_x86_64".to_string(), | |||
(OS::Macos, Arch::AARCH64) => "macosx_11_0_arm64".to_string(), | |||
(OS::Macos, Arch::Universal2) => "macosx_10_9_universal2".to_string(), |
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.
Requires pypa/packaging#380
in the lib section of your Cargo.toml?", | ||
) | ||
})?; | ||
// Use lipo to create an universal dylib |
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.
Currently Cargo does have builtin support creating macOS Universal/fat binaries: rust-lang/cargo#8875
c9534b1
to
93eca28
Compare
I've successfully built https://github.com/messense/murmurhash2-py with this branch, producing an universal2 wheel.
Unpack the ❯ file murmurhash2.abi3.so
murmurhash2.abi3.so: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [arm64:Mach-O 64-bit dynamically linked shared library arm64]
murmurhash2.abi3.so (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
murmurhash2.abi3.so (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64
❯ lipo -info murmurhash2.abi3.so
Architectures in the fat file: murmurhash2.abi3.so are: x86_64 arm64 Unfortunately pip requires pypa/packaging#380 to be able to use ❯ pip3 install murmurhash2-0.2.3-cp36-abi3-macosx_10_9_universal2.whl
ERROR: murmurhash2-0.2.3-cp36-abi3-macosx_10_9_universal2.whl is not a supported wheel on this platform.
❯ pip3 install murmurhash2-0.2.3-cp36-abi3-macosx_11_0_universal2.whl
Processing ./murmurhash2-0.2.3-cp36-abi3-macosx_11_0_universal2.whl
Installing collected packages: murmurhash2
Successfully installed murmurhash2-0.2.3 ❯ python3
Python 3.9.1 (default, Jan 8 2021, 12:11:08)
[Clang 12.0.0 (clang-1200.0.32.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from murmurhash2 import murmurhash2
>>> SEED = 3242157231
>>> print(murmurhash2(b'key', SEED))
970142460 |
Thank you! |
Closes #402