Skip to content

Conversation

@hiroTamada
Copy link
Contributor

@hiroTamada hiroTamada commented Jan 14, 2026

Summary

  • Move syscall.Stat_t usage to platform-specific files (stat_unix.go, stat_windows.go)
  • On Windows, getFileOwnership() returns 0, 0 as UID/GID are Unix concepts

Context

The CLI's GoReleaser build was failing when cross-compiling for Windows:

build failed: # github.com/kernel/hypeman-go/lib
lib/cp.go:186:42: undefined: syscall.Stat_t
target=windows_amd64_v1

This fix allows the SDK to be cross-compiled for Windows targets.

Test plan

  • go build ./... passes on Unix
  • GOOS=windows GOARCH=amd64 go build ./... passes
  • go test ./... passes

Note

Makes file ownership retrieval OS-specific to unblock Windows builds.

  • Introduces getFileOwnership with stat_unix.go (uses syscall.Stat_t) and stat_windows.go (returns 0, 0)
  • Updates cp.go to call getFileOwnership when Archive is set and removes direct syscall dependency
  • Resolves Windows cross-compilation error due to syscall.Stat_t being undefined

Written by Cursor Bugbot for commit fd74c45. This will update automatically on new commits. Configure here.

Move syscall.Stat_t usage to platform-specific files since it's
Unix-only. On Windows, getFileOwnership() returns 0, 0 as UID/GID
are Unix concepts.

This allows the SDK to be cross-compiled for Windows targets.
@hiroTamada hiroTamada merged commit b1a0d42 into main Jan 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants