From 8925431911cf3a5bf24d5be55965dee356bfabc3 Mon Sep 17 00:00:00 2001 From: sailorpepe Date: Thu, 23 Jul 2026 14:24:55 -0500 Subject: [PATCH] fix(desktop): stage real sidecar binaries in _ensure-sidecar-stubs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _ensure-sidecar-stubs unconditionally `touch`es 0-byte placeholder files in desktop/src-tauri/binaries/. On the documented dev flow (`just setup && just build && just dev`) the real binaries are already compiled to the workspace target dir, but the stubs are never filled — so `tauri dev` stages a 0-byte buzz-acp next to the app binary and the desktop app fails to launch its agent auth helper: Couldn't load sign-in options: failed to run buzz-acp auth helper: Permission denied (os error 13) This breaks Claude Code / Codex harness sign-in on macOS out of the box. Copy the compiled binary into the stub when it exists (chmod +x), matching the cp + chmod pattern `desktop-standalone` / `desktop-release-build` already use. Fall back to `touch` only when the binary is not built yet, preserving the existing tauri-config-validation behavior for flows that have not built the workspace. Distinct from #2492 / #2496, which fix the Windows `.exe` stub suffix; this is the macOS empty-fill case. Signed-off-by: sailorpepe --- Justfile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Justfile b/Justfile index 3e4b6bee0..e796e9a8b 100644 --- a/Justfile +++ b/Justfile @@ -154,9 +154,22 @@ _ensure-sidecar-stubs: #!/usr/bin/env bash set -euo pipefail TARGET=$(rustc -vV | sed -n 's|host: ||p') + TARGET_DIR=$(cargo metadata --format-version 1 --no-deps | node -p "JSON.parse(require('fs').readFileSync(0, 'utf8')).target_directory") mkdir -p desktop/src-tauri/binaries for bin in buzz-acp buzz-agent buzz-dev-mcp git-credential-nostr buzz; do - touch "desktop/src-tauri/binaries/${bin}-${TARGET}" + stub="desktop/src-tauri/binaries/${bin}-${TARGET}" + real="${TARGET_DIR}/debug/${bin}" + # Copy the real binary when it's been built (e.g. after `just build`), + # so `just dev` stages a working sidecar instead of a 0-byte stub that + # the app later tries to exec (-> os error 13). Fall back to an empty + # stub only when the binary isn't built yet, preserving the prior + # tauri-config-validation behavior. + if [ -s "$real" ]; then + cp "$real" "$stub" + chmod +x "$stub" + else + touch "$stub" + fi done # Ensure Docker dev services (Postgres, Redis, etc.) are running and healthy