Skip to content

Commit 9f40f9f

Browse files
committed
cmd/dist: remove darwin/386, darwin/arm as valid ports
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Filippo Valsorda <[email protected]>
1 parent fff7509 commit 9f40f9f

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

src/cmd/api/goapi.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ var contexts = []*build.Context{
6060
{GOOS: "linux", GOARCH: "amd64"},
6161
{GOOS: "linux", GOARCH: "arm", CgoEnabled: true},
6262
{GOOS: "linux", GOARCH: "arm"},
63-
{GOOS: "darwin", GOARCH: "386", CgoEnabled: true},
64-
{GOOS: "darwin", GOARCH: "386"},
6563
{GOOS: "darwin", GOARCH: "amd64", CgoEnabled: true},
6664
{GOOS: "darwin", GOARCH: "amd64"},
6765
{GOOS: "windows", GOARCH: "amd64"},
@@ -252,6 +250,13 @@ func featureWithoutContext(f string) string {
252250
return spaceParensRx.ReplaceAllString(f, "")
253251
}
254252

253+
// portRemoved reports whether the given port-specific API feature is
254+
// okay to no longer exist because its port was removed.
255+
func portRemoved(feature string) bool {
256+
return strings.Contains(feature, "(darwin-386)") ||
257+
strings.Contains(feature, "(darwin-386-cgo)")
258+
}
259+
255260
func compareAPI(w io.Writer, features, required, optional, exception []string, allowAdd bool) (ok bool) {
256261
ok = true
257262

@@ -279,6 +284,8 @@ func compareAPI(w io.Writer, features, required, optional, exception []string, a
279284
// acknowledged by being in the file
280285
// "api/except.txt". No need to print them out
281286
// here.
287+
} else if portRemoved(feature) {
288+
// okay.
282289
} else if featureSet[featureWithoutContext(feature)] {
283290
// okay.
284291
} else {

src/cmd/api/goapi_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ func TestCompareAPI(t *testing.T) {
140140
name: "contexts reconverging",
141141
required: []string{
142142
"A",
143-
"pkg syscall (darwin-386), type RawSockaddrInet6 struct",
144143
"pkg syscall (darwin-amd64), type RawSockaddrInet6 struct",
145144
},
146145
features: []string{

src/cmd/dist/build.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,9 +1515,7 @@ func checkNotStale(goBinary string, targets ...string) {
15151515
// by 'go tool dist list'.
15161516
var cgoEnabled = map[string]bool{
15171517
"aix/ppc64": true,
1518-
"darwin/386": false, // Issue 31751
15191518
"darwin/amd64": true,
1520-
"darwin/arm": true,
15211519
"darwin/arm64": true,
15221520
"dragonfly/amd64": true,
15231521
"freebsd/386": true,

src/cmd/go/go_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,9 +1946,9 @@ func TestGenerateUsesBuildContext(t *testing.T) {
19461946
tg.grepStdout("linux amd64", "unexpected GOOS/GOARCH combination")
19471947

19481948
tg.setenv("GOOS", "darwin")
1949-
tg.setenv("GOARCH", "386")
1949+
tg.setenv("GOARCH", "arm64")
19501950
tg.run("generate", "gen")
1951-
tg.grepStdout("darwin 386", "unexpected GOOS/GOARCH combination")
1951+
tg.grepStdout("darwin arm64", "unexpected GOOS/GOARCH combination")
19521952
}
19531953

19541954
func TestGoEnv(t *testing.T) {

0 commit comments

Comments
 (0)