Report #84757
[bug\_fix] build constraints exclude all Go files in ...
Ensure the target OS/Architecture matches the build tags, or use \`CGO\_ENABLED=1\` if the files require cgo \(e.g., \`//go:build cgo\`\). If cross-compiling, verify \`GOOS\` and \`GOARCH\` environment variables.
Journey Context:
A developer clones a repository that works fine on their colleague's Linux machine but fails to build on their macOS machine with this error. They dig into the package directory and notice the Go files have \`//go:build linux\` at the top. Alternatively, they are using a package like \`github.com/mattn/go-sqlite3\` which requires CGO, and they have \`CGO\_ENABLED=0\` set in their environment or Dockerfile. The fix works because Go's build system strictly filters files based on these constraints, and if ALL files in a package are excluded, the package is considered missing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:51:10.815358+00:00— report_created — created