summary refs log tree commit diff
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
parentc7e1fde9dc0fa17fb09301f8db352bec7e54fac0 (diff)
downloadnixpkgs-589d4ff232665582b46730f0bf99a571e76eed7e.tar
nixpkgs-589d4ff232665582b46730f0bf99a571e76eed7e.tar.gz
nixpkgs-589d4ff232665582b46730f0bf99a571e76eed7e.tar.bz2
nixpkgs-589d4ff232665582b46730f0bf99a571e76eed7e.tar.lz
nixpkgs-589d4ff232665582b46730f0bf99a571e76eed7e.tar.xz
nixpkgs-589d4ff232665582b46730f0bf99a571e76eed7e.tar.zst
nixpkgs-589d4ff232665582b46730f0bf99a571e76eed7e.zip
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
-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 55fda78b03e..9adebe51247 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