From eee09b103c6a519ab4ef36f2a854157f5c1ffffe Mon Sep 17 00:00:00 2001 From: "Wael M. Nasreddine" Date: Sun, 10 Mar 2019 13:54:19 -0700 Subject: [PATCH 1/7] docker: export GOCACHE for all platforms --- pkgs/applications/virtualization/docker/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/virtualization/docker/default.nix b/pkgs/applications/virtualization/docker/default.nix index d4ba9568fed..b634625206a 100644 --- a/pkgs/applications/virtualization/docker/default.nix +++ b/pkgs/applications/virtualization/docker/default.nix @@ -94,13 +94,14 @@ rec { dontStrip = true; - buildPhase = (optionalString (stdenv.isLinux) '' + buildPhase = '' + export GOCACHE="$TMPDIR/go-cache" + '' + (optionalString (stdenv.isLinux) '' # build engine cd ./components/engine export AUTO_GOPATH=1 export DOCKER_GITCOMMIT="${rev}" export VERSION="${version}" - export GOCACHE="$TMPDIR/go-cache" ./hack/make.sh dynbinary cd - '') + '' From 483d823ec4dace48815fa00596b9589142ae2350 Mon Sep 17 00:00:00 2001 From: "Wael M. Nasreddine" Date: Sun, 10 Mar 2019 13:56:12 -0700 Subject: [PATCH 2/7] gitlab-shell: export GOCACHE in the installPhase TMPDIR, in `GOCACHE = "$TMPDIR";`, will not be intepreted when it's set outside of a phase. --- .../version-management/gitlab/gitlab-shell/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/version-management/gitlab/gitlab-shell/default.nix b/pkgs/applications/version-management/gitlab/gitlab-shell/default.nix index b9423ccb328..bb48a441253 100644 --- a/pkgs/applications/version-management/gitlab/gitlab-shell/default.nix +++ b/pkgs/applications/version-management/gitlab/gitlab-shell/default.nix @@ -13,11 +13,11 @@ stdenv.mkDerivation rec { buildInputs = [ ruby bundler go ]; - GOCACHE="$TMPDIR/go-cache"; - patches = [ ./remove-hardcoded-locations.patch ]; installPhase = '' + export GOCACHE="$TMPDIR/go-cache" + ruby bin/compile mkdir -p $out/ cp -R . $out/ From d925c32467d49db7d7c75c6a5476c2973338315a Mon Sep 17 00:00:00 2001 From: "Wael M. Nasreddine" Date: Sun, 10 Mar 2019 14:04:04 -0700 Subject: [PATCH 3/7] deepin.go-dbus-generator: fix the GOCACHE make flag --- pkgs/desktops/deepin/go-dbus-generator/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/desktops/deepin/go-dbus-generator/default.nix b/pkgs/desktops/deepin/go-dbus-generator/default.nix index 137ad3dafe0..1e3da129a61 100644 --- a/pkgs/desktops/deepin/go-dbus-generator/default.nix +++ b/pkgs/desktops/deepin/go-dbus-generator/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { makeFlags = [ "PREFIX=$(out)" - "GOCACHE=$TMPDIR/go-cache" + "GOCACHE=$(TMPDIR)/go-cache" ]; passthru.updateScript = deepin.updateScript { inherit name; }; From f10522dab000daee2aa96f14fcd9647787bd1cc2 Mon Sep 17 00:00:00 2001 From: "Wael M. Nasreddine" Date: Sun, 10 Mar 2019 14:04:18 -0700 Subject: [PATCH 4/7] deepin.go-gir-generator: fix the GOCACHE make flag --- pkgs/desktops/deepin/go-gir-generator/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/desktops/deepin/go-gir-generator/default.nix b/pkgs/desktops/deepin/go-gir-generator/default.nix index e6e70d2c167..bd979b31784 100644 --- a/pkgs/desktops/deepin/go-gir-generator/default.nix +++ b/pkgs/desktops/deepin/go-gir-generator/default.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { makeFlags = [ "PREFIX=$(out)" - "GOCACHE=$TMPDIR/go-cache" + "GOCACHE=$(TMPDIR)/go-cache" ]; passthru.updateScript = deepin.updateScript { inherit name; }; From b39fc3a0bc221f3347055c5e59ca897e8df8db80 Mon Sep 17 00:00:00 2001 From: "Wael M. Nasreddine" Date: Sun, 10 Mar 2019 14:04:46 -0700 Subject: [PATCH 5/7] boringssl: export GOCACHE in the makeFlags --- pkgs/development/libraries/boringssl/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/boringssl/default.nix b/pkgs/development/libraries/boringssl/default.nix index 1fa503ad955..ee62d5423a1 100644 --- a/pkgs/development/libraries/boringssl/default.nix +++ b/pkgs/development/libraries/boringssl/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; NIX_CFLAGS_COMPILE = "-Wno-error"; - GOCACHE="$TMPDIR/go-cache"; + makeFlags = [ "GOCACHE=$(TMPDIR)/go-cache" ]; installPhase = '' mkdir -p $out/bin $out/include $out/lib From 09435db08a7368fa7b9919a709c368b67947de59 Mon Sep 17 00:00:00 2001 From: "Wael M. Nasreddine" Date: Sun, 10 Mar 2019 14:05:13 -0700 Subject: [PATCH 6/7] cadvisor: export GOCACHE in the buildPhase TMPDIR, in `GOCACHE = "$TMPDIR";`, will not be intepreted when it's set outside of a phase. --- pkgs/servers/monitoring/cadvisor/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/servers/monitoring/cadvisor/default.nix b/pkgs/servers/monitoring/cadvisor/default.nix index 58ef9fa32b9..44f690bcf9d 100644 --- a/pkgs/servers/monitoring/cadvisor/default.nix +++ b/pkgs/servers/monitoring/cadvisor/default.nix @@ -13,9 +13,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ go ]; - GOCACHE="$TMPDIR/go-cache"; - buildPhase = '' + export GOCACHE="$TMPDIR/go-cache" mkdir -p Godeps/_workspace/src/github.com/google/ ln -s $(pwd) Godeps/_workspace/src/github.com/google/cadvisor GOPATH=$(pwd)/Godeps/_workspace go build -v -o cadvisor github.com/google/cadvisor From 7cb4e4b343cbffd64cc690d708864a418ac88f83 Mon Sep 17 00:00:00 2001 From: "Wael M. Nasreddine" Date: Sun, 10 Mar 2019 14:05:44 -0700 Subject: [PATCH 7/7] vault: export GOCACHE in the preBuild phase TMPDIR, in `GOCACHE = "$TMPDIR";`, will not be intepreted when it's set outside of a phase. --- pkgs/tools/security/vault/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/tools/security/vault/default.nix b/pkgs/tools/security/vault/default.nix index 92c757df22c..bf5d34a8dd1 100644 --- a/pkgs/tools/security/vault/default.nix +++ b/pkgs/tools/security/vault/default.nix @@ -13,8 +13,6 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ go gox removeReferencesTo ]; - GOCACHE="$TMPDIR/go-cache"; - preBuild = '' patchShebangs ./ substituteInPlace scripts/build.sh --replace 'git rev-parse HEAD' 'echo ${src.rev}' @@ -24,6 +22,7 @@ stdenv.mkDerivation rec { ln -s $(pwd) src/github.com/hashicorp/vault export GOPATH=$(pwd) + export GOCACHE="$TMPDIR/go-cache" ''; installPhase = ''