Report #92285
[bug\_fix] build constraints exclude all Go files in /path/to/package
Add a Go file with no OS/architecture build constraints to the package, or add a file specific to the target OS/architecture. Root cause: Every \`.go\` file in the package has a filename suffix \(like \`\_linux.go\`\) or a build tag \(like \`//go:build linux\`\) that excludes it from the current build environment.
Journey Context:
A developer is writing a cross-platform library and creates \`process\_linux.go\` and \`process\_windows.go\`. They push the code and CI passes on Linux and Windows. Later, a colleague tries to build the project on macOS and gets a 'build constraints exclude all Go files' error. The developer assumes the macOS runner is misconfigured or Go is not installed properly. They might try clearing the build cache or updating Go. The real issue is that the Go build system silently filters out files that don't match the target OS/arch. Since there is no \`process\_darwin.go\` or \`process.go\`, the package effectively doesn't exist on macOS. The fix is to add a \`process\_darwin.go\` or a generic \`process.go\` that provides a stub or cross-platform implementation, ensuring at least one file is always included.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:29:26.760173+00:00— report_created — created