fix apple silicon builds [ci build]#8
Conversation
The previous fix for apple silicon builds was not correctly configuring CMake to build for the correct target architecture. The approach implemented here patterns off of that used in [parselmouth](https://github.com/YannickJadoul/Parselmouth/blob/master/.github/workflows/wheels.yml) in which the matrix of build targets is manually configured so that the correct environment variables can be specified at run time. In particular `CMAKE_OSX_ARCHITECTURES` must be set so that CMake builds for the correct architecture. This approach is a little awkward, I would expect CIBuildWheel to be updated so that it can do this for us. As noted by the robust-laplacian package maintainer, other build systems such as scikit-build already do this correctly.
|
woah awesome, thank you! |
|
Hopefully this all works and then we can just accept this change :) I approved the build, I will also push a commit this branch to bump the version number which should make the actual builds run (if I have finally gotten the action configured right) |
|
I couldn't get the push-to-PR-branch thing to work on this PR for some reason, but I just duplicated this in another PR just get the CI to run. It's running in #10. Hopefully all succeeds there and we can just accept this pull. If not, any subsequent pushes you make to this PR should trigger the builds, since it has |
|
Forgot to add: i manually inspected the binaries for 3 of the mac wheels and everything appears to check out $ file robust_laplacian-0.2.3-cp310-cp310-macosx_10_9_universal2/robust_laplacian_bindings.cpython-310-darwin.so
robust_laplacian-0.2.3-cp310-cp310-macosx_10_9_universal2/robust_laplacian_bindings.cpython-310-darwin.so: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit bundle x86_64] [arm64:Mach-O 64-bit bundle arm64]
robust_laplacian-0.2.3-cp310-cp310-macosx_10_9_universal2/robust_laplacian_bindings.cpython-310-darwin.so (for architecture x86_64): Mach-O 64-bit bundle x86_64
robust_laplacian-0.2.3-cp310-cp310-macosx_10_9_universal2/robust_laplacian_bindings.cpython-310-darwin.so (for architecture arm64): Mach-O 64-bit bundle arm64
$ file robust_laplacian-0.2.3-cp310-cp310-macosx_11_0_arm64/robust_laplacian_bindings.cpython-310-darwin.so
robust_laplacian-0.2.3-cp310-cp310-macosx_11_0_arm64/robust_laplacian_bindings.cpython-310-darwin.so: Mach-O 64-bit bundle arm64
$ file robust_laplacian-0.2.3-cp38-cp38-macosx_10_9_x86_64/robust_laplacian_bindings.cpython-38-darwin.so
robust_laplacian-0.2.3-cp38-cp38-macosx_10_9_x86_64/robust_laplacian_bindings.cpython-38-darwin.so: Mach-O 64-bit bundle x86_64 |
|
awesome, everything looks good to go. I will merge and update the public version. thanks again for sorting this out! |
|
When you get a chance, could you confirm that the new public version on pip works for you now? |
|
No problem, happy to help! Just tested locally via |
|
wonderful, thanks! I'm going to mirror this fix in a couple other libraries now. Btw do you a preferred twitter handle or anything? I was gonna tweet about this and give you a shout-out :) Otherwise I'd just use your github handle. |
The previous fix for apple silicon builds was not correctly configuring CMake to build for the correct target architecture. The approach implemented here patterns off of that used in parselmouth in which the matrix of build targets is manually configured so that the correct environment variables can be specified at run time. In particular
CMAKE_OSX_ARCHITECTURESmust be set so that CMake builds for the correct architecture.This approach is a little awkward, I would expect CIBuildWheel to be updated so that it can do this for us. As noted by the robust-laplacian package maintainer, other build systems such as scikit-build already do this correctly.