Skip to content

fix(runner): guard microVM launcher Pdeathsig behind a linux build tag (RIG-3213) - #848

Open
rigel-mintaka wants to merge 2 commits into
mainfrom
compass-runner/rig-3213-darwin-pdeathsig
Open

fix(runner): guard microVM launcher Pdeathsig behind a linux build tag (RIG-3213)#848
rigel-mintaka wants to merge 2 commits into
mainfrom
compass-runner/rig-3213-darwin-pdeathsig

Conversation

@rigel-mintaka

Copy link
Copy Markdown
Contributor

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

…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>
@linear-code

linear-code Bot commented Sep 3, 2026

Copy link
Copy Markdown

RIG-3213

RIG-2591

@trunk-io

trunk-io Bot commented Sep 3, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

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

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-runner-rig-3213-darw.compass-eng-docs.pages.dev

Deployed from compass-runner/rig-3213-darwin-pdeathsig at 8a2d5cb.

…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>
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