From c6ace87925a8218ba56779e111d0f9001e361e09 Mon Sep 17 00:00:00 2001 From: Jeff Kim Date: Sat, 19 Sep 2026 10:09:25 +0900 Subject: [PATCH] build: take the SDK from the selected developer dir, not the host OS `xcrun --show-sdk-path` without --sdk looks for an SDK matching the host OS and falls through to CommandLineTools when the selected Xcode has none. On a macOS 27 host with Xcode 26.6 that picked the CLT 27.0 SDK (built for Swift 6.4), and Xcode's swiftc 6.3 rejected it: "this SDK is not supported by the compiler". Ask for `--sdk macosx` so the SDK and swiftc come from the same xcode-select'ed developer dir; SDKROOT still overrides. The output matches v0.4.0-rc1: minos 14.0, sdk 26.5, same linked dylibs. Co-Authored-By: Claude Opus 5 (1M context) --- scripts/build.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index 269d6e9..ad46ee8 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -90,7 +90,13 @@ echo "=== [3/5] Compiling Swift sources ===" mkdir -p "$APP_CONTENTS/MacOS" -SDK_PATH=$(xcrun --show-sdk-path) +# --sdk macosx: swiftc와 같은 개발자 디렉터리(xcode-select)의 SDK를 쓴다. +# --sdk 없이 호출하면 xcrun은 host OS 버전의 SDK를 찾아 CommandLineTools까지 내려간다. +# host가 macOS 27이고 Xcode 26.6에 27 SDK가 없을 때 CLT의 27.0 SDK(Swift 6.4)가 +# 잡혀, Xcode의 swiftc 6.3이 "this SDK is not supported by the compiler"로 실패했다. +# SDKROOT를 주면 그 값을 그대로 쓴다. +SDK_PATH="${SDKROOT:-$(xcrun --sdk macosx --show-sdk-path)}" +echo " SDK: $SDK_PATH" BRIDGING_HEADER="$PROJECT_ROOT/OngeulApp/Sources/Ongeul-Bridging-Header.h" OBJC_SOURCES_DIR="$PROJECT_ROOT/OngeulApp/Sources"