Skip to content

Commit 624ecf2

Browse files
tcconnallytcconnallyclaude
authored
fix(install): ad-hoc code-sign on macOS so the binary isn't SIGKILLed (#312) (#315)
On Apple Silicon, an unsigned mimir binary is killed on launch (Killed: 9, no output) by the macOS binary policy — even with no quarantine xattr. Since the installer downloads an unsigned release binary, the very next step (`mimir --version` verification, and the user's first `mimir doctor`) produced no output and no error, with no path to diagnosis. install.sh now runs `codesign --force --sign -` on the installed binary on Darwin (guarded by `command -v codesign`; harmless on Intel), and prints the manual fallback command if signing fails. README gains a macOS note with the one-liner to re-sign after a manual `cargo build` + copy (signing is per-binary, so it must be redone after each rebuild). Closes #312. Co-authored-by: tcconnally <hermes@perseus.observer> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent ef0ae42 commit 624ecf2

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ That's it. Mimir is installed to `~/.local/bin/mimir`. Start it:
2828
mimir serve --db ~/.mimir/data/mimir.db
2929
```
3030

31+
> **macOS note.** On Apple Silicon, an unsigned binary is killed on launch
32+
> (`Killed: 9`, no output) by the OS binary policy — even with no quarantine
33+
> attribute. The installer ad-hoc code-signs Mimir for you. If you build or copy
34+
> the binary yourself (`cargo build --release && cp target/release/mimir
35+
> ~/.cargo/bin/`), sign it once after each rebuild:
36+
>
37+
> ```bash
38+
> codesign --sign - "$(command -v mimir)"
39+
> ```
40+
3141
Connect any MCP host (Claude Desktop, Cursor, Hermes Agent, Perseus, etc.):
3242
3343
```json

scripts/install.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ mkdir -p "$BIN_DIR"
8484
chmod +x "$TMP_DIR/mimir"
8585
mv "$TMP_DIR/mimir" "$BIN_DIR/mimir"
8686

87+
# macOS: ad-hoc code-sign so the binary is not killed on launch (#312). On Apple
88+
# Silicon an unsigned binary is SIGKILLed (Killed: 9) by the OS binary policy —
89+
# even with no quarantine xattr — so `mimir --version`/`doctor` would produce no
90+
# output. `codesign --sign -` applies an ad-hoc signature; harmless on Intel.
91+
if [ "$OS" = "apple-darwin" ] && command -v codesign >/dev/null 2>&1; then
92+
if codesign --force --sign - "$BIN_DIR/mimir" 2>/dev/null; then
93+
echo "→ Ad-hoc code-signed for macOS"
94+
else
95+
echo -e "${YELLOW}⚠ Could not code-sign. If 'mimir' is Killed: 9, run:${RESET}"
96+
echo " codesign --sign - $BIN_DIR/mimir"
97+
fi
98+
fi
99+
87100
# Check if BIN_DIR is on PATH
88101
if ! echo "$PATH" | tr ':' '\n' | grep -qxF "$BIN_DIR"; then
89102
case "$SHELL" in

0 commit comments

Comments
 (0)