svn commit: r560773 - head/Mk/Uses

Dmitri Goutnik dmgk at FreeBSD.org
Fri Jan 8 14:21:29 UTC 2021


Author: dmgk
Date: Fri Jan  8 14:21:28 2021
New Revision: 560773
URL: https://svnweb.freebsd.org/changeset/ports/560773

Log:
  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

Modified:
  head/Mk/Uses/go.mk

Modified: head/Mk/Uses/go.mk
==============================================================================
--- head/Mk/Uses/go.mk	Fri Jan  8 13:53:14 2021	(r560772)
+++ head/Mk/Uses/go.mk	Fri Jan  8 14:21:28 2021	(r560773)
@@ -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


More information about the svn-ports-head mailing list