Skip to content

fix(release): the windows release build failed on Setsid, not on anything Windows lacks - #512

Merged
linhdmn merged 1 commit into
mainfrom
fix/windows-setsid
Oct 1, 2026
Merged

linhdmn merged 1 commit into
mainfrom
fix/windows-setsid

Conversation

@linhdmn

@linhdmn linhdmn commented Sep 30, 2026

Copy link
Copy Markdown
Member

Every release run since v0.4.161 has failed the same way, on the same line:

cmd/xdev/bg.go:344:30: unknown field Setsid in struct literal of type syscall.SysProcAttr

xdev --bg detaches the print worker with syscall.SysProcAttr{Setsid: true}, and Setsid is Unix-only. bg.go carries no build tag, so GOOS=windows go build ./cmd/xdev does not compile. Both windows jobs in the release matrix (amd64 and arm64) have died at that line on every push to main since the --bg PR (#509) merged.

The fix is the build tag the platform already implies:

  • bg_sysprocattr_unix.go — Setsid: true
  • bg_sysprocattr_windows.go — nil

spawnBg already refused --bg on Windows before this change, with a comment saying Windows needs CREATE_NEW_PROCESS_GROUP + a hidden window. That refusal is unchanged; nil is only there so the package parses. The test moved into a !windows build-tagged file for the same reason — attr.Setsid is a compile error in a windows test binary.

Verified by cross-compiling all six matrix targets, not just the two that were broken — go vet clean for windows/{amd64,arm64}, darwin/{amd64,arm64}, linux/{amd64,arm64}.

Side note: TestSkillPromptBlockEmptyWithoutSkills fails on main too (it reads your global ~/.xdev/agent/skills, so it is not hermetic). Unrelated to this PR and confirmed pre-existing on the base commit.

…hing Windows lacks

`xdev --bg` put the detached print worker in a new session through
syscall.SysProcAttr{Setsid: true}. That field is Unix-only, and bg.go
carried no build tag, so `GOOS=windows go build ./cmd/xdev` did not
compile — the release matrix has shipped a windows/amd64 and a
windows/arm64 job since --bg landed (v0.4.161..v0.4.166), and every one
of those runs died at
`unknown field Setsid in struct literal of type syscall.SysProcAttr`.

Move bgSysProcAttr behind the build tag the platform already implies:
Setsid on Unix, nil on Windows. That is the whole fix — spawnBg still
refuses --bg on Windows (and did before this change, with a comment
saying why), so nil is unreachable there; it exists only so the package
parses.

Verified by cross-compiling all six matrix targets, not just the two that
were broken: go vet is clean for windows/{amd64,arm64},
darwin/{amd64,arm64} and linux/{amd64,arm64}.
@linhdmn
linhdmn merged commit 8bda183 into main Oct 1, 2026
10 checks passed
@linhdmn
linhdmn deleted the fix/windows-setsid branch October 1, 2026 08:44
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.

1 participant