natcap / invest

InVEST®: models that map and value the goods and services from nature that sustain and fulfill human life.
Apache License 2.0
164 stars 67 forks source link

How should we handle x64/arm64 compatibility for mac binaries? #1586

Open phargogh opened 4 months ago

phargogh commented 4 months ago

With GitHub Actions' move to M1 runners on macos-14 (which is the current macos-latest), our electron-builder builds are now all arm64 as a result. This is unfortunately a problem for mac users of InVEST with intel CPUs, as Mac OS will not allow arm64 binaries to run on intel chips. The emulation available does allow x64 binaries to run on ARM chips on mac.

In the short term, the safest thing to do is to downgrade our runners to x64 until we can find the right path forward.

Longer-term, we may want to figure out an appropriate solution to this problem that does not alienate InVEST users who are still using intel CPUs ... it may yet be a while before mac on Intel is unreasonable to support.

Implementation-wise, questions remain. Should we provide 2 separate mac builds? Is it better to build a universal binary? If a universal binary, how will we manage platform-specific pyinstaller binaries? Should we run our tests on both intel and M1 chips? I'm sure there are others as well.

davemfish commented 4 months ago

It looks like electron-builder has some facility to help with the electron app side of this problem. Not easy to find, but Find on "universal" on this page: https://www.electron.build/configuration/mac.html

On a different page they refer to the arch property of the config, which can apparently take the "universal" value for mac targets. https://www.electron.build/cli#target