From 8f431eaa40e0ecb02c69efb802d4f1ec7a65e689 Mon Sep 17 00:00:00 2001 From: Vassiliy Yegorov Date: Mon, 15 Jun 2026 12:34:57 +0700 Subject: [PATCH] fix(build): clean sidecar dir each build; native-focused install/reinstall MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The stale bin/spaceshd-universal-apple-darwin sidecar (left over from an earlier approach) poisoned the universal bundle — tauri shipped that old daemon instead of the freshly built one, so the packaged daemon lacked the TERM fix. dmg/dmg-native now wipe the sidecar dir first. install copies the native bundle (was preferring the universal one, which could be stale) and kills the running daemon; reinstall = native rebuild + install for fast self-updates. Universal stays for distribution via dmg / install-universal. Co-Authored-By: Claude Opus 4.8 (1M context) --- Makefile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 9f21c20..ed9cb31 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ dmg: targets ## build the universal (Intel + Apple Silicon) .dmg — UNSIGNED # ships spaceshd inside spacesh.app/Contents/MacOS (else the GUI is offline). cargo build --release -p spaceshd --target aarch64-apple-darwin cargo build --release -p spaceshd --target x86_64-apple-darwin - mkdir -p $(SIDECAR_DIR) + rm -rf $(SIDECAR_DIR) && mkdir -p $(SIDECAR_DIR) # avoid stale sidecars poisoning the bundle cp target/aarch64-apple-darwin/release/spaceshd $(SIDECAR_DIR)/spaceshd-aarch64-apple-darwin cp target/x86_64-apple-darwin/release/spaceshd $(SIDECAR_DIR)/spaceshd-x86_64-apple-darwin cd $(APP_DIR) && npm run tauri build -- --target $(TAURI_TARGET) --config $(BUNDLE_CONFIG) @@ -51,7 +51,7 @@ dmg: targets ## build the universal (Intel + Apple Silicon) .dmg — UNSIGNED .PHONY: dmg-native dmg-native: ## build a .dmg for the current arch only (faster) cargo build --release -p spaceshd - mkdir -p $(SIDECAR_DIR) + rm -rf $(SIDECAR_DIR) && mkdir -p $(SIDECAR_DIR) # avoid stale sidecars poisoning the bundle cp target/release/spaceshd $(SIDECAR_DIR)/spaceshd-$(NATIVE_TRIPLE) cd $(APP_DIR) && npm run tauri build -- --config $(BUNDLE_CONFIG) @ls -lh $(NATIVE_DMG_DIR)/*.dmg @@ -70,14 +70,20 @@ kill-daemon: ## stop a running spaceshd so a freshly-built one takes over -rm -f $$HOME/.spacesh/sock .PHONY: install -install: kill-daemon ## copy the built .app to /Applications, restart daemon, clear quarantine +install: kill-daemon ## install the native .app to /Applications, restart daemon, clear quarantine rm -rf /Applications/spacesh.app - cp -R "$(APP_BUNDLE)" /Applications/ 2>/dev/null || cp -R "$(NATIVE_APP_BUNDLE)" /Applications/ + cp -R "$(NATIVE_APP_BUNDLE)" /Applications/ + xattr -dr com.apple.quarantine /Applications/spacesh.app + @echo "Installed (native). Quit & relaunch spacesh; the bundled daemon restarts." + +.PHONY: install-universal +install-universal: kill-daemon ## install the universal .app to /Applications + rm -rf /Applications/spacesh.app + cp -R "$(APP_BUNDLE)" /Applications/ xattr -dr com.apple.quarantine /Applications/spacesh.app - @echo "Installed. The bundled daemon (with the latest code) starts on next launch." .PHONY: reinstall -reinstall: dmg install ## universal rebuild + reinstall + restart daemon (one shot) +reinstall: dmg-native install ## native rebuild + reinstall + restart daemon (fast self-update) # ---- Tests ----