Skip to content

feat: windows support — build-tag split for upgrade restart logic, zip-aware extractor, re-add to release matrix #39

Description

@liuooo

Problem

GOOS=windows go build ./... fails on main:

internal/upgrade.go:170:48: unknown field Setsid in struct literal of type syscall.SysProcAttr

internal/upgrade.go uses Unix-only restart logic (exec.Command("sh", "-c", ...) + syscall.SysProcAttr{Setsid: true}) with no build tags, so windows has never actually compiled — the README's former windows cross-compile example was aspirational. PR #38 briefly added windows to the GoReleaser matrix and had to back it out (caught by automated review; the matrix-lockstep guard test added there will fail loudly if one side is changed without the other).

Work needed to ship windows

  1. Split the restart logic the way lock_unix.go / lock_windows.go already are: move the sh -c + Setsid path into upgrade_unix.go (//go:build !windows), add upgrade_windows.go with a real windows restart (or a documented unsupported error)
  2. Make the self-upgrade extractor format-aware: internal/upgrade.go hardcodes upgrade-download.tar.gz and only imports archive/tar; windows release archives would be .zip
  3. Re-add windows to .goreleaser.yaml goos + zip format_overrides, re-add the two win32 pairs to PLATFORMS in npm/scripts/prepare-packages.js (+ shim map and exe handling) — the guard test enforces both sides move together
  4. Extend the CI cross-compile step in ci.yml with windows/amd64, windows/arm64
  5. Consider a windows-latest CI leg that installs and runs the generated npm package end to end
  6. Note: octo-fleet rejects windows remote upgrades in v1 (createDaemonUpgradeTask), so install-only support is shippable before the upgrade path is

Context

Split out of #37 / PR #38 (npm distribution), where windows packages were descoped to keep that PR release-logic-only.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions