mirror of
https://github.com/makecindy/cindy.git
synced 2026-12-05 06:11:06 +08:00
docs(desktop): explain missing SwiftUI macro toolchain recovery
Signed-off-by: Zhao Dengfeng <2370187+zhaodengfeng@users.noreply.github.com>
This commit is contained in:
@@ -56,6 +56,42 @@ Cindy Make 的设置入口和指令前置弹窗共用源码准备流程:切到
|
||||
准备阶段填充的 pnpm store 缓存,并执行必要的安装脚本;各 worktree 仍保留独立的 `node_modules`,不复制或
|
||||
链接个人分支的依赖目录。安装失败或取消可在现有 checkout 上重试,不重置个人分支。
|
||||
|
||||
## macOS:SwiftUI helper 缺少宏插件
|
||||
|
||||
开发版的菜单栏 helper 会由本机 `swiftc` 按需编译;正式安装包使用随包提供的二进制。
|
||||
若开发日志出现 `plugin for module 'SwiftUIMacros' not found`,或
|
||||
`external macro implementation type 'SwiftUIMacros.StateMacro' could not be found`,
|
||||
先核对当前选择的工具链与 SDK:
|
||||
|
||||
```bash
|
||||
xcode-select -p
|
||||
xcrun --find swiftc
|
||||
xcrun swiftc --version
|
||||
xcrun --show-sdk-path
|
||||
```
|
||||
|
||||
2026-10-18 已复现的组合为 Command Line Tools 的 Swift 6.4 与 macOS 27.0 SDK:
|
||||
一个只含 SwiftUI `@State` 的最小程序也因缺少该宏插件而无法编译。同机指定已安装的
|
||||
macOS 26.5 SDK 后,最小程序和 Cindy 菜单栏 helper 均编译成功。
|
||||
|
||||
遇到这一组合且本机已有兼容 SDK 时,可只为本次启动设置 `SDKROOT`。以下是中国大陆版
|
||||
隔离实例的已验证示例;Global 使用 `--region=global`:
|
||||
|
||||
```bash
|
||||
test -d /Library/Developer/CommandLineTools/SDKs/MacOSX26.5.sdk &&
|
||||
SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX26.5.sdk \
|
||||
pnpm restart:desktop:remote --region=cn --isolated=swiftui-sdk --passive
|
||||
```
|
||||
|
||||
该设置只影响此命令及其子进程,不修改系统默认工具链。26.5 是此次验证过的兼容 SDK,
|
||||
不是项目的固定版本要求;若未安装该 SDK,应先核对所选 Xcode / Command Line Tools
|
||||
是否包含所需宏插件,再选择兼容且完整的开发环境。
|
||||
|
||||
启动成功后,还应核对菜单栏 helper 的编译与启动日志;`DESKTOP_DEV_VERDICT=ready`
|
||||
只说明 Desktop 启动就绪,不能单独证明菜单栏功能已通过验收。编译入口与失败处理见
|
||||
[`MacMenubarNativeHost.ts`](../../apps/desktop/src/main/menubar/MacMenubarNativeHost.ts),
|
||||
隔离与启动参数见 [`desktop-development.md`](desktop-development.md)。
|
||||
|
||||
## Linux:Electron SUID sandbox 权限
|
||||
|
||||
较新的 Ubuntu(23.10+ 默认用 AppArmor 限制非特权 user namespace)上,Electron 会退回
|
||||
|
||||
Reference in New Issue
Block a user