summaryrefslogtreecommitdiffstats
path: root/pkgs/development/go-modules
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2019-10-12 12:00:00 -0500
committerMario Rodas <marsam@users.noreply.github.com>2019-10-12 12:00:00 -0500
commit589d4ff232665582b46730f0bf99a571e76eed7e (patch)
treefd446df808603f2b3fa29ce7db65cac33765789c /pkgs/development/go-modules
parentc7e1fde9dc0fa17fb09301f8db352bec7e54fac0 (diff)
buildGoModule: remove cached lookup results and tiles
Since GO 1.13, the go command caches the lookup results and tiles in $GOPATH[1], hence making the module directory non-deterministic. Use the `-f` flag when removing /sumdb, for compatibility with Go 1.12 because in that version does not exists that directory. [1] https://go.googlesource.com/proposal/+/master/design/25530-sumdb.md#command-client
Diffstat (limited to 'pkgs/development/go-modules')
-rw-r--r--pkgs/development/go-modules/generic/default.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkgs/development/go-modules/generic/default.nix b/pkgs/development/go-modules/generic/default.nix
index 55fda78b03e3..9adebe512471 100644
--- a/pkgs/development/go-modules/generic/default.nix
+++ b/pkgs/development/go-modules/generic/default.nix
@@ -73,6 +73,8 @@ let
installPhase = args.modInstallPhase or ''
runHook preInstall
+ # remove cached lookup results and tiles
+ rm -rf "''${GOPATH}/pkg/mod/cache/download/sumdb"
cp -r "''${GOPATH}/pkg/mod/cache/download" $out
runHook postInstall