Skip to content
forked from golang/go
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

cmd/dist: remove darwin/386, darwin/arm as valid ports #223

Merged
merged 1 commit into from
Apr 4, 2020
Merged
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
11 changes: 9 additions & 2 deletions src/cmd/api/goapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ var contexts = []*build.Context{
{GOOS: "linux", GOARCH: "amd64"},
{GOOS: "linux", GOARCH: "arm", CgoEnabled: true},
{GOOS: "linux", GOARCH: "arm"},
{GOOS: "darwin", GOARCH: "386", CgoEnabled: true},
{GOOS: "darwin", GOARCH: "386"},
{GOOS: "darwin", GOARCH: "amd64", CgoEnabled: true},
{GOOS: "darwin", GOARCH: "amd64"},
{GOOS: "windows", GOARCH: "amd64"},
Expand Down Expand Up @@ -252,6 +250,13 @@ func featureWithoutContext(f string) string {
return spaceParensRx.ReplaceAllString(f, "")
}

// portRemoved reports whether the given port-specific API feature is
// okay to no longer exist because its port was removed.
func portRemoved(feature string) bool {
return strings.Contains(feature, "(darwin-386)") ||
strings.Contains(feature, "(darwin-386-cgo)")
}

func compareAPI(w io.Writer, features, required, optional, exception []string, allowAdd bool) (ok bool) {
ok = true

Expand Down Expand Up @@ -279,6 +284,8 @@ func compareAPI(w io.Writer, features, required, optional, exception []string, a
// acknowledged by being in the file
// "api/except.txt". No need to print them out
// here.
} else if portRemoved(feature) {
// okay.
} else if featureSet[featureWithoutContext(feature)] {
// okay.
} else {
Expand Down
1 change: 0 additions & 1 deletion src/cmd/api/goapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ func TestCompareAPI(t *testing.T) {
name: "contexts reconverging",
required: []string{
"A",
"pkg syscall (darwin-386), type RawSockaddrInet6 struct",
"pkg syscall (darwin-amd64), type RawSockaddrInet6 struct",
},
features: []string{
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/dist/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -1515,9 +1515,7 @@ func checkNotStale(goBinary string, targets ...string) {
// by 'go tool dist list'.
var cgoEnabled = map[string]bool{
"aix/ppc64": true,
"darwin/386": false, // Issue 31751
"darwin/amd64": true,
"darwin/arm": true,
"darwin/arm64": true,
"dragonfly/amd64": true,
"freebsd/386": true,
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/go/go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1946,9 +1946,9 @@ func TestGenerateUsesBuildContext(t *testing.T) {
tg.grepStdout("linux amd64", "unexpected GOOS/GOARCH combination")

tg.setenv("GOOS", "darwin")
tg.setenv("GOARCH", "386")
tg.setenv("GOARCH", "arm64")
tg.run("generate", "gen")
tg.grepStdout("darwin 386", "unexpected GOOS/GOARCH combination")
tg.grepStdout("darwin arm64", "unexpected GOOS/GOARCH combination")
}

func TestGoEnv(t *testing.T) {
Expand Down