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
This commit is contained in:
Mario Rodas 2019-10-12 12:00:00 -05:00
parent c7e1fde9dc
commit 589d4ff232
No known key found for this signature in database
GPG key ID: 4C4BEFD7B18DC5E8

View file

@ -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