I use GitHub Actions to build binaries for Windows, Ubuntu, and macOS. The software is intended for research labs, many of which still have older Macs running macOS 10.x. Builds made on current hosted macOS runners either cannot target an old enough system or produce .app bundles that fail to run on those machines. Is there a reliable way to create Nuitka binaries compatible with older macOS versions, either through deployment-target settings, architecture selection, or a different build setup?
4 Answers
The most dependable option is usually building on a Mac that runs the oldest macOS version you intend to support. Hosted CI runners generally do not provide very old macOS environments, and cross-compiling an older-compatible Nuitka application from a modern runner can be difficult because the SDK, compiler, Python build, and native libraries all matter. A self-hosted runner using an older Mac would give you much better control.
Also decide whether those older Macs are Intel-based or Apple-silicon machines. A build for arm64 will not run on older Intel Macs, so you may need an x86_64 build or separate bundles. A universal binary is another possibility, but it still cannot bypass an operating-system requirement. If you cannot access an old Mac directly, borrow or dedicate one as a self-hosted CI runner and use it to build and test the release.
There is no completely reliable way to make a modern build run on an arbitrarily old macOS version. Newer SDKs may generate binaries that require newer system APIs, while packaged native dependencies can impose their own minimum version. Building on the oldest supported macOS release, or at least testing there, is generally the safest approach.
If the problem is the minimum macOS version rather than the CPU architecture, check the deployment-target settings used by the compiler and any native dependencies. For example, you can set MACOSX_DEPLOYMENT_TARGET before running Nuitka and select the required target architecture. However, the selected value must actually be supported by the Python distribution, SDK, compiler, and libraries used in the build; setting the variable alone does not guarantee compatibility. Test the resulting .app on the oldest system you support.
That makes sense. I was hoping there was a single Nuitka or GitHub Actions option, but I may need to verify the Python and library toolchain as well.

I have looked for Nuitka and CI settings that might handle this, but I have not found a working combination yet. It sounds like using an older machine may be more practical than continuing to force the hosted runners to do it.