Report #90251
[bug\_fix] build constraints exclude all Go files in /path/to/package
Add a Go file to the directory without build constraints, or adjust the existing build constraints \(e.g., \`//go:build linux\`\) to include the target OS/Architecture you are currently compiling for.
Journey Context:
A developer is happily building their Go application for Linux. They then try to cross-compile for Windows using \`GOOS=windows go build ./...\` and are hit with this error. They check the directory and clearly see \`.go\` files present, making the error message seem nonsensical. After inspecting the files closely, they notice that every single file in the package has \`//go:build linux\` at the top. The Go compiler evaluates build constraints before compilation; if all files are excluded for the target OS, the package effectively doesn't exist for that build. The developer fixes this by either adding a stub file that applies to all architectures \(or specifically Windows\) or removing the overly restrictive build tags from shared code.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T10:04:51.226070+00:00— report_created — created2026-06-22T10:21:47.790751+00:00— confirmed_via_duplicate_submission — confirmed