From 23ce2c6d117e685397e540797f9f0207298a0a42 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sun, 9 Nov 2025 08:57:30 +0000 Subject: [PATCH] Add support for Windows 32-bit (windows-386) architecture (related to #674) Adds build support for 32-bit Windows (windows-386) for pulse-host-agent. Changes: - Add windows-386 build to Dockerfile host-agent build section - Add windows-386 binary copy and symlink to Dockerfile - Add windows-386 build to build-release.sh - Add windows-386 zip package to release artifacts - Include windows-386 binary in standalone binary copies This enables pulse-host-agent to run on 32-bit Windows systems, which are still relevant in legacy/industrial monitoring environments through late 2025. --- Dockerfile | 10 ++++++++-- scripts/build-release.sh | 9 +++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6e11c51..83ffc82 100644 --- a/Dockerfile +++ b/Dockerfile @@ -130,7 +130,11 @@ RUN --mount=type=cache,id=pulse-go-mod,target=/go/pkg/mod \ CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build \ -ldflags="-s -w -X github.com/rcourtman/pulse-go-rewrite/internal/hostagent.Version=${VERSION}" \ -trimpath \ - -o pulse-host-agent-windows-arm64.exe ./cmd/pulse-host-agent + -o pulse-host-agent-windows-arm64.exe ./cmd/pulse-host-agent && \ + CGO_ENABLED=0 GOOS=windows GOARCH=386 go build \ + -ldflags="-s -w -X github.com/rcourtman/pulse-go-rewrite/internal/hostagent.Version=${VERSION}" \ + -trimpath \ + -o pulse-host-agent-windows-386.exe ./cmd/pulse-host-agent # Build pulse-sensor-proxy for all Linux architectures (for download endpoint) RUN --mount=type=cache,id=pulse-go-mod,target=/go/pkg/mod \ @@ -237,9 +241,11 @@ COPY --from=backend-builder /app/pulse-host-agent-darwin-amd64 /opt/pulse/bin/ COPY --from=backend-builder /app/pulse-host-agent-darwin-arm64 /opt/pulse/bin/ COPY --from=backend-builder /app/pulse-host-agent-windows-amd64.exe /opt/pulse/bin/ COPY --from=backend-builder /app/pulse-host-agent-windows-arm64.exe /opt/pulse/bin/ +COPY --from=backend-builder /app/pulse-host-agent-windows-386.exe /opt/pulse/bin/ # Create symlinks for Windows without .exe extension RUN ln -s pulse-host-agent-windows-amd64.exe /opt/pulse/bin/pulse-host-agent-windows-amd64 && \ - ln -s pulse-host-agent-windows-arm64.exe /opt/pulse/bin/pulse-host-agent-windows-arm64 + ln -s pulse-host-agent-windows-arm64.exe /opt/pulse/bin/pulse-host-agent-windows-arm64 && \ + ln -s pulse-host-agent-windows-386.exe /opt/pulse/bin/pulse-host-agent-windows-386 # Copy multi-arch pulse-sensor-proxy binaries for download endpoint COPY --from=backend-builder /app/pulse-sensor-proxy-linux-amd64 /opt/pulse/bin/ diff --git a/scripts/build-release.sh b/scripts/build-release.sh index abe2eba..7f7bbbf 100755 --- a/scripts/build-release.sh +++ b/scripts/build-release.sh @@ -267,11 +267,19 @@ env GOOS=windows GOARCH=arm64 go build \ -o "$BUILD_DIR/pulse-host-agent-windows-arm64.exe" \ ./cmd/pulse-host-agent +echo "Building host agent for Windows 386..." +env GOOS=windows GOARCH=386 go build \ + -ldflags="-s -w -X github.com/rcourtman/pulse-go-rewrite/internal/hostagent.Version=v${VERSION}" \ + -trimpath \ + -o "$BUILD_DIR/pulse-host-agent-windows-386.exe" \ + ./cmd/pulse-host-agent + # Package standalone host agent binaries tar -czf "$RELEASE_DIR/pulse-host-agent-v${VERSION}-darwin-amd64.tar.gz" -C "$BUILD_DIR" pulse-host-agent-darwin-amd64 tar -czf "$RELEASE_DIR/pulse-host-agent-v${VERSION}-darwin-arm64.tar.gz" -C "$BUILD_DIR" pulse-host-agent-darwin-arm64 zip -j "$RELEASE_DIR/pulse-host-agent-v${VERSION}-windows-amd64.zip" "$BUILD_DIR/pulse-host-agent-windows-amd64.exe" zip -j "$RELEASE_DIR/pulse-host-agent-v${VERSION}-windows-arm64.zip" "$BUILD_DIR/pulse-host-agent-windows-arm64.exe" +zip -j "$RELEASE_DIR/pulse-host-agent-v${VERSION}-windows-386.zip" "$BUILD_DIR/pulse-host-agent-windows-386.exe" # Create universal tarball cd "$universal_dir" @@ -300,6 +308,7 @@ cp "$BUILD_DIR/pulse-host-agent-darwin-amd64" "$RELEASE_DIR/" cp "$BUILD_DIR/pulse-host-agent-darwin-arm64" "$RELEASE_DIR/" cp "$BUILD_DIR/pulse-host-agent-windows-amd64.exe" "$RELEASE_DIR/" cp "$BUILD_DIR/pulse-host-agent-windows-arm64.exe" "$RELEASE_DIR/" +cp "$BUILD_DIR/pulse-host-agent-windows-386.exe" "$RELEASE_DIR/" # Optionally package Helm chart if [ "${SKIP_HELM_PACKAGE:-0}" != "1" ]; then