Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Build the tree for Windows and name the platform seams

215f8aebc38e69e621eb6f739e0cfea2ba07fd9a · Keenan Nemetz · 2d ago · parent 416739b1

Build the tree for Windows and name the platform seams

`go build` for windows/amd64 failed on five unix syscall uses, and the tree had
nowhere to say what a platform can and cannot do. Each unix-only site now lives
in a `_unix.go` file with a Windows counterpart: disk capacity through
GetDiskFreeSpaceEx, allocated bytes through GetCompressedFileSize, hard-link
identity through GetFileInformationByHandle, the runner's cache lock through
LockFileEx, a liveness probe through OpenProcess, and a command's process group
through a helper that has no group to signal yet.

Two sites cannot be ported without weakening them, so they refuse rather than
pretend. File modes are a unix control and Windows needs ACLs instead, so
`internal/secure` will not create or accept a secret there, and `internal/audit`
will not verify a log it cannot check. The front door says the same about exec,
which Windows does not have: sshd gets an explanation instead of a process that
returns EWINDOWS.

A CI step cross-compiles windows/amd64 and vets it, and `go vet` is what
type-checks the test files that `go build` skips, so a unix-only call fails a
push instead of a port nobody can start.

Part of 01M8S9B86B36PE0MY8MMCRCMYA.

server/integration_test.go +3−4

@@ -20,7 +20,6 @@ import (
20 20 "runtime/debug"
21 21 "strings"
22 22 "sync"
23 "syscall"
24 23 "testing"
25 24 "time"
26 25
@@ -3353,7 +3352,7 @@ jobs:
3353 3352 t.Fatal(err)
3354 3353 }
3355 3354 defer func() {
3356 _ = syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL)
3355 _ = killRunnerTree(cmd)
3357 3356 _, _ = cmd.Process.Wait()
3358 3357 }()
3359 3358
@@ -3593,14 +3592,14 @@ jobs:
3593 3592
3594 3593 first := f.runnerCmd(t, "--dir", t.TempDir())
3595 3594 first.Env = f.ciEnv()
3596 first.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
3595 ownProcessGroup(first)
3597 3596 first.Stderr = io.Discard
3598 3597 if err := first.Start(); err != nil {
3599 3598 t.Fatal(err)
3600 3599 }
3601 3600 // It must actually own the job before we kill it, or the test proves nothing.
3602 3601 f.waitForRun(t, 20*time.Second, func(r *runs.Run) bool { return r.Status == runs.StatusRunning })
3603 _ = syscall.Kill(-first.Process.Pid, syscall.SIGKILL)
3602 _ = killRunnerTree(first)
3604 3603 _, _ = first.Process.Wait()
3605 3604
3606 3605 // The lease expires and the janitor puts the job back.