From 3390ba2938bae94acf37945e56657fb2af2b7464 Mon Sep 17 00:00:00 2001 From: Micah Alpern Date: Wed, 16 Sep 2026 06:33:46 -0700 Subject: [PATCH] Unbreak the release build under Xcode 27 The release path failed to build under the newly pinned Xcode 27, before compiling any KeyPath code: error: unable to open dependencies file (.../swift-argument-parser.build/Release/.../ArgumentParserToolInfo-primary.d) build-and-sign.sh passed `-Xswiftc -no-whole-module-optimization`. Xcode 27 makes SwiftPM's newer build system the default, and that build system fails to emit the per-file dependencies output the flag implies. Reproduced deterministically with the script's exact command outside the script. The flag was added in August 2025 as a workaround, with the comment "disable whole-module optimization to avoid hang". That hang no longer reproduces: a full whole-module release build completes cleanly. The only way to keep the flag is to force `--build-system native`, which Xcode 27 reports as deprecated and slated for removal. So the stale workaround is removed, with a comment recording the history and that fallback pair in case the hang ever returns. CI only builds Debug and tests, so nothing caught this; it surfaced on the first real release-candidate build after the pin moved. Verified by that build: it signs, deploys to /Applications, and passes verify-installed-app.sh (notarization skipped) with Kanata registered, running, and TCP-ready. Co-Authored-By: Claude Opus 5 --- Scripts/build-and-sign.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Scripts/build-and-sign.sh b/Scripts/build-and-sign.sh index 2fad58c7a..2389f6758 100755 --- a/Scripts/build-and-sign.sh +++ b/Scripts/build-and-sign.sh @@ -162,7 +162,15 @@ BUILD_SYSTEM_FLAGS=() if [[ -n "${KEYPATH_BUILD_SYSTEM:-}" && "${KEYPATH_BUILD_SYSTEM:-}" != "native" ]]; then BUILD_SYSTEM_FLAGS=(--build-system "$KEYPATH_BUILD_SYSTEM") fi -swift build ${BUILD_SYSTEM_FLAGS[@]+"${BUILD_SYSTEM_FLAGS[@]}"} --configuration release -Xswiftc -no-whole-module-optimization +# Whole-module optimization is left at the release default. It was disabled +# here in August 2025 to dodge a build hang on the toolchain of the day; that +# hang no longer reproduces, and the workaround now breaks the build outright: +# Xcode 27 makes SwiftPM's newer build system the default, and that system +# fails to emit the per-file dependencies output the flag implies +# ("unable to open dependencies file ... -primary.d"). Restoring the flag +# therefore also means forcing --build-system native, which is deprecated and +# slated for removal. If the hang ever returns, that pair is the fallback. +swift build ${BUILD_SYSTEM_FLAGS[@]+"${BUILD_SYSTEM_FLAGS[@]}"} --configuration release echo "📦 Creating app bundle..." APP_NAME="KeyPath"