Skip to content

Build macOS universal binary (arm64 + x86_64)#138

Open
karlhiramoto wants to merge 1 commit into
masterfrom
macos_universal
Open

Build macOS universal binary (arm64 + x86_64)#138
karlhiramoto wants to merge 1 commit into
masterfrom
macos_universal

Conversation

@karlhiramoto

Copy link
Copy Markdown
Member

This PR updates the build process to generate a macOS universal binary containing both x86_64 and arm64 architectures.

Previously, the macOS binary was x86_64 only (vt: Mach-O 64-bit executable x86_64), which required Rosetta 2 to run on Apple Silicon Macs. This change fixes the binary for Apple Silicon machines that do not have Rosetta 2 installed.

Changes:

  • Updated Makefile to compile both darwin/amd64 and darwin/arm64, then combine them using lipo.
  • Added a fallback to makefat (via go run) when lipo is not available, ensuring that the build still succeeds on Linux-based CI runners (like GitHub Actions ubuntu-latest).
  • Updated new_release.sh to package the universal binary in MacOSX.zip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant