Build macOS binary (.app/.dmg) from GNU/Linux; so that we no longer need a dedicated macbook just for building for OSX #7265
Labels
build/packaging 📦
OS-mac
pull-request wanted 📣
Help would be much appreciated if you have expertise and time.
Currently building the macOS release binary can only be done on an actual Mac.
For many years now, we have been building it on a macbook, inside a VM that also runs macOS.
(see https://github.com/spesmilo/electrum/blob/ef3293ab6ac64970bb6fa24be33dbe606bbd344e/contrib/osx/README.md)
This is in stark contrast to ALL other binaries/distributables we build, the source dist, the Windows exes, the Linux AppImage, the Android apk, are all built on GNU/Linux. All these other builds are nicely containerised using docker.
Not so much for macOS...
Note that the main tool used to create the macOS binaries is pyinstaller, and PyInstaller is not a cross-compiler:
We work around this limitation for Windows by using Wine (though see #6566).
(I am personally very happy with Wine, there have been hardly any issues caused by it over the years.)
Perhaps a similar workaround could be used for OSX? That would be nice.
Alternatively, we could use another tool instead of pyinstaller.
This would require a substantial rewrite of the build script of course, but the main issue is finding such a tool in the first place. Something that could cross-compile from Linux to OSX.
PyOxidizer, an alternative to PyInstaller, has an open issue about this, but it does not look like anyone is working on it :(
Alternatively, maybe we could run a VM with macOS guest on a Linux host. I don't know if Apple's licenses allow this...........
Ideally this should be scripted though (including setting up the VM). Note that obviously we don't want to trust large binary blobs supplied by random third parties, so the blobs (which would be inevitable in the context of an OSX VM I guess) should either come from Apple or some reputable source.
Maybe we could find another project that found a solution to cross-compile from Linux to macOS. :) I had no luck so far.
The text was updated successfully, but these errors were encountered: