From 62c4336b4436f1cb1b4f6393ba15a4a4811e4cee Mon Sep 17 00:00:00 2001 From: David Nite Date: Fri, 27 Feb 2026 15:01:31 -0700 Subject: [PATCH 1/2] feat: add Windows build support with full feature parity - Make signal handling Windows-safe in cmd/server.go (SIGTERM only on Unix) - Add windows-build and windows-archives to .goreleaser.yaml (amd64, arm64) - Add build.windows Makefile target and detect Windows/MINGW in build Made-with: Cursor --- .goreleaser.yaml | 16 ++++++++++++++++ Makefile | 8 +++++++- cmd/server.go | 7 ++++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 16fb093b..35c46f28 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -28,6 +28,17 @@ builds: - arm64 ldflags: *build-ldflags + - id: windows-build + binary: mass + env: + - CGO_ENABLED=0 + goos: + - windows + goarch: + - amd64 + - arm64 + ldflags: *build-ldflags + archives: - id: linux-archives builds: @@ -39,6 +50,11 @@ archives: - darwin-build name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}" + - id: windows-archives + builds: + - windows-build + name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}" + checksum: name_template: 'checksums.txt' diff --git a/Makefile b/Makefile index 28b094f4..918dabbe 100644 --- a/Makefile +++ b/Makefile @@ -54,8 +54,10 @@ build: $(MAKE) build.macos; \ elif [ "$$(uname -s)" = "Linux" ]; then \ $(MAKE) build.linux; \ + elif echo "$$(uname -s)" | grep -q -E "^(MINGW|MSYS|Windows)"; then \ + $(MAKE) build.windows; \ else \ - echo "Error: Unsupported operating system. Please use 'make build.macos' or 'make build.linux' directly."; \ + echo "Error: Unsupported operating system. Please use 'make build.macos', 'make build.linux', or 'make build.windows' directly."; \ exit 1; \ fi @@ -67,6 +69,10 @@ build.macos: bin build.linux: bin GOOS=linux GOARCH=amd64 go build -o bin/mass-linux-amd64 -ldflags=${LD_FLAGS} +.PHONY: build.windows +build.windows: bin + GOOS=windows GOARCH=amd64 go build -o bin/mass-windows-amd64.exe -ldflags=${LD_FLAGS} + .PHONY: install.macos install.macos: build.macos rm -f ${INSTALL_PATH}/mass diff --git a/cmd/server.go b/cmd/server.go index 19cf93a9..b516e5f6 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -8,6 +8,7 @@ import ( "os" "os/signal" "path" + "runtime" "strings" "syscall" "time" @@ -127,7 +128,11 @@ func setupLogging(level string) { func handleSignals(ctx context.Context, s *server.BundleServer) { c := make(chan os.Signal, 2) - signal.Notify(c, os.Interrupt, syscall.SIGTERM) + signals := []os.Signal{os.Interrupt} + if runtime.GOOS != "windows" { + signals = append(signals, syscall.SIGTERM) + } + signal.Notify(c, signals...) go func(s *server.BundleServer) { for sig := range c { slog.Info("Shutting down", "signal", sig) From 86fda89445872fd8aac1851995eec033e722aabb Mon Sep 17 00:00:00 2001 From: David Nite Date: Thu, 5 Mar 2026 07:20:38 -0700 Subject: [PATCH 2/2] fix: normalize bundle paths to forward slashes for Windows publish Use filepath.ToSlash so OCI layer paths use / on all platforms. Fixes deployment error 'cd: bundle/src: No such file or directory' when bundles are published from Windows and extracted on Linux. Made-with: Cursor --- pkg/bundle/publish.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/bundle/publish.go b/pkg/bundle/publish.go index 31b44d34..565c2a05 100644 --- a/pkg/bundle/publish.go +++ b/pkg/bundle/publish.go @@ -44,6 +44,7 @@ func (p *Publisher) PackageBundle(ctx context.Context, bundleDir string, tag str if err != nil { return err } + bundleRelativePath = filepath.ToSlash(bundleRelativePath) if ignoreMatcher != nil && ignoreMatcher.MatchesPath(bundleRelativePath) { return nil