🍺 Bottling should produce architecture-specific binaries
chris-araman opened this issue · 3 comments
The Homebrew maintainers have been intentionally keeping universal binaries out of Homebrew.
Currently, script/bottle
produces a universal (x86_64 and arm64) bottle. It then duplicates this bottle for all supported macOS releases: 10.11 through 10.14 (x86_64) and 11 (x86_64 and arm).
We should use GitHub Actions to generate an x86_64 bottle for x86_64 macOS releases and an arm64 bottle for arm64 macOS releases. Unfortunately, this is currently blocked on having arm64 runners with macOS 11.
After mas-cli/mas#365, the homebrew-core formula will build architecture-specific bottles.
Alternatively, we could provide a cask with a universal binary, since we can't really build a formula from source on these platforms anyway. Does that sound reasonable, @phatblat?
I've got an M1 mini now but haven't had time to set it up as a GitHub actions runner yet. Looks like some people have been successful.
While the build script currently builds for "current" or "all" architectures, could we build different machine-specific bottles on the same box?
Cool!
Yes, Intel and M1 Macs can both build x86_64 or arm64 binaries by passing the --triple $ARCH-apple-macosx
flag to swift build
. Only the M1 Macs can run both binaries.