Skip to content

Commit

Permalink
Mk/Uses/go.mk: Avoid pollution of Go module cache with modules downlo…
Browse files Browse the repository at this point in the history
…aded 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] golang/go#31481
[2] https://go-review.googlesource.com/c/go/+/202079/

Reviewed by:	swills
Differential Revision:	https://reviews.freebsd.org/D23063


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@527631 35697150-7ecd-e111-bb59-0022644237b5
  • Loading branch information
dmgk committed Mar 2, 2020
1 parent 53a5240 commit 3c9a721
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Mk/Uses/go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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\""; \
Expand Down

0 comments on commit 3c9a721

Please sign in to comment.