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.
ci/agent/gitcache.go +4−5
| @@ -25,7 +25,6 @@ import ( | |||
| 25 | 25 | "path/filepath" | |
| 26 | 26 | "sort" | |
| 27 | 27 | "strings" | |
| 28 | "syscall" | ||
| 29 | 28 | "time" | |
| 30 | 29 | ||
| 31 | 30 | "rodent.software/vole/internal/format" | |
| @@ -60,12 +59,12 @@ func lockCache(cache, repo string) (func(), error) { | |||
| 60 | 59 | if err != nil { | |
| 61 | 60 | return nil, err | |
| 62 | 61 | } | |
| 63 | if err := syscall.Flock(int(f.Fd()), syscall.LOCK_EX); err != nil { | ||
| 62 | if err := lockExclusive(f, false); err != nil { | ||
| 64 | 63 | _ = f.Close() | |
| 65 | 64 | return nil, fmt.Errorf("lock the saved checkout of %s: %w", repo, err) | |
| 66 | 65 | } | |
| 67 | 66 | return func() { | |
| 68 | _ = syscall.Flock(int(f.Fd()), syscall.LOCK_UN) | ||
| 67 | _ = unlockFile(f) | ||
| 69 | 68 | _ = f.Close() | |
| 70 | 69 | }, nil | |
| 71 | 70 | } | |
| @@ -78,12 +77,12 @@ func tryLockCache(cache, repo string) (func(), bool) { | |||
| 78 | 77 | if err != nil { | |
| 79 | 78 | return nil, false | |
| 80 | 79 | } | |
| 81 | if err := syscall.Flock(int(f.Fd()), syscall.LOCK_EX|syscall.LOCK_NB); err != nil { | ||
| 80 | if err := lockExclusive(f, true); err != nil { | ||
| 82 | 81 | _ = f.Close() | |
| 83 | 82 | return nil, false | |
| 84 | 83 | } | |
| 85 | 84 | return func() { | |
| 86 | _ = syscall.Flock(int(f.Fd()), syscall.LOCK_UN) | ||
| 85 | _ = unlockFile(f) | ||
| 87 | 86 | _ = f.Close() | |
| 88 | 87 | }, true | |
| 89 | 88 | } | |