JuliusBrussee/caveman · error
windows-only process query on
Error message
windows-only process query on %s build
What it means
This is the non-Windows build stub for processExecutableWindows. The real Windows implementation lives behind a build tag; on other platforms this stub always returns an error so non-Windows builds compile without the x/sys/windows import. It is unreachable at runtime because processExecutable checks runtime.GOOS first.
Solutions
- Do not call processExecutableWindows directly; go through processExecutable which gates on runtime.GOOS
- Put windows-only callers in _windows.go files so they never compile elsewhere
- Guard new call sites with runtime.GOOS == "windows"
Defensive patterns
Strategy: fallback
Validate before calling
if runtime.GOOS != "windows" { // never call processExecutableWindows off-Windows
return "", nil
} Try / catch
exe, err := processExecutableWindows(pid)
if err != nil {
return fmt.Errorf("identity unavailable on this build: %w", err)
} Prevention
- Route all identity queries through processExecutable
- Keep windows-only code in _windows.go files
- Never bypass the runtime.GOOS gate
- Cover non-Windows builds in CI
When it happens
Trigger: Only reachable if the runtime.GOOS=='windows' guard in processExecutable is bypassed — e.g. calling processExecutableWindows directly in tests or new code on a non-Windows build.
Common situations: Unit tests on Linux/macOS that call the windows-only helper directly, or new callers skipping the GOOS check.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
- cannot safely launch non-Node Windows command shim
- cannot safely launch non-Node Windows command shim
- cannot safely launch non-Node Windows command shim
- cannot safely launch non-Node Windows command shim
- cannot safely launch Windows command shim
AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20).
Data as JSON: /api/errors/70f9321a570d465e.
Report an issue: GitHub.
Appendix: source
Thrown at proxy/internal/runstate/runstate_notwindows.go:10
//go:build !windows
package runstate
import "fmt"
// processExecutableWindows is only reachable behind a runtime.GOOS check; this
// stub keeps non-Windows builds compiling without the x/sys/windows import.
func processExecutableWindows(int) (string, error) {
return "", fmt.Errorf("windows-only process query on %s build", "non-windows")
}
View on GitHub (pinned to 3ee70a1026)