Github workflow for building binaries for windows-x86, macos-x86, macos-arm64; resolves #608#668
Conversation
- nuitka binary builds for windows-x64, macos-x64, macos-arm64 - for mac python-lzo and pyicu are compiled from sources in the runners; for windows binary wheels are used; compiling on windows with vcpkg worked for python-lzo but failed for pyicu because the original pyicu sources break for windows and require patching as can be seen on https://github.com/cgohlke/pyicu-build/blob/main/PyICU.diff
|
How can I confirm that your I'm afraid you will have to build everything here in the action, except what you download from pypi. |
|
Also please move all |
they were built by forking https://github.com/jd-boyd/python-lzo:
Ideally I would rather prefer you to have your own forks for both python-lzo and pyciu and set up github actions that you fully control so that I can safely link to them rather than fiddling with the YAMLs and having to build them myself. For macOS both python-lzo and pyicu are already compiled in the runner, it's only on windows where the things become tricky. The working windows WHL were generated using https://github.com/cgohlke/pyicu-build as the baseline. Some WHLs such as those for raspberrypi aarch64 I compiled on bare metal using |
@ilius in case you want to take up the full 100% source compilation for windows, here is the failed experiment which does successfully build
|
|
Then please move the windows build to another branch completely. |
@ilius: split and parked it as .github/workflows/build-win64.yml — I'd say this can be considered on-hold until you provide your own compiled WHLs or incorporate the entire logic from https://github.com/cgohlke/pyicu-build, since opaque binary modules from random repos like mine or anyone else's will always be a security risk, and no security guarantee is possible in this case; imo not being paranoid about this would be unwise. |
|
@ilius please let me know what else do you think might be missing or needs removing; if you wish I can remove the windows build entirely until you find a way to handle the compiled modules
|
|
Update: turns out nuitka already fixed the tkinter plugin version, and the author added |
|
@ilius: regarding This would be helpful even for people running linux as not all of them have or want to install packages like
|
|
So when I push a tag to master, then create the release as before, then push to certain branch that creates 2 additional releases after that release? Can we add the dmg/exe file to the last existing release? |
|
Thanks. |
|
Somehow I broke the Mac action. |
- the `->` block folding: 1. joins all lines with spaces 2. remove the final newline 3. creates one long command line
added a &tldr;
now the builds are fine for both windows and mac |
Can't we just |
It's about the structure of mac app bundles. The drwxr-xr-x 718636 staff 160 B Tue Aug 26 17:03:34 2025 .
drwxr-xr-x 718636 staff 2.2 KB Tue Aug 26 22:01:12 2025 ..
drwxr-xr-x 718636 staff 96 B Tue Aug 26 17:04:56 2025 PyGlossaryTK.app
drwxr-xr-x 718636 staff 49 KB Tue Aug 26 17:04:56 2025 PyGlossaryTK.build
drwxr-xr-x 718636 staff 64 B Tue Aug 26 17:03:34 2025 PyGlossaryTK.dist
Inside the PyGlossaryTK.app
└── Contents
├── _CodeSignature
│ └── CodeResources
├── Info.plist
├── MacOS
│ ├── pyglossary <<<<< ❗️#### FOLDER ####
│ ├── langs
│ ├── plugins
│ ├── PyGlossaryTK <<<<< ❗️#### mac executable ####
│ ├── Python
│ ├── res
└── ResourcesSince macOS file system is case-insensitive there is no way to have both a I suppose pyglossary could be refactored in order to avoid this situation and implement some special logic for accessing resources when run from a mac bundle, but that would probably be too much effort that doesn't really buy much. Normally, for native mac apps, You can get a rough idea of how mac bundles are organized by using Show Package Contents on some native Apple apps, but also on non-native apps that use Electron (e.g. vscode), Java (pycharm), etc.. Btw, specifically for python, Calibre might be a very good example of how they do packaging, although their project is too complex with lots of dependencies, and I do actually see a Python runtime in the bundle. With nuitka python only exists as a DLL and everything gets transpiled to cpp and then compiled to native code. |
|
@ilius: some findings from grok prompting about how bigger projects organize resources:
what some apps do
specifically for
|
|
Got it. |
|
@ilius: made a pr against the 'official' Or alternatively, maybe you would be interested in forking jd-boyd's repo and generate the WHLs in your own fork with the modified workflow https://github.com/glowinthedark/python-lzo/blob/patch-2/.github/workflows/build-windows.yml |
|
@ilius jd-boyd accepted the pr for
|
resolves #608
Nuitka binary builds for windows-x64, macos-x64, macos-arm64
for mac python-lzo and pyicu are compiled from sources in the github runners;
for windows precompiled WHL wheels are used; compiling dependencies inside the runner worked on windows with vcpkg for python-lzo, but failed for pyicu because the original pyicu sources break on windows and require patching as can be seen in https://github.com/cgohlke/pyicu-build/blob/main/PyICU.diff — overall this made the entire process too complicated and ugly, and for the moment decided to abandon the vcpkg approach and just use WHLs.
@ilius: the workflow uploads, and then downloads the artifacts and creates a release using the latest tag, if that is not desired then the release step can be disabled, for example by adding
if:falseafter line:123, right belowuses: ncipollo/release-action@v1.The workflow is supposed to be invoked manually via workflow dispatch, and will use the latest tag (via
git describe --abbrev=0).ref: nuitka-releasefor actionactions/checkout@v4(it's used in 3 places!) since by default the action will use whatever is set as the default branch, i.e.master, etc. For testing the workflow in a different branchref:should point to the correct branch name, e.g.ref: nuitka-release. If not run on the correct branch then the macOS runners will fail because of the missing iconres/pyglossary.icnsand the scripts.