diff --git a/component/golang/buildout.cfg b/component/golang/buildout.cfg index ff894d11ee8d02bfd35a35dfd6bb97f6256de01a..70d2e49ffa538890fd0268656b5810dd61bc2b17 100644 --- a/component/golang/buildout.cfg +++ b/component/golang/buildout.cfg @@ -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 ---- @@ -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) diff --git a/component/golang/goenv.sh.in b/component/golang/goenv.sh.in index 128338fc9f6be33769d3d81162030febbb6c8da5..fb763b7013d9643a65813d52d9cbe9a18d90f73d 100644 --- a/component/golang/goenv.sh.in +++ b/component/golang/goenv.sh.in @@ -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%:} diff --git a/component/helloweb/buildout.cfg b/component/helloweb/buildout.cfg index 4162732e3814587e4c4d9c6b958487eef13c2fde..0ae511f52a7a8a26487e742ce553472a0d1af38e 100644 --- a/component/helloweb/buildout.cfg +++ b/component/helloweb/buildout.cfg @@ -25,7 +25,7 @@ parts = install = lab.nexedi.com/nexedi/helloweb/go/... -golang = ${golang1.15:location} +golang = ${golang1.16:location} # -*- go -*- [helloweb-go]