Skip to content

feat: add Windows build support#215

Open
dnpbfs wants to merge 2 commits intomassdriver-cloud:mainfrom
dnpbfs:feature/windows-build-support
Open

feat: add Windows build support#215
dnpbfs wants to merge 2 commits intomassdriver-cloud:mainfrom
dnpbfs:feature/windows-build-support

Conversation

@dnpbfs
Copy link

@dnpbfs dnpbfs commented Feb 27, 2026

Summary

Adds Windows as a supported platform for the Mass CLI with full feature parity.

Changes

  • Signal handling (cmd/server.go): Register SIGTERM only on non-Windows so the server runs correctly on Windows (Ctrl+C still triggers graceful shutdown).
  • Goreleaser (.goreleaser.yaml): Add windows-build and windows-archives for Windows amd64 and arm64 binaries in releases.
  • Makefile: Add build.windows target and detect Windows/MINGW in the default build target so make build works in Git Bash and similar environments.

Testing

  • Built and ran mass.exe --help successfully on Windows.
  • No Unix-only code paths; existing filepath and jsonschema loader already handle Windows.

- 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
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Windows as a supported platform for the Mass CLI by adjusting runtime signal handling, local build tooling, and release packaging so Windows binaries can be built and shipped alongside existing Linux/macOS artifacts.

Changes:

  • Update server signal registration to avoid SIGTERM handling on Windows while keeping Ctrl+C graceful shutdown behavior.
  • Extend make build to detect Windows-like shells (MINGW/MSYS) and add a build.windows target.
  • Add Windows amd64/arm64 builds and archives to GoReleaser.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
cmd/server.go Adjust signal handling to be Windows-compatible by only subscribing to SIGTERM on non-Windows.
Makefile Add Windows OS detection for the default build and a build.windows target.
.goreleaser.yaml Add Windows build + archive definitions for release artifacts (amd64/arm64).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +72 to +75
.PHONY: build.windows
build.windows: bin
GOOS=windows GOARCH=amd64 go build -o bin/mass-windows-amd64.exe -ldflags=${LD_FLAGS}

Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build.windows only builds GOARCH=amd64, but release artifacts are configured to build Windows for both amd64 and arm64 in .goreleaser.yaml. Consider either adding a build.windows.arm64 target (or making GOARCH configurable) so local builds match the supported/released architectures.

Suggested change
.PHONY: build.windows
build.windows: bin
GOOS=windows GOARCH=amd64 go build -o bin/mass-windows-amd64.exe -ldflags=${LD_FLAGS}
.PHONY: build.windows build.windows.amd64 build.windows.arm64
build.windows: build.windows.amd64 build.windows.arm64
build.windows.amd64: bin
GOOS=windows GOARCH=amd64 go build -o bin/mass-windows-amd64.exe -ldflags=${LD_FLAGS}
build.windows.arm64: bin
GOOS=windows GOARCH=arm64 go build -o bin/mass-windows-arm64.exe -ldflags=${LD_FLAGS}

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +40
- id: windows-build
binary: mass
env:
- CGO_ENABLED=0
goos:
- windows
goarch:
- amd64
- arm64
ldflags: *build-ldflags
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows artifacts are now part of the release configuration, but the CI workflows only build/test on ubuntu-latest. To avoid shipping broken Windows binaries, add a CI check that at least compiles (and ideally tests) with GOOS=windows / a Windows runner as part of PR validation.

Copilot uses AI. Check for mistakes.
@chrisghill
Copy link
Member

@dnpbfs Thank you for submitting this. We want to do some testing on it before we merge - we've had issues reported with Windows builds in the past. I was hoping to get to it this week, but next week is looking more likely.

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
@dnpbfs
Copy link
Author

dnpbfs commented Mar 5, 2026

@chrisghill

No problem, I'm testing with it as well. Just pushed a change for how Windows pathing is handled, that seems to be only major issue I've encountered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants