pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/lang/go
Module Name: pkgsrc
Committed By: jperkin
Date: Fri Dec 6 11:05:48 UTC 2024
Modified Files:
pkgsrc/lang/go: go-module.mk go-package.mk
Log Message:
go: Set GOTMPDIR.
Go uses TMPDIR for ephemeral objects, but unlike other compilers does not
clean up quickly enough, so even with a reasonably large tmpfs limit of 1G
some package builds can fail due to too many leftover objects.
Use the same directory as GOCACHE and ensure it is created after distfile
extraction.
Tested in a bulk build on SmartOS and confirmed to fix a number of package
builds. No feedback on proposal to tech-pkg@.
To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 pkgsrc/lang/go/go-module.mk
cvs rdiff -u -r1.28 -r1.29 pkgsrc/lang/go/go-package.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/lang/go/go-module.mk
diff -u pkgsrc/lang/go/go-module.mk:1.21 pkgsrc/lang/go/go-module.mk:1.22
--- pkgsrc/lang/go/go-module.mk:1.21 Tue Oct 29 13:10:11 2024
+++ pkgsrc/lang/go/go-module.mk Fri Dec 6 11:05:48 2024
@@ -1,4 +1,4 @@
-# $NetBSD: go-module.mk,v 1.21 2024/10/29 13:10:11 jperkin Exp $
+# $NetBSD: go-module.mk,v 1.22 2024/12/06 11:05:48 jperkin Exp $
#
# This file implements common logic for compiling Go programs in pkgsrc.
#
@@ -47,10 +47,16 @@ USE_TOOLS+= pax
TOOL_DEPENDS+= ${GO_PACKAGE_DEP}
PRINT_PLIST_AWK+= /^@pkgdir bin$$/ { next; }
+GO_CACHE_DIR= ${WRKDIR}/.cache/go-build
+
MAKE_ENV+= GOPATH=${WRKDIR}/.gopath GOPROXY=file://${WRKDIR}/.goproxy
-MAKE_ENV+= GOCACHE=${WRKDIR}/.cache/go-build
+MAKE_ENV+= GOCACHE=${GO_CACHE_DIR} GOTMPDIR=${GO_CACHE_DIR}
MAKE_ENV+= GOTOOLCHAIN=local
+post-extract: ${GO_CACHE_DIR}
+${GO_CACHE_DIR}:
+ @${MKDIR} ${.TARGET}
+
.if !target(do-build)
do-build:
${RUN} cd ${WRKSRC} && ${_ULIMIT_CMD} ${PKGSRC_SETENV} ${MAKE_ENV} \
@@ -102,7 +108,7 @@ _VARGROUPS+= go
_PKG_VARS.go= GO_BUILD_PATTERN GO_MODULE_FILES GO_EXTRA_MOD_DIRS
_USER_VARS.go= GO_VERSION_DEFAULT
_SYS_VARS.go= GO GO_VERSION GOVERSSUFFIX GOARCH GOCHAR \
- GOOPT GOTOOLDIR GO_PLATFORM
+ GOOPT GOTOOLDIR GO_PLATFORM GO_CACHE_DIR
_DEF_VARS.go= GO14_VERSION GO19_VERSION GO110_VERSION \
GO111_VERSION INSTALLATION_DIRS MAKE_JOBS_SAFE \
NOT_FOR_PLATFORM ONLY_FOR_PLATFORM SSP_SUPPORTED \
Index: pkgsrc/lang/go/go-package.mk
diff -u pkgsrc/lang/go/go-package.mk:1.28 pkgsrc/lang/go/go-package.mk:1.29
--- pkgsrc/lang/go/go-package.mk:1.28 Sun Feb 11 19:28:18 2024
+++ pkgsrc/lang/go/go-package.mk Fri Dec 6 11:05:48 2024
@@ -1,4 +1,4 @@
-# $NetBSD: go-package.mk,v 1.28 2024/02/11 19:28:18 bsiegert Exp $
+# $NetBSD: go-package.mk,v 1.29 2024/12/06 11:05:48 jperkin Exp $
#
# This file implements common logic for compiling Go programs in pkgsrc.
#
@@ -70,8 +70,10 @@ GOTOOLDIR= go${GOVERSSUFFIX}/pkg/tool/$
PRINT_PLIST_AWK+= /^@pkgdir bin$$/ { next; }
PRINT_PLIST_AWK+= /^@pkgdir gopkg$$/ { next; }
+GO_CACHE_DIR= ${WRKDIR}/.cache/go-build
+
MAKE_ENV+= GOPATH=${WRKDIR}:${BUILDLINK_DIR}/gopkg
-MAKE_ENV+= GOCACHE=${WRKDIR}/.cache/go-build
+MAKE_ENV+= GOCACHE=${GO_CACHE_DIR} GOTMPDIR=${GO_CACHE_DIR}
MAKE_ENV+= GO111MODULE=off
MAKE_ENV+= GOTOOLCHAIN=local
@@ -82,6 +84,10 @@ post-extract:
${RUN} ${MV} ${WRKDIR}/${GO_DIST_BASE}/* ${WRKSRC}
.endif
+post-extract: ${GO_CACHE_DIR}
+${GO_CACHE_DIR}:
+ @${MKDIR} ${.TARGET}
+
.if !target(do-build)
do-build:
${RUN} ${_ULIMIT_CMD} ${PKGSRC_SETENV} ${MAKE_ENV} ${GO} install -v ${GO_BUILD_PATTERN}
@@ -107,7 +113,7 @@ _VARGROUPS+= go
_PKG_VARS.go= GO_SRCPATH GO_DIST_BASE GO_DEPS GO_BUILD_PATTERN
_USER_VARS.go= GO_VERSION_DEFAULT
_SYS_VARS.go= GO GO_VERSION GOVERSSUFFIX GOARCH GOCHAR \
- GOOPT GOTOOLDIR GO_PLATFORM
+ GOOPT GOTOOLDIR GO_PLATFORM GO_CACHE_DIR
_USE_VARS.go= GO_PACKAGE_DEP \
WRKDIR BUILDLINK_DIR DESTDIR PREFIX \
TEST_ENV
Home |
Main Index |
Thread Index |
Old Index