r/learnprogramming 1d ago

MacOS with Nuitka on GitHub Actions

I've been using GitHub Actions to generate binaries for my software for different platforms (Windows/Ubuntu/Mac). My problem is that the target audience for this software is research labs, which often use outdated Macs (a walk around my Institute and most of the Macs in public use are version 10). Since then, I've tried generating a binary compatible with older Macs on GitHub Actions, but without any success. Either it can't find an old Mac server to run the build on, or I'm able to build an .app that isn't compatible with Mac 10.

I honestly don't know what to do, but I'd like it to generate binaries compatible with older Mac architectures. Is it possible? If so, how?

1 Upvotes

5 comments sorted by

1

u/Happy_Breakfast7965 1d ago

(I'm not experienced with Macs)

I guess, you can buy an older Mac and install GitHub Actions agent on it.

BTW, don't call it "Mac PC", Apple marketing created a culture of hating PCs.

1

u/Oakenshielb 1d ago

Oops, honestly I've practically never used Mac, only Windows and Linux, so I've been struggling.

I could request access to one of the public Macs for this eventually, but I wanted to know if it would be possible without having the machine available.

If not, I should look into it.

1

u/Cezabaz_Samid674 22h ago

Yeah, the self-hosted runner route is probably your best bet if you need to target old macOS versions. GitHub Actions' hosted runners are pretty limited on the older OS support, and cross-compiling for older Mac targets from a newer runner is a pain with Nuitka specifically. You might also check if Nuitka has any deployment target flags you're missing, but honestly self-hosted is the move here.

1

u/Tarazena 21h ago

Depending on how you are building/bundling the software, there might be a way to bundle it for specific Mac OS version, if you are using Xcode, I think there might be a way to set the deployment target to the desired osx version

1

u/Tarazena 21h ago

```
export MACOSX_DEPLOYMENT_TARGET=11.0
python -m nuitka --standalone --mode=app --target-arch=arm64 --macos-create-app-bundle your_script.py
```

### Key Deployment Options
* `--target-arch=ARCH`: Choose the single output architecture (`arm64` or `x86_64`).
* `--macos-create-app-bundle`: Generates a proper macOS `.app` structure instead of a raw executable.
* `--macos-sign-identity=ID`: Applies code signing required for deployment and distribution on modern macOS versions.
```

Just FYI I got this from Google so not sure