Problem
#99 的自包含修復(fee1e57 — Makefile 把 *.bundle 複製進 Contents/Resources/)未實際生效 :安裝版 /Applications/Logos.app 的 Bundle.module(SwiftTerm fork 的 MetalTerminalRenderer.candidateBundles() 路徑)在 runtime 仍解析到 repo .build 的 dev-fallback ,從未使用 Resources 內嵌的那份。結果是:
repo .build/arm64-apple-macosx/release/ 存在 → app 正常。
.build 被刪(例如 clean-gate rm -rf .build && swift test)→ 安裝版 app 啟動即崩 (SIGTRAP,libswiftCore assertionFailure in NSBundle.module one-time init → MetalTerminalRenderer.candidateBundles())。
Type
bug
實害(2026-08-01)
當日為另一 issue 跑 clean gate 刪了 .build,使用者執行中的 Logos(他的工作 terminal)隨之崩潰 ,且之後點開 app 都是啟動即崩(crash reports Logos-2026-08-01-164122/164221.ips),直到重建 release 產物才復活。「開發 repo 的清理動作可以殺掉已安裝的 app」——這正是 #99 想消滅的耦合,實測仍在。
Evidence
安裝版(Jul 27,晚於 fee1e57 Jul 19)的 Contents/Resources/SwiftTerm_SwiftTerm.bundle 存在且含 Shaders.metal —— 內嵌步驟有跑。
strings 安裝版 binary:內嵌 fallback 絕對路徑為 <repo>/.build/arm64-apple-macosx/release/SwiftTerm_SwiftTerm.bundle(與 Highlightr_Highlightr.bundle 同)。
決定性實驗(做過兩次 ,一次在 Installed Logos.app crashes at launch: SwiftPM resource bundles never embedded, Bundle.module dev-path fallback broken by .build clean #99 、一次在今日):不動安裝版、只重建 swift build -c release → app 復活。⇒ runtime 實際使用的是 .build 那份,Resources 那份從未被選中。
未定的根因細節(留給 diagnose)
SwiftPM 生成的 Bundle.module accessor 候選順序理論上是 Bundle.main.resourceURL 優先、build-dir fallback 在後。Resources копия存在卻仍走 fallback,可能性包括:Bundle(url:) 對「無 Info.plist 的裸 .bundle 目錄」回 nil(內嵌那份只有 Shaders.metal 一個檔案,無 bundle 結構)、或 accessor 候選順序與假設不符。需要對照 fork 內 accessor 生成物確認。
Expected
安裝版 app 完全自包含:.build 整個刪除後,/Applications/Logos.app 照常啟動、terminal/Metal 照常運作。驗收方式(#99 時記載過但顯然未以此驗過):mv .build .build.away && open -a Logos → 存活;mv 回來。
Workaround(現行)
清 .build 後跑一次 swift build -c release 餵 fallback;或避免在安裝版可能被使用時清 .build。
Notes
Current Status
Phase : verified
Problem
#99 的自包含修復(fee1e57 — Makefile 把
*.bundle複製進Contents/Resources/)未實際生效:安裝版/Applications/Logos.app的Bundle.module(SwiftTerm fork 的MetalTerminalRenderer.candidateBundles()路徑)在 runtime 仍解析到 repo.build的 dev-fallback,從未使用 Resources 內嵌的那份。結果是:.build/arm64-apple-macosx/release/存在 → app 正常。.build被刪(例如 clean-gaterm -rf .build && swift test)→ 安裝版 app 啟動即崩(SIGTRAP,libswiftCore assertionFailureinNSBundle.moduleone-time init →MetalTerminalRenderer.candidateBundles())。Type
bug
實害(2026-08-01)
當日為另一 issue 跑 clean gate 刪了
.build,使用者執行中的 Logos(他的工作 terminal)隨之崩潰,且之後點開 app 都是啟動即崩(crash reportsLogos-2026-08-01-164122/164221.ips),直到重建 release 產物才復活。「開發 repo 的清理動作可以殺掉已安裝的 app」——這正是 #99 想消滅的耦合,實測仍在。Evidence
Contents/Resources/SwiftTerm_SwiftTerm.bundle存在且含Shaders.metal—— 內嵌步驟有跑。strings安裝版 binary:內嵌 fallback 絕對路徑為<repo>/.build/arm64-apple-macosx/release/SwiftTerm_SwiftTerm.bundle(與Highlightr_Highlightr.bundle同)。swift build -c release→ app 復活。⇒ runtime 實際使用的是.build那份,Resources 那份從未被選中。未定的根因細節(留給 diagnose)
SwiftPM 生成的
Bundle.moduleaccessor 候選順序理論上是Bundle.main.resourceURL優先、build-dir fallback 在後。Resources копия存在卻仍走 fallback,可能性包括:Bundle(url:)對「無Info.plist的裸.bundle目錄」回 nil(內嵌那份只有Shaders.metal一個檔案,無 bundle 結構)、或 accessor 候選順序與假設不符。需要對照 fork 內 accessor 生成物確認。Expected
安裝版 app 完全自包含:
.build整個刪除後,/Applications/Logos.app照常啟動、terminal/Metal 照常運作。驗收方式(#99 時記載過但顯然未以此驗過):mv .build .build.away && open -a Logos→ 存活;mv回來。Workaround(現行)
清
.build後跑一次swift build -c release餵 fallback;或避免在安裝版可能被使用時清.build。Notes
Current Status
Phase: verified