Skip to content

Commit

Permalink
Ignore purego build constraint
Browse files Browse the repository at this point in the history
`purego` is a proposed[1] de-facto build constraint to
denote building _only_ Go code.

We must ignore this constraint to make sure that files
that toggle on `purego` are added to the Bazel target
`srcs` and let the compiler decide if they should be
compiled or not.

[1]: golang/go#23172
  • Loading branch information
mattyclarkson committed Mar 28, 2024
1 parent de6bd68 commit 9364538
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion language/go/build_constraints.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func matchAuto(tokens []string) (*buildTags, error) {
// build constraints for a file and will instead defer to the compiler at compile
// time.
func isIgnoredTag(tag string) bool {
if tag == "cgo" || tag == "race" || tag == "msan" {
if tag == "cgo" || tag == "purego" || tag == "race" || tag == "msan" {
return true
}
if len(tag) < 5 || !strings.HasPrefix(tag, "go") {
Expand Down

0 comments on commit 9364538

Please sign in to comment.