-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Background
The pkg/diskspace package introduced in #471 uses golang.org/x/sys/unix (unix.Statfs) to check available disk space. This makes the package Unix-only and will cause compilation failures on Windows.
Current State
pkg/diskspace/check.goimportsgolang.org/x/sys/unixwithout a build constraint- Other packages in the project (e.g.,
pkg/xattr) also use Unix-specific syscalls - The project currently only targets Linux and macOS in CI/release
Proposed Change
- Add
//go:build unixconstraint tocheck.go(rename tocheck_unix.go) - Create
check_other.gowith//go:build !unixthat returnsnil(no-op on unsupported platforms) - This allows the project to compile on Windows without breaking the disk space check on Unix
Priority
Low — the project does not currently support Windows, but adding build constraints is good practice for future portability.
Related
- PR feat: add disk space pre-check for build and pull #471 (feat: add disk space pre-check for build and pull)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels