chore(#23): バイナリにInfo.plistを埋め込みTCC用の安定bundle identifierを付与#291
Conversation
TCCは権限グラント(将来のスペクトラムアナライザのシステム音声キャプチャ等)を bundle identityでキーする。埋め込みInfo.plistが無いとグラントは実行ファイルの パスにキーされ、再インストールごとにリセットされる。これが#23のBLOCKER。 - Sources/CLI/Info.plist: CFBundleIdentifier=com.generald.lyra を定義 - Package.swift: -sectcreate __TEXT __info_plist でMach-Oに埋め込む (バンドルリソースではなくセクション埋め込みなので exclude も指定) - Makefile / CI(auto-tag.yml): `codesign --force --sign -` で署名にバインド swift build -c release のad-hoc署名はInfo.plistをbindしないため再署名が必要
|
Warning Review limit reached
More reviews will be available in 55 minutes and 26 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds ChangesBundle Identity and Ad-hoc Codesign
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
#291の署名バインドの検証方法をプロジェクトの検証レーンに反映。 併せて実地で踏んだ2点のgotchaも記録: - run-lyraの「daemon crashed at startup」はswift-interpret初回起動の 遅延によるfalse negativeがある(pgrepで生存確認すべき) - run-lyra同時実行は/tmp/lyra-dropのscp衝突を起こすため禁止 - env表にLYRA_VM_SSH_HOST(Apple Virtualization backend必須)を追加
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
lyraバイナリに安定したCFBundleIdentifierを持つ Info.plist を埋め込み、署名にバインドする。スペクトラムアナライザ (#23) が必要とする TCC 権限基盤の前提条件を解消する。背景 — なぜ必要か
TCC (Transparency, Consent, Control) は権限グラント(#23 のスペクトラムアナライザが将来必要とするシステム音声キャプチャ等)を bundle identity(
CFBundleIdentifier)でキー する。埋め込み Info.plist が無いと、グラントは 実行ファイルのパスにキー され、Homebrew で再インストールするたびにリセットされてしまう。これが #23 を進める上での BLOCKER だった(調査メモは issue 本文に追記済み)。そこで CLI バイナリの Mach-O に Info.plist を埋め込み、安定した bundle identity を恒久的に付与する。
変更点
Sources/CLI/Info.plistCFBundleIdentifier = com.generald.lyraを定義Package.swift-sectcreate __TEXT __info_plistで Mach-O の__TEXT,__info_plistセクションに埋め込む(バンドルリソースではなくセクション埋め込みなのでexcludeも指定)Makefile(install)codesign --force --sign -で署名にバインド.github/workflows/auto-tag.ymlversion.txt2.15.0→2.15.1(patch)なぜ再署名が要るのか
swift build -c releaseの ad-hoc 署名は__info_plistセクションを埋め込みはするが 署名にバインドしない(codesign -dvvがInfo.plist=not bound)。codesign --force --sign -で明示的に再署名すると、codesign が埋め込みCFBundleIdentifierから Identifier を自動導出してバインドする。Homebrew formula は CI ビルドのバイナリをそのままlibexec.installするので、バインドは CI パッケージング とmake installの2か所で行えば全配布経路をカバーできる。動作確認 — UTM VM
クリーンな UTM ゲスト (macOS 26.5.1 / arm64) にビルド済みバイナリを送り込み、埋め込み・再署名・実行を実機相当で検証した。
1. 埋め込み Info.plist が Mach-O に載っているか(
otool -P)2. codesign バインド before / after(
make install/ CI と同じcodesign --force --sign -)IdentifierInfo.plistswift build -c releaseの ad-hoc)lyracodesign --force --sign -)com.generald.lyracodesign -dvv 生ログ(ゲスト内)
→ TCC が bundle identity で権限グラントをキーできる状態になった。
3. 無回帰 — 再署名後もオーバーレイは正常描画
再署名でバイナリの cdhash が変わるため、署名済みバイナリでデーモンを再起動し(PID 28492 /
Identifier=com.generald.lyraで稼働)、オーバーレイが描画されることを確認した。MediaRemote ヘルパーも実 now-playing データを取得できている(ヘッダーにアートワーク+曲名)。フォローアップ
NSAudioCaptureUsageDescription(音声キャプチャの利用目的文字列)は Add spectrum analyzer overlay #23 の実装 PR で追加する。投機的に空の権限設定を足さない方針。make install)でもバインド済みバイナリの実行を確認済み。Closes なし(#23 の前提解消。アナライザ本体は #23 で継続)。
Summary by CodeRabbit
Bug Fixes
Chores