-
Notifications
You must be signed in to change notification settings - Fork 239
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
it's almost always a mistake to build arm64/x86_64 wheels on macOS; warn about it? #1333
Comments
Some past discussion here: #1204 (including a related discussion on numpy repository) |
This is not clear-cut. The best/simplest thing really is to build separate wheels, then combine them later. Except there's not a good tool for combining them right now and it's pretty manual - multi build had scripts to do it. And you might ideally want to build the ARM on ARM and Intel on Intel, so you'd not even be in a cibuildwheel run when you want to combine them. Universal are harder to build, since you have to have all universal dependencies and libraries. You can't just brew install libs for a universal build. They also ideally need to be re-tagged, as only pip from the last year or so can install them unless you add the x86 / arm tags too. For simple builds, this is probably the way to go (with the retagging), but it's by no means the "only" way to go. I've been trying to get a way to add tags into |
Yes, I agree. If you have a specific need for universal2 wheels and a project doesn't make them available, please look into delocate-fuse. |
I was definitely mistaken about the level of subtlety here, but I do think that in a lot of cases, universal2 "just works" and in those cases it would be best to recommend it strongly, with a clear fallback for the cases where it's more complex. In the cases where it is possible to build a
Yes, but you also really shouldn't be
Homebrew binaries are for distributing within Homebrew itself, not for redistributing as apps or as other binary artifacts such as wheels. I know how convenient it can be to use them this way (and I've certainly availed myself of this somewhat risky convenience in the past) but very basic features for redistribution are missing, like e.g. pinning versions of the lib within homebrew so as to ensure a consistent build process; homebrew wants to update itself very aggressively, and generally can't be downgraded again if something breaks. There's something to be said for that as a philosophy for tooling (and I'm generally in favor) but not as a build environment for redistributables.
Is there really any reason to be using a I don't want to make people's lives difficult but in the absence of any specific difficulty I think it's good not to normalize living on years-out-of-date software, particularly for security-critical portions of the stack like what |
There are a lot of wheels downloaded each day. So I would be against changing the default or throwing a warning, but improved documentation stating the advantages and disadvantages of both options could be useful. |
Thanks for Homebrew maintainer quote, it's good to have something definitive on that topic.
I don't know, perhaps there are a couple causes (e.g. the bundled pip when doing (From the stats spreadsheet) But, I do agree that because the solution The packager burden is the main reason I think native wheels are the default. For some libraries, that compilation is made harder by the added cross-compilation step. When it works, it's easy, but when it doesn't it's a lot harder. Universal2 requires each dependency of libraries to also be universal2, adding more work to packagers. In particular, basically no scientific users of Python use universal2, because they all depend on numpy and they don't distribute a universal2 wheel.
As you say, it's not clear-cut. But ultimately, the loudest cry for universal2 comes from people that want to distribute macOS apps, and delocate-fuse exists for that use-case now. I will also say that since we've already discussed this in #1204 and released arm64 support with this feature, we unlikely to change it unless there's a very strong community push for universal2. |
We already have some info in this section of the docs - happy to look at PRs improving / adding more nuance here. |
You really should never use You can also install this in your user directory, which is a little ugly IMO, but a pretty reasonable middle ground especially for something like pip - and newer versions of pip automatically switch to the user directory if they can't write to the system packages (not sure about upgrades, but I think it applies there too). Doesn't help if you are upgrading from an older pip, though. |
You never should do this. Otherwise, platform tag will be broken. |
That is a pain, but I'd say disk and download space are reason number 1. The way By design,
There is now also freely available M1 CI (Cirrus CI), so folks will more and more build x86-64 wheels on GitHub Actions and M1 wheels on Cirrus CI. Fusing should be done in It looks to me like the status quo is fine, and this issue can be closed. |
xref the NumPy discussion of this topic, which came down on the side of separate wheels: numpy/numpy#18143 |
- Remove the macOS architecture override in pyproject.toml. I completely forgot about that and couldn't understand why I'm building universals and not testing arm64 on macos-14. As the XXX hoped for, we now have M1 runners, so keep it simple. As discussed in pypa/cibuildwheel#1333, rather do native builds (and tests) instead of universal wheels. - The setup-python action only gained arm64 support from version 3.10.11 onwards, so only test macos-14 on Python 3.10 to 3.12. Add macos-13 to test the earlier versions on x86_64. - Restore the sdist formula to the sanctioned cibuildwheel example. - Shorten wheel job names to see what's going on on the Actions tab, and remove duplicate "macos" from the macOS wheel artifact names.
Description
As shown in hhas/appscript#5, sometimes maintainers who are trying to update to the Apple Silicon transition will want to build wheels for arm64. The obvious way to do that is to add 'arm64' to their
CIBW_ARCHS_MACOS
and start testing in an arm64 environment, as one would on (e.g.) any Linux distro.This is almost always a configuration error, and building
universal2
wheels is the right thing to do. Of course it's possible that in some expert cases one might literally want separate wheels, but distributing architecture-specific wheels makes it a lot tougher for users who want to just use a library in an app built for most macs.Build log
No response
CI config
No response
The text was updated successfully, but these errors were encountered: