From e5bbb969a15c569cf7d37634234a71783f628390 Mon Sep 17 00:00:00 2001 From: James O'Doherty Date: Fri, 22 May 2026 11:37:57 -0400 Subject: Fix PID lifecycle race and improve CLI routing for diagnostic commands --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3dcd788..dc57dfa 100644 --- a/Makefile +++ b/Makefile @@ -19,16 +19,16 @@ FUZZ_TIME ?= 30s all: $(BINARY) # Build the Go binary +# Use a temporary build file to ensure we don't leave a partially-built or stale binary $(BINARY): $(LAUNCHER_BIN) - CGO_ENABLED=$(CGO_ENABLED) go build $(GO_BUILD_FLAGS) -o $(BINARY) cmd/wg-wrap/main.go + CGO_ENABLED=$(CGO_ENABLED) go build $(GO_BUILD_FLAGS) -o $(BINARY).tmp cmd/wg-wrap/main.go && mv $(BINARY).tmp $(BINARY) # Build the embedded C launcher binary $(LAUNCHER_BIN): $(LAUNCHER_SRC) $(CC) $(CFLAGS) $(LAUNCHER_SRC) -o $(LAUNCHER_BIN) # Run tests -test: clean - $(MAKE) $(BINARY) +test: $(BINARY) @echo "Running tests with WG_WRAP_BIN=$(shell pwd)/$(BINARY)" WG_WRAP_BIN=$(shell pwd)/$(BINARY) go test -v -race ./... -- cgit v1.2.3