Skip to content

test(go): Windows cross-build fails on syscall.Stat_t in daemon preflight #340

Description

@gnanirahulnutakki

Problem

On exact dev commit f9420aa5ee4c788537a9200dd55f55d7c026fa1b, the Go tree does not compile for Windows:

GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go test -c ./cmd/ardur-agent-recognition-benchmark
# github.com/ArdurAI/ardur/go/pkg/kernelcapture
pkg/kernelcapture/daemon_preflight.go:445:36: undefined: syscall.Stat_t

go/pkg/kernelcapture/daemon_preflight.go is untagged and directly type-asserts fs.FileInfo.Sys() to *syscall.Stat_t. That type is Unix-specific. Duplicate searches for the exact symbol and Windows build failure found no existing issue.

Impact

Any command importing pkg/kernelcapture fails before its own platform-specific behavior can be compiled or tested on Windows. This also prevents validating the existing !linux fail-closed implementations across all declared non-Linux targets.

Acceptance criteria

  • Move platform-specific UID/GID extraction behind appropriately constrained files or an equivalent portable abstraction.
  • Preserve current Unix ownership checks and fail-safe defaults (UID/GID = -1) where ownership is unavailable.
  • Add a Windows cross-compilation test for at least pkg/kernelcapture and representative importing commands.
  • Keep Linux and macOS unit/race coverage green.

Scope and risk

Portability/testability only; do not claim Windows kernel enforcement support. No cloud resource, IAM, secret, or runtime-cost change is expected beyond bounded CI minutes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions