From 9bbfc6f6e2c7d84136d344ca3182a47cb14cb32b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 28 Oct 2018 13:45:56 +0000 Subject: [PATCH] buildGoPackage: re-enable GOCACHE If projects uses go1.11 modules GOCACHE is required. Also if buildGoPackage is used in a nix-shell setting we don't want to override GOCACHE to allow incremental builds. This should be backported to 18.09 --- pkgs/development/go-modules/generic/default.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/development/go-modules/generic/default.nix b/pkgs/development/go-modules/generic/default.nix index 3faa4c268ac0..0e092473bd52 100644 --- a/pkgs/development/go-modules/generic/default.nix +++ b/pkgs/development/go-modules/generic/default.nix @@ -103,6 +103,7 @@ go.stdenv.mkDerivation ( '') + '' export GOPATH=$NIX_BUILD_TOP/go:$GOPATH + export GOCACHE=$TMPDIR/go-cache runHook postConfigure ''; @@ -193,9 +194,6 @@ go.stdenv.mkDerivation ( find $bin/bin -type f -exec ${removeExpr removeReferences} '{}' + || true ''; - # Disable go cache, which is not reused in nix anyway - GOCACHE = "off"; - shellHook = '' d=$(mktemp -d "--suffix=-$name") '' + toString (map (dep: ''