From ffc8854b7ceef6c4065029bac976cfea20fe51cf Mon Sep 17 00:00:00 2001 From: Daniel JB Clark Date: Sat, 14 Nov 2026 16:05:50 -0500 Subject: [PATCH] build: give each arch its own SwiftPM scratch path Swift 6.4's default scratch layout is triple-independent (out/Products/Release), so with a shared scratch both --triple builds reported the same --show-bin-path and the x86_64 build overwrote the arm64 binary before lipo, failing with "lipo: same architectures (x86_64)". A per-arch --scratch-path also works on older triple-keyed layouts. --- scripts/build-app.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/build-app.sh b/scripts/build-app.sh index 9ae4c1d..2d836a4 100755 --- a/scripts/build-app.sh +++ b/scripts/build-app.sh @@ -20,8 +20,12 @@ app="build/Right Folder.app" binaries=() for arch in arm64 x86_64; do triple="$arch-apple-macosx14.0" - swift build -c release --product RightFolder --triple "$triple" - bin="$(swift build -c release --triple "$triple" --show-bin-path)" + # Swift 6.4's default scratch layout is triple-independent (out/Products/Release), so with a + # shared scratch both triples report the same bin path and the x86_64 build overwrites the + # arm64 one before lipo. Give each arch its own scratch; triple-keyed layouts work the same. + scratch=".build/$arch-scratch" + swift build -c release --product RightFolder --triple "$triple" --scratch-path "$scratch" + bin="$(swift build -c release --triple "$triple" --scratch-path "$scratch" --show-bin-path)" binaries+=("$bin/RightFolder") done