]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: remove darwin/386, darwin/arm as valid ports
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 3 Apr 2020 05:44:25 +0000 (22:44 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sat, 4 Apr 2020 16:49:40 +0000 (16:49 +0000)
This only removes the ability to build it, and removes it as a
src/buildall.bash target (which uses go tool dist list).

Now:

$ go tool dist list | grep ^darwin
darwin/amd64
darwin/arm64

After this, remaining is removing leftover port--specific code in the
tree.

Updates #37610
Updates #37611

Change-Id: I00f03b2355c2e152f75e57abd3063be243529d2d
Reviewed-on: https://go-review.googlesource.com/c/go/+/226985
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
src/cmd/api/goapi.go
src/cmd/api/goapi_test.go
src/cmd/dist/build.go
src/cmd/go/go_test.go

index 55f3e109916d542a932609e4495419c65dfebc08..9874b29292ce72bbcae567acf3f7c55849cb6e22 100644 (file)
@@ -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"},
@@ -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
 
@@ -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 {
index 282f26f708f1d472f4b1fd855f1e71eb663afd3c..eaccc5ceb53dd308a2d69aab8a417e65bb30c027 100644 (file)
@@ -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{
index 62e00b0856fa6a8dd630b4e7f6e637b97663442d..ab55a98b745512a7740719347775500d5ee36b48 100644 (file)
@@ -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,
index d446e457b5a14e86d972576e91eb0ce500da345c..33c3f48f8550dc59622ac51ee9d8896bdcf56b74 100644 (file)
@@ -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) {