fix: repair free-disk-space build on illumos, Solaris, NetBSD and OpenBSD (#1416)

The runner did not build on illumos, Solaris, NetBSD and OpenBSD: `internal/pkg/disk` called `unix.Statfs`, which `golang.org/x/sys/unix` lacks on illumos, Solaris and NetBSD (they have `statvfs(2)`) and exposes with `F_`-prefixed fields on OpenBSD. Each now has an implementation matching its syscall.

FreeBSD and DragonFly report a negative available-block count once root writes into the reserved blocks. It wrapped to ~16 EiB free, so the disk health check and cache eviction saw plenty of space exactly when the disk was full. A shared helper clamps it to zero and absorbs the per-platform integer types.

CI only built for the host, which let this and https://gitea.com/gitea/runner/pulls/1098 through. `make cross-check` vets code and tests on one target per distinct set of platform files, plus linux/arm for its 32-bit syscall fields, and runs as its own job in parallel to the others. It also surfaced docker-only tests lacking the docker build tag, which are fixed too.

Assisted-by: Claude Code:claude-opus-5-5
Co-authored-by: rosekanari <[email protected]>
This commit is contained in:
rosekanari authored and silverwind committed 2026-11-18 04:20:56 +00:00
1 parent 0e4c8b6b78
commit bcc0b715cd
18 files changed
+122 -17

No files matched your search

+8
View File
@@ -21,6 +21,8 @@ GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/[email protected] # renovate: data
GOTEST_FLAGS ?= -race -timeout 20m -parallel 8
CROSS_TARGETS ?= darwin/arm64 freebsd/amd64 linux/arm netbsd/amd64 openbsd/amd64 solaris/amd64 # one per platform file set, linux/arm for 32-bit syscall fields
STATIC ?=
EXTLDFLAGS ?=
ifneq ($(STATIC),)
@@ -100,6 +102,12 @@ deps-tools: ## install tool dependencies
.PHONY: checks
checks: tidy-check fmt-check security-check ## run the non-lint source checks
.PHONY: cross-check
cross-check: $(addprefix cross-check/,$(CROSS_TARGETS)) ## check that code and tests compile on every supported platform
cross-check/%:
GOOS=$(word 1,$(subst /, ,$*)) GOARCH=$(word 2,$(subst /, ,$*)) CGO_ENABLED=0 $(GO) vet -gcflags='all=-N -l' ./...
.PHONY: lint
lint: lint-go lint-go-windows ## lint everything