Skip to content

Add Windows support for disk-space pre-check and other Unix-only packages #520

@aftersnow

Description

@aftersnow

Context

PR #471 adds a disk-space pre-check for build and pull operations that uses golang.org/x/sys/unix (unix.Statfs). To unblock the PR without delaying the feature on Linux/Darwin, the diskspace package is currently limited via //go:build linux || darwin, with a no-op stub (check_other.go) that keeps non-Unix platforms compiling but skips the check.

This issue tracks the follow-up work to bring native Windows support to that pre-check, and incidentally to the rest of the project.

What's Unix-only today

Cross-compiling the repo (GOOS=windows GOARCH=amd64 go build ./...) surfaces more than just diskspace:

  • pkg/diskspace — statfs-based available-space check (now stubbed on Windows after feat: add disk space pre-check for build and pull #471)
  • pkg/xattrunix.Getxattr / unix.Setxattr for extended attributes
  • pkg/version — references an undefined platform symbol on Windows
  • Likely others not yet surveyed

Proposed Work

  1. pkg/diskspace: add check_windows.go using windows.GetDiskFreeSpaceEx (from golang.org/x/sys/windows) instead of statfs; drop the stub once this lands
  2. pkg/xattr: decide whether xattrs make sense on Windows (NTFS alternate data streams?) or explicitly document the limitation
  3. pkg/version: fix the undefined platform reference on non-Unix builds
  4. Add a CI job that runs GOOS=windows GOARCH=amd64 go build ./... to prevent regressions

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions