Skip to content

Commit 441659f

Browse files
committed
Add docker agent builds to Makefile build-agents target
The build-agents Makefile target was only building host agent binaries, which meant development builds were missing the architecture-specific docker agent binaries (pulse-docker-agent-linux-{amd64,arm64,armv7}). This caused the install script to fail on ARM platforms like Raspberry Pi because the download endpoint would fall back to the default amd64 binary, resulting in "Exec format error" when trying to run on ARM. Related to #633
1 parent 6320b72 commit 441659f

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

Makefile

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,21 @@ format-backend:
6969
format-frontend:
7070
npm --prefix $(FRONTEND_DIR) run format
7171

72-
# Build all host agent binaries for all platforms
72+
# Build all agent binaries for all platforms
7373
build-agents:
74-
@echo "Building host agent binaries for all platforms..."
74+
@echo "Building agent binaries for all platforms..."
7575
@mkdir -p bin
76-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o bin/pulse-host-agent-linux-amd64 ./cmd/pulse-host-agent
77-
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -trimpath -o bin/pulse-host-agent-linux-arm64 ./cmd/pulse-host-agent
78-
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-s -w" -trimpath -o bin/pulse-host-agent-linux-armv7 ./cmd/pulse-host-agent
79-
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o bin/pulse-host-agent-darwin-amd64 ./cmd/pulse-host-agent
80-
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -trimpath -o bin/pulse-host-agent-darwin-arm64 ./cmd/pulse-host-agent
76+
@VERSION=$$(cat VERSION | tr -d '\n') && \
77+
echo "Building docker agent binaries (version: v$$VERSION)..." && \
78+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X github.com/rcourtman/pulse-go-rewrite/internal/dockeragent.Version=v$$VERSION" -trimpath -o bin/pulse-docker-agent-linux-amd64 ./cmd/pulse-docker-agent && \
79+
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w -X github.com/rcourtman/pulse-go-rewrite/internal/dockeragent.Version=v$$VERSION" -trimpath -o bin/pulse-docker-agent-linux-arm64 ./cmd/pulse-docker-agent && \
80+
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-s -w -X github.com/rcourtman/pulse-go-rewrite/internal/dockeragent.Version=v$$VERSION" -trimpath -o bin/pulse-docker-agent-linux-armv7 ./cmd/pulse-docker-agent && \
81+
echo "Building host agent binaries..." && \
82+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o bin/pulse-host-agent-linux-amd64 ./cmd/pulse-host-agent && \
83+
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -trimpath -o bin/pulse-host-agent-linux-arm64 ./cmd/pulse-host-agent && \
84+
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-s -w" -trimpath -o bin/pulse-host-agent-linux-armv7 ./cmd/pulse-host-agent && \
85+
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o bin/pulse-host-agent-darwin-amd64 ./cmd/pulse-host-agent && \
86+
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -trimpath -o bin/pulse-host-agent-darwin-arm64 ./cmd/pulse-host-agent && \
8187
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o bin/pulse-host-agent-windows-amd64.exe ./cmd/pulse-host-agent
8288
@ln -sf pulse-host-agent-windows-amd64.exe bin/pulse-host-agent-windows-amd64
83-
@echo "✓ All host agent binaries built in bin/"
89+
@echo "✓ All agent binaries built in bin/"

0 commit comments

Comments
 (0)