Commit cdca92ee authored by Levin Zimmermann's avatar Levin Zimmermann

golang: Add go version 1.20

We should upgrade to Go 1.20, because Go 1.18 is already no longer supported.
("Each major Go release is supported until there are two newer major releases" [1]).
Go 1.20 is the incremental improvement for earlier go 1.19 release.
We skip Go 1.19, because it's also unsupported as soon as Go 1.21 is
released (this is expected to happen in one month [2]).

Please find all details in the official release note:

    https://go.dev/doc/go1.20

It was released on 2023-02-01 [1]. Due to the go promise of compatibility
most software should still compile without any problems.

We need to differentiate between go before 1.19 and go after 1.19, because
go before 1.19 needs TestSCMCredentials patch, while starting from go
1.19 this patch has been applied upstream [3].

[1] https://go.dev/doc/devel/release
[2] https://tip.golang.org/doc/go1.21
[3] https://github.com/golang/go/commit/f839aaa22b66bc556fac72f7396082212d2ef45d

/reviewed-by @kirr
/reviewed-on nexedi/slapos!1417
parent d3d31613
...@@ -31,17 +31,25 @@ environment = ...@@ -31,17 +31,25 @@ environment =
GOROOT_FINAL=${:location} GOROOT_FINAL=${:location}
${:environment-extra} ${:environment-extra}
# TestChown and TestSCMCredentials currently fail in a user-namespace # TestChown currently fails in a user-namespace
# https://github.com/golang/go/issues/42525 # https://github.com/golang/go/issues/42525
# the patches apply to go >= 1.12 # the patches apply to go >= 1.12
patch-options = -p1 patch-options = -p1
patches = patches =
${:_profile_base_location_}/skip-chown-tests.patch#d4e3c8ef83788fb2a5d80dd75034786f ${:_profile_base_location_}/skip-chown-tests.patch#d4e3c8ef83788fb2a5d80dd75034786f
[golang-common-pre-1.19]
<= golang-common
# TestSCMCredentials fails in a user-namespace if golang version < 1.19
# https://github.com/golang/go/issues/42525
patches +=
${:_profile_base_location_}/fix-TestSCMCredentials.patch#1d8dbc97cd579e03fafd8627d48f1c59 ${:_profile_base_location_}/fix-TestSCMCredentials.patch#1d8dbc97cd579e03fafd8627d48f1c59
[golang14] [golang14]
<= golang-common <= golang-common-pre-1.19
# https://golang.org/doc/install/source#bootstrapFromSource # https://golang.org/doc/install/source#bootstrapFromSource
url = https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz url = https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz
md5sum = dbf727a4b0e365bf88d97cbfde590016 md5sum = dbf727a4b0e365bf88d97cbfde590016
...@@ -64,7 +72,7 @@ setarch = setarch arm ...@@ -64,7 +72,7 @@ setarch = setarch arm
[golang1.12] [golang1.12]
<= golang-common <= golang-common-pre-1.19
url = https://golang.org/dl/go1.12.17.src.tar.gz url = https://golang.org/dl/go1.12.17.src.tar.gz
md5sum = 6b607fc795391dc609ffd79ebf41f080 md5sum = 6b607fc795391dc609ffd79ebf41f080
...@@ -73,7 +81,7 @@ environment-extra = ...@@ -73,7 +81,7 @@ environment-extra =
GOROOT_BOOTSTRAP=${golang14:location} GOROOT_BOOTSTRAP=${golang14:location}
[golang1.16] [golang1.16]
<= golang-common <= golang-common-pre-1.19
url = https://golang.org/dl/go1.16.13.src.tar.gz url = https://golang.org/dl/go1.16.13.src.tar.gz
md5sum = 1c076f952d9af57590a36fa7d36f695a md5sum = 1c076f952d9af57590a36fa7d36f695a
...@@ -82,7 +90,7 @@ environment-extra = ...@@ -82,7 +90,7 @@ environment-extra =
GOROOT_BOOTSTRAP=${golang14:location} GOROOT_BOOTSTRAP=${golang14:location}
[golang1.17] [golang1.17]
<= golang-common <= golang-common-pre-1.19
url = https://golang.org/dl/go1.17.13.src.tar.gz url = https://golang.org/dl/go1.17.13.src.tar.gz
md5sum = 4476707f05cf6915ec1173038dc357a9 md5sum = 4476707f05cf6915ec1173038dc357a9
...@@ -91,7 +99,7 @@ environment-extra = ...@@ -91,7 +99,7 @@ environment-extra =
GOROOT_BOOTSTRAP=${golang14:location} GOROOT_BOOTSTRAP=${golang14:location}
[golang1.18] [golang1.18]
<= golang-common <= golang-common-pre-1.19
url = https://golang.org/dl/go1.18.9.src.tar.gz url = https://golang.org/dl/go1.18.9.src.tar.gz
md5sum = e2caa7c4de49aa77a14c694bfc9a5cd1 md5sum = e2caa7c4de49aa77a14c694bfc9a5cd1
...@@ -102,6 +110,14 @@ md5sum = e2caa7c4de49aa77a14c694bfc9a5cd1 ...@@ -102,6 +110,14 @@ md5sum = e2caa7c4de49aa77a14c694bfc9a5cd1
environment-extra = environment-extra =
GOROOT_BOOTSTRAP=${golang14:location} GOROOT_BOOTSTRAP=${golang14:location}
[golang1.20]
<= golang-common
url = https://go.dev/dl/go1.20.6.src.tar.gz
md5sum = 1dc2d18790cfaede7df1e73a1eff8b7b
# go1.20 requires go1.17.13 to bootstrap (see https://go.dev/doc/go1.20#bootstrap)
environment-extra =
GOROOT_BOOTSTRAP=${golang1.17:location}
# ---- infrastructure to build Go workspaces / projects ---- # ---- infrastructure to build Go workspaces / projects ----
# gowork is the top-level section that defines Go workspace. # gowork is the top-level section that defines Go workspace.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment