aboutsummaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorDmitri Goutnik <dmgk@FreeBSD.org>2021-01-08 14:21:28 +0000
committerDmitri Goutnik <dmgk@FreeBSD.org>2021-01-08 14:21:28 +0000
commit3fdfb0aec1d55c242b46c54e10df5a2d8956d22a (patch)
treed7eabe757ca639c5213176239067024107b0958d /Mk
parent97979b38ebbf8ca2a6b229582d7c043fa70e81b2 (diff)
downloadports-3fdfb0aec1d55c242b46c54e10df5a2d8956d22a.tar.gz
ports-3fdfb0aec1d55c242b46c54e10df5a2d8956d22a.zip
Mk/Uses/go.mk: Explicitly set modules-aware mode depending on "modules" argument
Until now, go.mk relied on default Go behavior of switching to modules-aware mode only in the presence of go.mod and building in legacy ("GOPATH") mode otherwise. This changes with go1.16 [1] which flips defaults to always build in modules-aware mode and needs an explicit GO111MODULE=off to turn modules off. Stop relying on Go defaults and set build mode explicitly depending on "modules" argument in USES=go. [1] https://github.com/golang/go/issues/41330
Notes
Notes: svn path=/head/; revision=560773
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Uses/go.mk4
1 files changed, 3 insertions, 1 deletions
diff --git a/Mk/Uses/go.mk b/Mk/Uses/go.mk
index 9ae5a97a05a2..07a6743054b6 100644
--- a/Mk/Uses/go.mk
+++ b/Mk/Uses/go.mk
@@ -108,12 +108,14 @@ GO_TESTFLAGS+= -mod=vendor
GO_WRKSRC= ${WRKSRC}
GO_ENV+= GOPATH="" \
GOBIN="${GO_WRKDIR_BIN}" \
+ GO111MODULE=on \
GOPROXY=off \
GO_NO_VENDOR_CHECKS=1
.else
GO_WRKSRC= ${WRKDIR}/src/${GO_PKGNAME}
GO_ENV+= GOPATH="${WRKDIR}" \
- GOBIN=""
+ GOBIN="" \
+ GO111MODULE=off
.endif
GO_PORT?= lang/go