fix(scripts): codesign setup pops keychain dialog on every build + dr…#1786
Conversation
…op yarn refs Two bugs in scripts/setup-dev-codesign.sh that surface on a fresh macOS contributor's first build: 1. The `security import` step adds `-T /usr/bin/codesign` to mark codesign as trusted to use the new private key, but macOS additionally requires the partition list to be committed via `security set-key-partition-list` before that access actually takes effect. Without this step, the first `codesign` invocation during `pnpm --filter openhuman-app dev:app` aborts with `errSecInternalComponent` (or pops a Keychain password dialog for every helper bundle, mid-build). 2. The user-facing echoes and header comments still reference `yarn core:stage`, but the repo migrated from yarn to pnpm. Six string occurrences are updated to `pnpm core:stage`. Closes tinyhumansai#1785. Follow-up from tinyhumansai#1781 / tinyhumansai#1783, where both noted this as a known follow-up.
📝 WalkthroughWalkthroughThis PR fixes two issues in the macOS dev code-signing setup script: it adds the missing Keychain partition access grant via ChangesDev Code-Signing Setup
🎯 2 (Simple) | ⏱️ ~10 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
Summary
security set-key-partition-listcall after thesecurity importinscripts/setup-dev-codesign.sh, so codesign can use the just-imported private key on subsequentpnpm --filter openhuman-app dev:appruns withouterrSecInternalComponentor per-helper keychain dialogs.yarn core:stageoccurrences in the same script (header comment, "already set up" echo, and the post-success "Next steps" block) withpnpm core:stageto match the repo's migration from yarn to pnpm.Problem
After
bash scripts/setup-dev-codesign.shon a clean Apple Silicon Mac and thenpnpm --filter openhuman-app dev:app, codesign aborts on the first helper bundle:Apple's
security import -T <tool>flag adds the tool to the key's trusted-applications ACL, but macOS additionally requires the partition list to be committed viasecurity set-key-partition-listbefore that access actually takes effect. Reproducible on every fresh contributor machine.Solution
Shell-script-only change to
scripts/setup-dev-codesign.sh. Adds an explicitsecurity set-key-partition-list -S apple-tool:,apple:,unsigned: -s "$KEYCHAIN"call between the import and the trust step. The contributor is prompted once for their login keychain password during setup; subsequent codesign invocations run silently. Comment in-line explains why the step is required so future readers understand the macOS quirk.The
yarn→pnpmswaps are pure string fixes; the script logic doesn't shell out to either command.Submission Checklist
securityCLI already invoked by the script.Closes #1785in the## Relatedsection.Impact
Fresh macOS contributors who ran
setup-dev-codesign.shpreviously hiterrSecInternalComponenton the firstdev:appcodesign step and had to dig into Apple'ssecurityman page (or fall back to ad-hoc signing) to get past it. After this change,setup-dev-codesign.shis sufficient on its own. No change to CI, no change to released binaries (release builds use a real Apple Developer ID cert viascripts/build-macos-signed.sh, which is unaffected).Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
fix/setup-dev-codesign-partition-list3cde3825Validation Run
Validation Blocked
command:pre-push hookpnpm rust:check(cargo check --manifest-path src-tauri/Cargo.toml)error:exits 101 on the unmodifiedupstream/mainHEAD (commit45cd01a9); this branch only editsscripts/setup-dev-codesign.sh, so the failure is inherited from upstream and unrelated to this PR.impact:Pushed with--no-verifyperCLAUDE.mdguidance for hook failures unrelated to the change.Behavior Changes
setup-dev-codesign.shnow ends with a working codesign cert (partition-list committed) instead of one that still triggerserrSecInternalComponenton first use.dev:appbuild.Parity Contract
Duplicate / Superseded PR Handling
Summary by CodeRabbit