Need orientation on bdist wheels for Mac OS

My current understanding of the Apple ecosystem is:

  • All ppc64 Apple workstations are now long-EOL;
  • Some x86_64 Apple workstations are still in-use by serious Python developers;
  • All new Apple workstations are arm64;
  • There is no easy or unambiguously legal way to build C-extension bdist wheels for any Apple workstation without access to some Apple workstation (whether that be a personally owned device, or one by a cloud CI provider like Github Actions);
  • There may be some kind of tooling available to allow compiling Apple x86_64 bdist wheels on an arm64 Apple workstation;
  • There may be some kind of tooling available to allow compiling Apple arm64 bdist wheels on an x86_64 Apple workstation, but this tooling might go out of service sooner than the other.

I want to get myself set up so I’m not relying on random cloud providers to build binary Python wheels for Mac OS, and I want to spend as little money doing so as possible.

Is there some single piece of hardware I can buy, ideally second-hand, which will give me the ability to DIY compile C-extension bdist wheels reliably for the forseeable future, or is the cross-compilation tooling not expected to be reliably maintained through the future and so I will need to buy at least 2 pieces of hardware?

Or have I mis-understood the whole situation? Is there actually some straightforward way to compile Python bdist wheels for Mac OS on Windows or Linux? Or is the Intel/ARM cross-compilation tooling not reliable, or difficult to integrate with Python build tools?

I don’t know about cross-compiling for macOS, it might be possible but is not supported by Apple and AFAIK not used by any of the core developers working on CPython.

CPU-wise all new systems are indeed arm64, with x86_64 still supported by Apple for now. Compiling for both is possible on any system running macOS 11 or later (which is the first version of the OS supporting arm64, about 4 years old at this time).

If you also want to test the result for both architectures you’d have to get a basic arm64 system, Apple supports running x86_64 binaries on those systems as well through emulation.

1 Like