fix(release): the windows release build failed on Setsid, not on anything Windows lacks - #512
Merged
Merged
Conversation
…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
force-pushed
the
fix/windows-setsid
branch
from
September 30, 2026 17:51
1b6c417 to
cfd045f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every release run since v0.4.161 has failed the same way, on the same line:
xdev --bgdetaches the print worker withsyscall.SysProcAttr{Setsid: true}, andSetsidis Unix-only.bg.gocarries no build tag, soGOOS=windows go build ./cmd/xdevdoes not compile. Both windows jobs in the release matrix (amd64 and arm64) have died at that line on every push to main since the--bgPR (#509) merged.The fix is the build tag the platform already implies:
bg_sysprocattr_unix.go—Setsid: truebg_sysprocattr_windows.go—nilspawnBgalready refused--bgon Windows before this change, with a comment saying Windows needsCREATE_NEW_PROCESS_GROUP+ a hidden window. That refusal is unchanged;nilis only there so the package parses. The test moved into a!windowsbuild-tagged file for the same reason —attr.Setsidis a compile error in a windows test binary.Verified by cross-compiling all six matrix targets, not just the two that were broken —
go vetclean forwindows/{amd64,arm64},darwin/{amd64,arm64},linux/{amd64,arm64}.Side note:
TestSkillPromptBlockEmptyWithoutSkillsfails onmaintoo (it reads your global~/.xdev/agent/skills, so it is not hermetic). Unrelated to this PR and confirmed pre-existing on the base commit.