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

+10 -5
View File
@@ -16,8 +16,13 @@ import (
"gitea.com/gitea/runner/act/common"
"github.com/moby/moby/api/types/system"
"github.com/moby/moby/client"
)
func GetDockerClient(context.Context) (client.APIClient, error) {
return nil, errors.ErrUnsupported
}
func IsolatedCacheContainer(context.Context, netip.Addr, string) (string, error) {
return "", nil
}
@@ -25,13 +30,13 @@ func IsolatedCacheContainer(context.Context, netip.Addr, string) (string, error)
// ImageExistsLocally returns a boolean indicating if an image with the
// requested name, tag and architecture exists in the local docker image store
func ImageExistsLocally(ctx context.Context, imageName, platform string) (bool, error) {
return false, errors.New("Unsupported Operation")
return false, errors.ErrUnsupported
}
// RemoveImage removes image from local store, the function is used to run different
// container image architectures
func RemoveImage(ctx context.Context, imageName string, force, pruneChildren bool) (bool, error) {
return false, errors.New("Unsupported Operation")
return false, errors.ErrUnsupported
}
func RemoveDockerJobResources(_ context.Context, _ string) error {
@@ -43,20 +48,20 @@ func NewDockerProxy(_ context.Context, _ string) *DockerProxy {
}
func StartDockerProxy(daemonSocket, dir, job string) (*DockerProxy, error) {
return nil, errors.New("Unsupported Operation")
return nil, errors.ErrUnsupported
}
// NewDockerBuildExecutor function to create a run executor for the container
func NewDockerBuildExecutor(input NewDockerBuildExecutorInput) common.Executor {
return func(ctx context.Context) error {
return errors.New("Unsupported Operation")
return errors.ErrUnsupported
}
}
// NewDockerPullExecutor function to create a run executor for the container
func NewDockerPullExecutor(input NewDockerPullExecutorInput) common.Executor {
return func(ctx context.Context) error {
return errors.New("Unsupported Operation")
return errors.ErrUnsupported
}
}