Comments (14)
I just tested for my project and it worked! The only problem I encountered is that cp38 is cumbersome due to some implementation details, use cp39 and above.
from cibuildwheel.
Though if you pin an old version, it might not have AS wheels:
Again, scikit-build-core does all this for you, also the
py2.py3
tags are just a setting, etc.
ninja 1.10.2.2 has a wheel with arm64/universal2 tags. I have this issue in the backlog to try switching to scikit-build-core. It would be great to get rid of the setup.py file eventually.
from cibuildwheel.
I have no problem with arm64
. However, I don't know how to test universal2
for both architectures.
from cibuildwheel.
I believe I'm currently building x86_64, arm64, and universal2 for Mac with no issue.
It was literally 1 line of code, setting env var CIBW_ARCH=all
. (Admittedly, this is probably overbuilding; I don't know who actually needs the "fat binaries" when they could just get the AMD64 or ARM build as appropriate, but it's still looking nice...)
*The run I linked is overall "failed" due to issues with delvewheel and Windows cross-compilation, but ignore that; as you can see, the specific job for Mac was an unqualified success!
from cibuildwheel.
It appears to work out of the box, at least on the cibuildwheel side. The only change I made is changing the OS for the macOS builds to use macos-14
in my GHA workflow, and then it built the x86_64, arm64, and universal2 wheels.
Even better, it ran the test-command
defined in pyproject.toml for all the architectures in all the wheels. It used arch -x86_64
to test the x86_64 wheel, and the x86_64 portion of the universal2 wheel, and ran the tests for the universal2 wheel a second time to test the arm64 portion.
Here's the changes I had to make -- most of the issues were due to a lack of pipx in the new macos arm64 images, and trouble installing ninja as part of pyproject.toml/cibuildwheel: https://github.com/nightlark/swig-pypi/pull/117/files
from cibuildwheel.
Was pip install ninja
not working? We make universal wheels and I've checked them once in the past. (I also maintain that)
Scikit-build-core automatically adds ninja as a dependency only if it's not present, by the way.
from cibuildwheel.
However, I don't know how to test universal2 for both architectures
Just don't skip the tests. cibuildwheel will test everything it can.
(We've had AS building on CirrusCI for a bit, so not surprised if it's working fairly well out of the box on GHA)
from cibuildwheel.
Though if you pin an old version, it might not have AS wheels:
Again, scikit-build-core does all this for you, also the py2.py3
tags are just a setting, etc.
from cibuildwheel.
I got an architecture error from NumPy when testing the arm64
part of universal2
: (GitHub Actions log)
File "/private/var/folders/1k/qq3pcbf12vb6vyblh81736p40000gn/T/cibw-run-sejyakil/cp39-macosx_universal2/venv-test/lib/python3.9/site-packages/numpy/core/overrides.py", line 8, in <module>
from numpy.core._multiarray_umath import (
ImportError: dlopen(/private/var/folders/1k/qq3pcbf12vb6vyblh81736p40000gn/T/cibw-run-sejyakil/cp39-macosx_universal2/venv-test/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so, 0x0002): tried: '/private/var/folders/1k/qq3pcbf12vb6vyblh81736p40000gn/T/cibw-run-sejyakil/cp39-macosx_universal2/venv-test/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/private/var/folders/1k/qq3pcbf12vb6vyblh81736p40000gn/T/cibw-run-sejyakil/cp39-macosx_universal2/venv-test/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so' (no such file), '/private/var/folders/1k/qq3pcbf12vb6vyblh81736p40000gn/T/cibw-run-sejyakil/cp39-macosx_universal2/venv-test/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
It seems that pip used the same virtual environment for x86_64
and arm64
when testing universal2
. Pip first installed x86_64
NumPy. Then, when pip installed arm64
NumPy, it said Requirement already satisfied
and left the x86_64
NumPy in the environment...
from cibuildwheel.
Was
pip install ninja
not working? We make universal wheels and I've checked them once in the past. (I also maintain that)Scikit-build-core automatically adds ninja as a dependency only if it's not present, by the way.
The pip(x) install ninja was working, but the location it installed to wasn’t in the macOS PATH so no ninja command was found. I tried pipx ensurepath in a few places, but the PATH changes didn’t seem to get propagated to the steps that actually needed ninja.
I think the issue you opened about pipx in the GHA runner images repo would be the “best” place to fix it.
from cibuildwheel.
Okay, happy as long as it's not an issue with the ninja
package that I need to fix. :) Yeah, not having pipx is a huge downgrade.
It seems that pip used the same virtual environment for x86_64 and arm64 when testing universal2
We should probably investigate making two environments instead of one.
from cibuildwheel.
Related Issues (20)
- "symbol not found" in MacOS arm64 wheels for C-extension dependent on NumPy HOT 2
- Sporadic timeouts in oci_container.py HOT 1
- Troubleshooting Python 3.12 uWSGI wheel HOT 16
- Note about `actions/upload-artifact@v4` HOT 25
- Feature Request: flag to skip build if there is not a numpy wheel available HOT 2
- Access environment variables in config-settings
- No build identifiers selected, even though build_config is cp312-* HOT 2
- [FR] Make it easier to run `cibuildwheel` against unlisted Python builds HOT 7
- Cross compilation yields x86-64 wheel HOT 1
- Failure on ubuntu22.04: sizeof(Big Struct) differs between binary wheel and local "pip install" HOT 1
- Ubuntu: ABI difference between pip install (SYSV) and cibuildwheel (GNU/Linux)? HOT 4
- How to cross-compile dylib on macos? HOT 4
- Multi-line test commands can spuriously pass HOT 4
- Update PyPy to 7.3.15 HOT 7
- GitHub Actions Windows: Invalid --only='""' (fixed in 2.16.5) HOT 6
- Transient failures for Windows AMD64 builds when searching for `pyproject.toml` HOT 10
- Uninformative error message - Issue with Windows Build HOT 3
- Allow copying artifacts to `/output` in case of test failure on docker
- Conan package builds HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cibuildwheel.