From 76f53aaf909a92bae712dd019c28e2ffeaf76b8d Mon Sep 17 00:00:00 2001 From: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com> Date: Sun, 8 Mar 2026 04:21:23 -0700 Subject: [PATCH] Build universal GhosttyKit for Release --- .github/workflows/build-ghosttykit.yml | 2 +- CLAUDE.md | 2 +- GhosttyTabs.xcodeproj/project.pbxproj | 8 +++++--- scripts/build-sign-upload.sh | 2 +- scripts/setup.sh | 2 +- tests/test_ci_universal_release_settings.sh | 8 ++++---- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-ghosttykit.yml b/.github/workflows/build-ghosttykit.yml index 1f2fb84f..ec787452 100644 --- a/.github/workflows/build-ghosttykit.yml +++ b/.github/workflows/build-ghosttykit.yml @@ -69,7 +69,7 @@ jobs: exit 1 fi fi - cd ghostty && zig build -Demit-xcframework=true -Demit-macos-app=false -Doptimize=ReleaseFast + cd ghostty && zig build -Demit-xcframework=true -Demit-macos-app=false -Dxcframework-target=universal -Doptimize=ReleaseFast - name: Package xcframework if: steps.check-release.outputs.exists == 'false' diff --git a/CLAUDE.md b/CLAUDE.md index e1c1c942..d2cba8c8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -49,7 +49,7 @@ xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux -configuration Debug -des When rebuilding GhosttyKit.xcframework, always use Release optimizations: ```bash -cd ghostty && zig build -Demit-xcframework=true -Doptimize=ReleaseFast +cd ghostty && zig build -Demit-xcframework=true -Dxcframework-target=universal -Doptimize=ReleaseFast ``` When rebuilding cmuxd for release/bundling, always use ReleaseFast: diff --git a/GhosttyTabs.xcodeproj/project.pbxproj b/GhosttyTabs.xcodeproj/project.pbxproj index fade9fc0..444419f2 100644 --- a/GhosttyTabs.xcodeproj/project.pbxproj +++ b/GhosttyTabs.xcodeproj/project.pbxproj @@ -784,6 +784,7 @@ MACOSX_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; @@ -859,7 +860,7 @@ "-framework", Carbon, ); - ONLY_ACTIVE_ARCH = YES; + ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = com.cmuxterm.app; PRODUCT_NAME = cmux; SPARKLE_PUBLIC_KEY = "avjcgKibf1FTvhIjLBxhd+0HSpsXU4D0IGlVk8cgqRc="; @@ -901,6 +902,7 @@ MACOSX_DEPLOYMENT_TARGET = 14.0; PRODUCT_NAME = cmux; PRODUCT_MODULE_NAME = cmux_cli; + ONLY_ACTIVE_ARCH = NO; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; @@ -932,7 +934,7 @@ GENERATE_INFOPLIST_FILE = YES; MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = 0.61.0; - ONLY_ACTIVE_ARCH = YES; + ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = com.cmuxterm.appuitests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -968,7 +970,7 @@ GENERATE_INFOPLIST_FILE = YES; MACOSX_DEPLOYMENT_TARGET = 14.0; MARKETING_VERSION = 0.61.0; - ONLY_ACTIVE_ARCH = YES; + ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = com.cmuxterm.apptests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; diff --git a/scripts/build-sign-upload.sh b/scripts/build-sign-upload.sh index ac870d30..08d1f84c 100755 --- a/scripts/build-sign-upload.sh +++ b/scripts/build-sign-upload.sh @@ -61,7 +61,7 @@ echo "Pre-flight checks passed" # --- Build GhosttyKit (if needed) --- if [ ! -d "GhosttyKit.xcframework" ]; then echo "Building GhosttyKit..." - cd ghostty && zig build -Demit-xcframework=true -Demit-macos-app=false -Dxcframework-target=native -Doptimize=ReleaseFast && cd .. + cd ghostty && zig build -Demit-xcframework=true -Demit-macos-app=false -Dxcframework-target=universal -Doptimize=ReleaseFast && cd .. rm -rf GhosttyKit.xcframework cp -R ghostty/macos/GhosttyKit.xcframework GhosttyKit.xcframework else diff --git a/scripts/setup.sh b/scripts/setup.sh index bcfeb818..7384ef62 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -58,7 +58,7 @@ else echo "==> Building GhosttyKit.xcframework (this may take a few minutes)..." ( cd ghostty - zig build -Demit-xcframework=true -Doptimize=ReleaseFast + zig build -Demit-xcframework=true -Dxcframework-target=universal -Doptimize=ReleaseFast ) # Stamp the build output with the SHA it was built from echo "$GHOSTTY_SHA" > "$LOCAL_SHA_STAMP" diff --git a/tests/test_ci_universal_release_settings.sh b/tests/test_ci_universal_release_settings.sh index 3ab48ab9..634a015d 100644 --- a/tests/test_ci_universal_release_settings.sh +++ b/tests/test_ci_universal_release_settings.sh @@ -16,11 +16,11 @@ do done if ! awk ' - /\/\* Release \*\// { in_release=1; saw_only_active_arch=0; next } - in_release && /name = / { in_release=0 } + /\/\* Release \*\// { in_release=1; next } in_release && /ONLY_ACTIVE_ARCH = YES;/ { saw_yes=1 } - in_release && /ONLY_ACTIVE_ARCH = NO;/ { saw_only_active_arch=1 } - END { exit !(saw_only_active_arch && !saw_yes) } + in_release && /ONLY_ACTIVE_ARCH = NO;/ { saw_no=1 } + in_release && /name = Release;/ { in_release=0 } + END { exit !(saw_no && !saw_yes) } ' "$ROOT_DIR/GhosttyTabs.xcodeproj/project.pbxproj"; then echo "FAIL: Release configurations in project.pbxproj must use ONLY_ACTIVE_ARCH = NO" exit 1