Skip to content

Commit

Permalink
gopackagesdriver: skip root packages that can't be built
Browse files Browse the repository at this point in the history
  • Loading branch information
jayconrod committed Mar 20, 2024
1 parent aeb83e8 commit 7045ca7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion go/tools/gopackagesdriver/packageregistry.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,18 @@ func (pr *PackageRegistry) Match(labels []string) ([]string, []*FlatPackage) {
roots[pkg.ID] = struct{}{}
}
}
} else {
} else if _, ok := pr.packagesByID[label]; ok {
roots[label] = struct{}{}
// If an xtest package exists for this package add it to the roots
if _, ok := pr.packagesByID[label+"_xtest"]; ok {
roots[label+"_xtest"] = struct{}{}
}
} else {
// Skip a package if we don't have .pkg.json for it.
// This happens if 'bazel query' matches the target, but 'bazel build'
// can't analyze it, for example, if target_compatible_with is set
// with contraints not compatible with the host platform.
continue
}
}

Expand Down

0 comments on commit 7045ca7

Please sign in to comment.