From 7e8fffbe9e1641189a0dce9d1d9b9ca31c835c4e Mon Sep 17 00:00:00 2001 From: gentpan Date: Sun, 13 Sep 2026 03:15:14 +0500 Subject: [PATCH] =?UTF-8?q?CI=20=E4=BD=BF=E7=94=A8=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E7=9A=84=20Xcode=2026=EF=BC=8C=E4=BF=AE=E5=A4=8D=20unregister?= =?UTF-8?q?=20=E8=B7=A8=E9=9A=94=E7=A6=BB=E5=9F=9F=E4=BC=A0=E9=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 10 ++++++---- ARCHITECTURE.md | 3 ++- .../Sources/OpenStatsUI/State/HelperClient.swift | 7 ++++++- README.md | 4 ++-- README.zh-CN.md | 2 +- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36df2c4..a406e45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,13 +12,15 @@ jobs: - uses: actions/checkout@v7 # CommandLineTools alone cannot expand SwiftUI's @Observable / @Entry - # macros — the plugins ship only with full Xcode. Use the runner's - # default Xcode rather than pinning a version that may not be installed - # on a future image. + # macros — the plugins ship only with full Xcode. Liquid Glass needs the + # macOS 26 SDK, so pick the newest Xcode on the image rather than the + # default one or a pinned version that a future image may not carry. - name: Select Xcode run: | ls -d /Applications/Xcode*.app - sudo xcode-select -s /Applications/Xcode.app/Contents/Developer + XCODE=$(ls -d /Applications/Xcode_*.app | sort -V | tail -1) + echo "Using $XCODE" + sudo xcode-select -s "$XCODE/Contents/Developer" swift --version - name: Install XcodeGen diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index affe277..421f4e7 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -19,7 +19,8 @@ hosting SwiftUI, no third-party dependencies. The Xcode project is generated fro ## Build -**A full Xcode is required.** CommandLineTools does not ship the SwiftUI macro plugins. +**Xcode 26 or later is required** — the macOS 26 SDK provides Liquid Glass, and +CommandLineTools does not ship the SwiftUI macro plugins. ```bash brew install xcodegen diff --git a/Packages/OpenStatsKit/Sources/OpenStatsUI/State/HelperClient.swift b/Packages/OpenStatsKit/Sources/OpenStatsUI/State/HelperClient.swift index 14fb65d..d50c1db 100644 --- a/Packages/OpenStatsKit/Sources/OpenStatsUI/State/HelperClient.swift +++ b/Packages/OpenStatsKit/Sources/OpenStatsUI/State/HelperClient.swift @@ -75,7 +75,12 @@ public final class HelperClient { connection?.invalidate() connection = nil do { - try await service.unregister() + // 使用回调版本:不把非 Sendable 的 SMAppService 跨隔离域传递 + try await withCheckedThrowingContinuation { (continuation: CheckedContinuation) in + service.unregister { error in + if let error { continuation.resume(throwing: error) } else { continuation.resume() } + } + } } catch { lastError = "卸载失败:\(error.localizedDescription)" } diff --git a/README.md b/README.md index 33c156e..0aa1f10 100644 --- a/README.md +++ b/README.md @@ -185,8 +185,8 @@ app's user defaults and contain nothing personal. There is no analytics and no t ## Build & run -Requires macOS 14+, a **full Xcode** (the SwiftUI macro plugins do not ship with -CommandLineTools) and [XcodeGen](https://github.com/yonaskolb/XcodeGen). +Requires macOS 14+, **Xcode 26 or later** (the macOS 26 SDK for Liquid Glass; CommandLineTools +alone lacks the SwiftUI macro plugins) and [XcodeGen](https://github.com/yonaskolb/XcodeGen). ```bash brew install xcodegen diff --git a/README.zh-CN.md b/README.zh-CN.md index 738bc65..5e07f32 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -168,7 +168,7 @@ OpenStats **不发起任何网络连接**。指标来自本机的内核接口( ## 构建与运行 -需要 macOS 14+、**完整的 Xcode**(CommandLineTools 不含 SwiftUI 宏插件)以及 +需要 macOS 14+、**Xcode 26 或更高版本**(液态玻璃需要 macOS 26 SDK;仅有 CommandLineTools 时缺少 SwiftUI 宏插件)以及 [XcodeGen](https://github.com/yonaskolb/XcodeGen)。 ```bash