Skip to content

Commit

Permalink
golang: v↑ go1.16
Browse files Browse the repository at this point in the history
Go1.16 is incremental improvement over Go1.15 with better and faster compiler,
runtime and module-mode improvements:

https://blog.golang.org/go1.16
https://golang.org/doc/go1.16

Since this Go release switches GO111MODULE default from "auto" to "on", but we
still have in-tree GOPATH-mode uses, add GO111MODULE=auto to our goenv.sh to
preserve previous behaviour for now.

Don't drop support for Go1.14, Go1.13, Go1.12 yet, as that no longer supported
Go releases are still being used by in-tree components(*).

Remain default at Go1.15 yet.

Switch helloworld to Go1.16 and test this patch on that
software-release.

(*) theia, caddy, galene, replication-manager, restic, gitlab and grafana
  • Loading branch information
navytux committed Feb 26, 2021
1 parent 51de7ab commit c283c1d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
11 changes: 10 additions & 1 deletion component/golang/buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ md5sum = 7e4b8580bfe25ffc51501b1dc3d2d8ce
environment-extra =
GOROOT_BOOTSTRAP=${golang14:location}

[golang1.16]
<= golang-common
url = https://golang.org/dl/go1.16.src.tar.gz
md5sum = b767f7e81d886b4208874ea953db2ce3

# go1.16 needs go1.4 to bootstrap
environment-extra =
GOROOT_BOOTSTRAP=${golang14:location}


# ---- infrastructure to build Go workspaces / projects ----

Expand Down Expand Up @@ -133,7 +142,7 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/goenv.sh.in
output = ${gowork:directory}/env.sh
depends = ${gowork.mkdir:recipe}
md5sum = f89553711ea95ad1f6727b76747a62bf
md5sum = 09c229292b341da0de933f5900de7011

[gowork.mkdir]
# NOTE do not use slapos.cookbook:mkdirectory here - if anything in software (not instance)
Expand Down
4 changes: 4 additions & 0 deletions component/golang/goenv.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export PS1="(`basename $X`) $PS1"
export GOCACHE=$X/cache
export GOENV=$X/goenv

# by default make go run in module-aware mode only if go.mod is present, and in GOPATH-mode otherwise.
# (we still have some GOPATH uses; TODO -> default to "on" after GOPATH-mode usage is gone)
export GO111MODULE=auto

# strip trailing : from $GOPATH, $PKG_CONFIG_PATH
GOPATH=$${GOPATH%:}
PKG_CONFIG_PATH=$${PKG_CONFIG_PATH%:}
2 changes: 1 addition & 1 deletion component/helloweb/buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ parts =
install =
lab.nexedi.com/nexedi/helloweb/go/...

golang = ${golang1.15:location}
golang = ${golang1.16:location}

# -*- go -*-
[helloweb-go]
Expand Down

0 comments on commit c283c1d

Please sign in to comment.