Create a universal binary for macos.#12
Merged
floitsch merged 12 commits intopatch-head-5.1.0from Apr 6, 2026
Merged
Conversation
Replace separate macos-amd64 (macos-13) and macos-aarch64 builds with a single universal2 build on macos-latest. The fat binary works natively on both Intel and Apple Silicon Macs. Upload the archive under both legacy names (macos-aarch64, macos-amd64) for backwards compatibility. Add verification step using lipo and arch -x86_64 to confirm both architectures work.
The setup-python action installs arm64-only Python on macOS ARM runners, causing PyInstaller to fail with "not a fat binary" errors when building universal2 binaries. Install the official python.org universal2 framework build instead, so all native extensions (bitarray, cryptography, etc.) are compiled as fat binaries.
The python.org installer only provides python3/pip3 binaries. Create symlinks so bare 'python' and 'pip' commands work. Also fix comment about why we use python.org instead of setup-python.
Pip downloads arm64-only wheels on ARM runners regardless of whether Python itself is universal2. Use --no-binary :all: with ARCHFLAGS to compile native extensions (bitarray, cffi, pyyaml, tibs) as fat binaries for the universal2 PyInstaller build.
The python.org manual install is unnecessary — setup-python already installs universal2 Python. The ARCHFLAGS + --no-binary fix handles the actual problem (pip's wheel selection).
bitstring 4.4.0 dynamically imports bitstore_bitarray, which PyInstaller doesn't detect. Add --hidden-import for esptool and espefuse builds.
bitstring 4.4.0 has many dynamically imported submodules. Collect them all rather than chasing individual ones.
--no-binary :all: breaks cryptography (needs Rust toolchain). Instead, install normally first, then force-reinstall only the packages that don't publish universal2 wheels (bitarray, cffi, pyyaml, tibs) from source with ARCHFLAGS.
tibs uses maturin/Rust and needs the x86_64 target to build a universal2 fat binary on an ARM runner.
tibs 0.5.7 requires Rust edition 2024, but the ubuntu 22.04 apt package only provides Cargo 1.75.0. Install Rust via rustup to get a recent enough version. Also add --collect-submodules bitstring for the same PyInstaller hidden import issue as the main build.
A shell comment inside a backslash-continued apt-get command broke the line continuation, causing 'build-essential: command not found'.
Member
Author
|
TBR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make a universal binary for macos.