用途:这是 cmux 项目中关于 Ghostty 子模块与 GhosttyKit 构建的工作流规则,适用于修改 ghostty 子模块、重建 GhosttyKit.xcframework、更新父仓库子模块指针等场景。
主要能力与用法:
- 构建 GhosttyKit 时始终使用 Release 优化重建 xcframework: cd ghostty && zig build -Demit-xcframework=true -Dxcframework-target=universal -Doptimize=ReleaseFast
- 子模块工作流:Ghostty 改动提交在 ghostty 子模块中,并推送到 manaflow-ai/ghostty fork;需保持 docs/ghostty-fork.md 与 fork 变更及冲突记录同步。推送前先运行 git remote -v,确认哪个远程是 manaflow-ai/ghostty。.gitmodules 将子模块 URL 设为该 fork,正常检出中它是 origin;旧配置可能把 upstream 作为 origin 并把 fork 加为 manaflow,需替换为正确名称。 cd ghostty git remote -v git checkout -b <branch> git add <files> git commit -m "..." git push origin <branch>
- 从上游 ghostty-org/ghostty 拉取变更时,需先显式添加远程: cd ghostty git remote add upstream https://github.com/ghostty-org/ghostty.git git fetch upstream git checkout main git merge upstream/main git push origin main 随后在父仓库记录新 SHA: cd .. git add ghostty git commit -m "Update ghostty submodule"
- 子模块安全:对任何子模块(ghostty、vendor/bonsplit、homebrew-cmux),先在父仓库提交更新指针前,把子模块提交推送到其远程分支。切勿在 detached HEAD 或临时分支上提交,否则父仓库会指向任何远程分支都不可达的 SHA,后续检出或 CI 任务将无法获取。可用以下命令验证提交从应跟踪的分支可达: cd ghostty && git fetch origin main && git merge-base --is-ancestor HEAD origin/main
限制与补充:详细参考见 references/submodule-safety.md,其中包含有序安全步骤与 fork 文档预期。资料未提供其他功能、收费或平台信息。