Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

language/go: Add unix as ignored tag. #1551

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 == "race" || tag == "msan" || tag == "unix" {
return true
}
if len(tag) < 5 || !strings.HasPrefix(tag, "go") {
Expand Down
6 changes: 2 additions & 4 deletions language/go/fileinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,6 @@ func matchesOS(os, value string) bool {
if os == value {
return true
}
if value == "unix" {
return rule.UnixOS[os]
}
for _, alias := range rule.OSAliases[os] {
if alias == value {
return true
Expand Down Expand Up @@ -559,7 +556,8 @@ func checkConstraints(c *config.Config, os, arch, osSuffix, archSuffix string, t
if isIgnoredTag(tag) {
return true
}
if _, ok := rule.KnownOSSet[tag]; ok || tag == "unix" {

if _, ok := rule.KnownOSSet[tag]; ok {
if os == "" {
return false
}
Expand Down
17 changes: 0 additions & 17 deletions rule/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,6 @@ var OSAliases = map[string][]string{
"ios": {"darwin"},
}

// UnixOS is the set of GOOS values matched by the "unix" build tag.
// This list is from go/src/cmd/dist/build.go.
var UnixOS = map[string]bool{
"aix": true,
"android": true,
"darwin": true,
"dragonfly": true,
"freebsd": true,
"hurd": true,
"illumos": true,
"ios": true,
"linux": true,
"netbsd": true,
"openbsd": true,
"solaris": true,
}

var (
// KnownOSs is the sorted list of operating systems that Go supports.
KnownOSs []string
Expand Down