Skip to content

Commit 7ece5da

Browse files
committed
cmd/release: set the minimum macOS version supported by Go 1.13
Set the minmacos version depending on the version of go being packaged for macOS releases. Removed support for Go 1.12 since it is no longer supported. Fixes golang/go#36846 Updates golang/go#35459 Change-Id: Ifb9a0296fde5ed87da72d7719a714744484cc7db Reviewed-on: https://go-review.googlesource.com/c/build/+/221100 Run-TryBot: Carlos Amedee <carlos@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org>
1 parent 5b56222 commit 7ece5da

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

cmd/release/release.go

+5-11
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,7 @@ func (b *Build) make() error {
332332
}
333333

334334
// Issues #36025 #35459
335-
// TODO (amedee): remove check for go1.14 once #36845 and #36846 are resolved.
336-
if b.OS == "darwin" && b.Arch == "amd64" && strings.HasPrefix(*version, "go1.14") {
335+
if b.OS == "darwin" && b.Arch == "amd64" {
337336
minMacVersion := minSupportedMacOSVersion(*version)
338337
env = append(env, fmt.Sprintf("CGO_CFLAGS=-mmacosx-version-min=%s", minMacVersion))
339338
}
@@ -886,22 +885,17 @@ func setGOARCH(env []string, goarch string) []string {
886885
}
887886

888887
// minSupportedMacOSVersion provides the minimum supported macOS
889-
// version (of the form N.M) for each version of Go >= go1.12.
888+
// version (of the form N.M) for supported Go versions.
890889
func minSupportedMacOSVersion(goVer string) string {
891890
// TODO(amedee): Use a version package to compare versions of Go.
892891

893892
// The minimum supported version of macOS with each version of go:
894-
// go1.12 - macOS 10.10
895893
// go1.13 - macOS 10.11
896894
// go1.14 - macOS 10.11
897895
// go1.15 - macOS 10.12
898-
minMacVersion := "10.11"
899-
if strings.HasPrefix(goVer, "go1.12.") {
900-
minMacVersion = "10.10"
901-
return minMacVersion
902-
}
903-
if strings.HasPrefix(goVer, "go1.15") {
904-
minMacVersion = "10.12"
896+
minMacVersion := "10.12"
897+
if strings.HasPrefix(goVer, "go1.13") || strings.HasPrefix(goVer, "go1.14") {
898+
minMacVersion = "10.11"
905899
return minMacVersion
906900
}
907901
return minMacVersion

cmd/release/release_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ func TestMinSupportedMacOSVersion(t *testing.T) {
2525
goVer string
2626
wantMacOS string
2727
}{
28-
{"patch_release_12", "go1.12.1", "10.10"},
2928
{"minor_release_13", "go1.13", "10.11"},
3029
{"minor_release_14", "go1.14", "10.11"},
3130
{"rc_release_13", "go1.13rc1", "10.11"},

0 commit comments

Comments
 (0)