Skip to content

macOS: archive universal arm64 + x86_64 binaries - #5

Open
maskraven wants to merge 1 commit into
utmapp:mainfrom
maskraven:macos-universal-archive
Open

macOS: archive universal arm64 + x86_64 binaries#5
maskraven wants to merge 1 commit into
utmapp:mainfrom
maskraven:macos-universal-archive

Conversation

@maskraven

Copy link
Copy Markdown

Why

The macOS CI job already installs GLib for arm64 (brew) and x86_64 (Rosetta Homebrew). The Xcode lipo phase even merges those static libs. xcodebuild archive on macos-latest (Apple Silicon) still compiles arm64-only, so spice-vdagent-0.22.1.pkg cannot run on Intel or QEMU/KVM guests (file reports Mach-O 64-bit executable arm64).

What

  • Release archives use ARCHS = arm64 x86_64 / ONLY_ACTIVE_ARCH = NO
  • CI passes the same flags, then lipo -info must show both slices or the job fails
  • GLib merge script copies a single prefix if the other Homebrew tree is missing (Intel-only hosts)

package_macos.sh is unchanged (still needs Developer ID). After this, a signed .pkg from the archive is a universal installer.

Local check:

xcodebuild archive -scheme vd_agent -archivePath vd_agent.xcarchive \
  -destination 'generic/platform=macOS' \
  ARCHS='arm64 x86_64' ONLY_ACTIVE_ARCH=NO
lipo -info vd_agent.xcarchive/Products/usr/local/bin/spice-vdagent

CI already installs GLib for both architectures, but xcodebuild archive
on Apple Silicon defaults to arm64-only. The published 0.22.1 pkg is
therefore unusable on Intel/QEMU guests.

Force ARCHS=arm64 x86_64 for Release archives, fail CI unless lipo
reports both slices, and allow the GLib lipo script to fall back to a
single Homebrew prefix when the other is missing.
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.

2 participants