Uh oh!
There was an error while loading. Please reload this page.
fix(resources): make storage-capacity observer link on non-unix targets - #349
Closed
antoinetoussaint-byte wants to merge 1 commit into
Closed
fix(resources): make storage-capacity observer link on non-unix targets#349antoinetoussaint-byte wants to merge 1 commit into
antoinetoussaint-byte wants to merge 1 commit into
Conversation
InspectStorageFilesystem called syscall.Statfs/Statfs_t unconditionally in a tag-free file, so any GOOS without statfs (e.g. windows) failed to *compile* resources — undefined: syscall.Statfs_t. Because agent releases run goreleaser with its default GOOS matrix (linux, darwin, windows), every service-agent release build broke at this file, which is why no agent could be released on core v0.3.8. Split the syscall-dependent implementation behind build tags: the real statfs-backed observer moves to storage_capacity_unix.go (//go:build unix, covers linux/darwin/BSD where Statfs exists), and a //go:build !unix stub returns a clear runtime 'unsupported on <GOOS>' error so the package links everywhere and reports the capability unavailable at run time instead of failing the cross-compile. Portable helpers, types, and InspectStorageTree stay in the shared file. Existing statfs-semantics tests are constrained to unix; a new !unix test locks the stub contract. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
antoinetoussaint-byte
commented
Aug 23, 2026
ContributorAuthor
Superseded by the real fix. Root cause wasn't core portability — it was that two agent repos (service-envoy, service-neo4j) lacked the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
resources/storage_capacity.gocalledsyscall.Statfs/Statfs_tin a build-tag-free file, soresourcesfailed to compile for any GOOS without statfs (e.g.windows):undefined: syscall.Statfs_t.goreleaser releasewith its default GOOS matrix (linux, darwin, windows), so everyservice-*release build broke at this file — this is why no agent could be tagged+released on core v0.3.8 (Bump cli-owned-build agent repos to core v0.3.8 (Go 1.27 + golangci-lint CI fix) cli#452).storage_capacity_unix.go(//go:build unix); a//go:build !unixstub returns a clearunsupported on <GOOS>runtime error so the package links everywhere rather than breaking the cross-compile. Portable code +InspectStorageTreestay shared.Test plan
GOOS=windows GOARCH=amd64 go build ./resources/now succeeds (was the failing target)GOOS=linux/hostgo build ./...clean;go test ./resources/green (unix path unchanged)//go:build !unixtest asserts the stub errors andInspectStorageTreepropagates itgofmtclean; standardgolangci-lintclean on the touched filesThis unblocks the first cross-compile error only. core is effectively Unix-only:
runners/base,code, andrunners/pythonalso fail awindowsbuild (syscall.Kill,SysProcAttr.Setpgid, process groups). The durable fix for agent releases is to constrain the goreleaser matrix togoos: [linux, darwin](the only platforms the codefly loader consumes) rather than guard every unix-only package for a target that is never shipped. Filed as follow-up — see PR discussion.