diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 052e67e3e65b..ef40d26b1b99 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -120,7 +120,7 @@ jobs: - name: Build GhosttyKit.xcframework run: | cd ghostty - zig build -Demit-xcframework=true -Demit-macos-app=false -Dxcframework-target=native -Doptimize=ReleaseFast + 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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7adf546a887a..b5056cbe8fbd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -114,7 +114,7 @@ jobs: if: steps.guard_release_assets.outputs.skip_all != 'true' run: | cd ghostty - zig build -Demit-xcframework=true -Demit-macos-app=false -Doptimize=ReleaseFast + 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 diff --git a/GhosttyTabs.xcodeproj/project.pbxproj b/GhosttyTabs.xcodeproj/project.pbxproj index 9604d4c2e200..c37bb3dc4137 100644 --- a/GhosttyTabs.xcodeproj/project.pbxproj +++ b/GhosttyTabs.xcodeproj/project.pbxproj @@ -796,7 +796,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="; @@ -836,6 +836,7 @@ "@executable_path/../../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 14.0; + ONLY_ACTIVE_ARCH = NO; PRODUCT_NAME = cmux; PRODUCT_MODULE_NAME = cmux_cli; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/scripts/build-sign-upload.sh b/scripts/build-sign-upload.sh index 06f4e8d84384..e406b5cb1e9f 100755 --- a/scripts/build-sign-upload.sh +++ b/scripts/build-sign-upload.sh @@ -59,13 +59,23 @@ done echo "Pre-flight checks passed" # --- Build GhosttyKit (if needed) --- +# Always rebuild if the existing xcframework is missing the x86_64 slice, +# which happens when setup.sh seeds a native-only (arm64) build. +NEED_BUILD="false" 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 .. + NEED_BUILD="true" +elif [ ! -d "GhosttyKit.xcframework/macos-arm64_x86_64" ]; then + echo "GhosttyKit.xcframework exists but is not universal, rebuilding..." + NEED_BUILD="true" +fi + +if [ "$NEED_BUILD" = "true" ]; then + echo "Building universal GhosttyKit..." + 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 - echo "GhosttyKit.xcframework exists, skipping build" + echo "GhosttyKit.xcframework exists and is universal, skipping build" fi # --- Build app (Release, unsigned) ---