fix make run — use PID file, add make stop
test / unit + widget + golden + a11y (push) Failing after 40s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped

PID file at /tmp/clide-daemon-<uid>.pid replaces pkill pattern
matching. make run depends on stop so stale daemons are killed
before build. Flutter exit via ctrl-C no longer aborts Make.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-04-22 16:54:18 +02:00
co-authored by Claude
parent 8b5615426a
commit 1f23ba40f2
+12 -11
View File
@@ -37,26 +37,27 @@ else
@echo "(pubspec.yaml not scaffolded yet; skipping)" @echo "(pubspec.yaml not scaffolded yet; skipping)"
endif endif
DAEMON_PID_FILE := /tmp/clide-daemon-$(shell id -u).pid
.PHONY: run .PHONY: run
run: ## Build the daemon + launch the Flutter desktop app. run: stop build ## Build the daemon + launch the Flutter desktop app.
ifeq ($(APP_PRESENT),yes) ifeq ($(APP_PRESENT),yes)
@# Kill any stale daemon so the binary isn't locked.
@pkill -f 'bin/clide --daemon' 2>/dev/null; sleep 0.2; true
$(MAKE) build
@echo "Starting daemon…" @echo "Starting daemon…"
@bin/clide --daemon & DAEMON_PID=$$!; \ @bin/clide --daemon & echo $$! > $(DAEMON_PID_FILE)
trap 'kill $$DAEMON_PID 2>/dev/null; wait $$DAEMON_PID 2>/dev/null' EXIT INT TERM; \ @echo "Daemon PID $$(cat $(DAEMON_PID_FILE))"
echo "Daemon PID $$DAEMON_PID"; \ @echo "Launching Flutter app…"
echo "Launching Flutter app…"; \ -cd app && flutter run -d linux
cd app && flutter run -d linux; \ @$(MAKE) --no-print-directory stop
kill $$DAEMON_PID 2>/dev/null; wait $$DAEMON_PID 2>/dev/null; true
else else
@echo "(pubspec.yaml not scaffolded yet; skipping)" @echo "(pubspec.yaml not scaffolded yet; skipping)"
endif endif
.PHONY: stop .PHONY: stop
stop: ## Kill any running clide daemon. stop: ## Kill any running clide daemon.
@pkill -f 'bin/clide --daemon' 2>/dev/null && echo "daemon stopped" || echo "no daemon running" @if [ -f $(DAEMON_PID_FILE) ]; then \
kill $$(cat $(DAEMON_PID_FILE)) 2>/dev/null && echo "daemon stopped" || true; \
rm -f $(DAEMON_PID_FILE); \
fi
.PHONY: install .PHONY: install
install: build ## Install bin/clide into $(INSTALL_DIR). install: build ## Install bin/clide into $(INSTALL_DIR).