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 authored and fmeum committed Jan 2, 2024
1 parent 5540b97 commit 160ef8d
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 @@ -116,12 +116,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 160ef8d

Please sign in to comment.