fix(runner): guard microVM launcher Pdeathsig behind a linux build tag (RIG-3213) - #848
Open
rigel-mintaka wants to merge 2 commits into
Open
fix(runner): guard microVM launcher Pdeathsig behind a linux build tag (RIG-3213)#848rigel-mintaka wants to merge 2 commits into
rigel-mintaka wants to merge 2 commits into
Conversation
…g (RIG-3213)
`launch.go` is tagged `//go:build unix` (which includes darwin) yet named
`syscall.SysProcAttr{Pdeathsig: syscall.SIGTERM}` directly. `Pdeathsig`
(PR_SET_PDEATHSIG) is a Linux-only field, so any darwin compile of the
microvm package failed:
launch.go:298:43: unknown field Pdeathsig in struct literal of type
syscall.SysProcAttr
Latent until now — main's darwin gate does not compile microvm — but
restructured build tags pull microvm into the darwin compile of
`./cmd/compass-app`, exposing it, and it traps any future PR that
compiles microvm on darwin.
Extract the SysProcAttr construction into a platform helper:
- `orphanguard_linux.go` (`//go:build linux`) sets Pdeathsig (behavior
byte-identical to today).
- `orphanguard_other.go` (`//go:build unix && !linux`) returns nil — no
PR_SET_PDEATHSIG equivalent on darwin. The launcher only runs for real
on Linux/KVM and teardown correctness rests on Shutdown, not the guard
(record §(g)), so the darwin no-op loses nothing that matters.
`launch.go` calls the helper instead of naming the Linux-only field, so
the unix-tagged package cross-compiles on darwin.
Verified: `GOOS=darwin GOARCH=arm64 go build ./internal/runtime/microvm/`
was red, now green; linux build (plain + `-tags microvm`) green; untagged
microvm unit tests pass; full lint 0 issues; nilaway clean.
Refs RIG-3213, RIG-2591
Co-authored-by: Matt Wilkinson <matt@rigel.build>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Compass engineering docs preview: https://compass-runner-rig-3213-darw.compass-eng-docs.pages.dev Deployed from |
…213) Rename the two orphan-guard platform files so their build constraint lives solely in the explicit //go:build tag, not split across a tag and a GOOS filename suffix: - orphanguard_linux.go -> orphanguard_pdeathsig.go (//go:build linux) - orphanguard_other.go -> orphanguard_noop.go (//go:build unix && !linux) `_linux.go` carried an implicit `//go:build linux` constraint from its GOOS suffix on top of the explicit tag; the companion `_other.go` relied on the explicit tag alone (no single GOOS suffix expresses "all non-linux unix"). Using one mechanism for both — explicit tags, descriptive names — is the consistency the split was meant to express. Content is unchanged; the partition is identical (linux+android -> pdeathsig helper; other unix -> noop helper). Refs RIG-3213 Co-authored-by: Matt Wilkinson <matt@rigel.build>
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.
launch.gois tagged//go:build unix(which includes darwin) yet namedsyscall.SysProcAttr{Pdeathsig: syscall.SIGTERM}directly.Pdeathsig(PR_SET_PDEATHSIG) is a Linux-only field, so any darwin compile of the
microvm package failed:
Latent until now — main's darwin gate does not compile microvm — but
restructured build tags pull microvm into the darwin compile of
./cmd/compass-app, exposing it, and it traps any future PR thatcompiles microvm on darwin.
Extract the SysProcAttr construction into a platform helper:
orphanguard_linux.go(//go:build linux) sets Pdeathsig (behaviorbyte-identical to today).
orphanguard_other.go(//go:build unix && !linux) returns nil — noPR_SET_PDEATHSIG equivalent on darwin. The launcher only runs for real
on Linux/KVM and teardown correctness rests on Shutdown, not the guard
(record §(g)), so the darwin no-op loses nothing that matters.
launch.gocalls the helper instead of naming the Linux-only field, sothe unix-tagged package cross-compiles on darwin.
Verified:
GOOS=darwin GOARCH=arm64 go build ./internal/runtime/microvm/was red, now green; linux build (plain +
-tags microvm) green; untaggedmicrovm unit tests pass; full lint 0 issues; nilaway clean.
Refs RIG-3213, RIG-2591
Co-authored-by: Matt Wilkinson matt@rigel.build