diff options
author | Dmitri Goutnik <dmgk@FreeBSD.org> | 2020-03-02 13:58:40 +0000 |
---|---|---|
committer | Dmitri Goutnik <dmgk@FreeBSD.org> | 2020-03-02 13:58:40 +0000 |
commit | c507f19c22fe56bc2db282c3cc3f5958313cd694 (patch) | |
tree | 8c02a29c80f012a775ef47d5038d27c143ba9648 /Mk | |
parent | a77110a83e6829fc43e92f678ea89ac9a877bc4f (diff) | |
download | ports-c507f19c22fe56bc2db282c3cc3f5958313cd694.tar.gz ports-c507f19c22fe56bc2db282c3cc3f5958313cd694.zip |
Mk/Uses/go.mk: Avoid pollution of Go module cache with modules downloaded by gomod-vendor
Use module cache local to the WRKDIR and add the -modcacherw flag (available in
go1.14 [1, 2]) to instruct go mod vendor to leave directories in the module
cache read-write instead of making them unwritable.
[1] https://github.com/golang/go/issues/31481
[2] https://go-review.googlesource.com/c/go/+/202079/
Reviewed by: swills
Differential Revision: https://reviews.freebsd.org/D23063
Notes
Notes:
svn path=/head/; revision=527631
Diffstat (limited to 'Mk')
-rw-r--r-- | Mk/Uses/go.mk | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Mk/Uses/go.mk b/Mk/Uses/go.mk index ed2a97e4765b..59c03d880dd7 100644 --- a/Mk/Uses/go.mk +++ b/Mk/Uses/go.mk @@ -179,7 +179,7 @@ _MODULES2TUPLE_CMD= modules2tuple gomod-vendor: patch @if type ${GO_CMD} > /dev/null 2>&1; then \ if type ${_MODULES2TUPLE_CMD} > /dev/null 2>&1; then \ - cd ${WRKSRC}; ${GO_CMD} mod vendor; \ + cd ${WRKSRC}; ${SETENV} GOPATH=${WRKDIR}/.gopath GOFLAGS=-modcacherw ${GO_CMD} mod vendor; \ [ -r vendor/modules.txt ] && ${_MODULES2TUPLE_CMD} vendor/modules.txt; \ else \ ${ECHO_MSG} "===> Please install \"ports-mgmt/modules2tuple\""; \ |