This patch to the gotools Makefile sets the GOCACHE variable while
running the gotools tests.  This avoids creating a cache in the
default location, which is the user's home directory.  This should fix
PR 85630.  Bootstrapped and ran gotools tests on x86_64-pc-linux-gnu.
Committed to mainline.

I would like to commit this to the GCC 8 branch but I haven't seen a
statement that the branch is open for bug fixes.  Is the backport OK?
Thanks.

Ian

2018-05-04  Ian Lance Taylor  <i...@golang.org>

PR go/85630
* Makefile.am (CHECK_ENV): Set GOCACHE.
(ECHO_ENV): Update for setting of GOCACHE.
* Makefile.in: Rebuild.
Index: Makefile.am
===================================================================
--- Makefile.am (revision 259935)
+++ Makefile.am (working copy)
@@ -218,11 +218,13 @@ CHECK_ENV = \
        export LD_LIBRARY_PATH; \
        GOROOT=$${abs_libgodir}; \
        export GOROOT; \
+       GOCACHE=$(abs_builddir)/gocache-test; \
+       export GOCACHE; \
        fl1="FA"; fl2="IL"; fl="$${fl1}$${fl2}";
 
 # ECHO_ENV is a variant of CHECK_ENV to put into a testlog file.
 # It assumes that abs_libgodir is set.
-ECHO_ENV = PATH=`echo $(abs_builddir):$${PATH} | sed 
's,::*,:,g;s,^:*,,;s,:*$$,,'` GCCGO='$(abs_builddir)/check-gccgo' 
CC='$(abs_builddir)/check-gcc' GCCGOTOOLDIR='$(abs_builddir)' 
GO_TESTING_GOTOOLS=yes LD_LIBRARY_PATH=`echo 
$${abs_libgodir}/.libs:$${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'` 
GOROOT=`echo $${abs_libgodir}`
+ECHO_ENV = PATH=`echo $(abs_builddir):$${PATH} | sed 
's,::*,:,g;s,^:*,,;s,:*$$,,'` GCCGO='$(abs_builddir)/check-gccgo' 
CC='$(abs_builddir)/check-gcc' GCCGOTOOLDIR='$(abs_builddir)' 
GO_TESTING_GOTOOLS=yes LD_LIBRARY_PATH=`echo 
$${abs_libgodir}/.libs:$${LD_LIBRARY_PATH} | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'` 
GOROOT=`echo $${abs_libgodir} GOCACHE='$(abs_builddir)/gocache-test'`
 
 # check-go-tool runs `go test cmd/go` in our environment.
 check-go-tool: go$(EXEEXT) $(noinst_PROGRAMS) check-head check-gccgo check-gcc

Reply via email to