From d6c3e744259ad9e364c5f4d9072ce64f950f2dc3 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 15 Mar 2017 11:00:55 -0400 Subject: [PATCH] buildGoModule: share the buildFlagsArray with the parallel subprocesses --- pkgs/development/go-modules/generic/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/go-modules/generic/default.nix b/pkgs/development/go-modules/generic/default.nix index c707592e4ae3..985b4c9b9db1 100644 --- a/pkgs/development/go-modules/generic/default.nix +++ b/pkgs/development/go-modules/generic/default.nix @@ -116,6 +116,7 @@ go.stdenv.mkDerivation ( local d; local cmd; cmd="$1" d="$2" + . $TMPDIR/buildFlagsArray echo "$d" | grep -q "\(/_\|examples\|Godeps\)" && return 0 [ -n "$excludedPackages" ] && echo "$d" | grep -q "$excludedPackages" && return 0 local OUT @@ -143,6 +144,11 @@ go.stdenv.mkDerivation ( fi } + if [ ''${#buildFlagsArray[@]} -ne 0 ]; then + declare -p buildFlagsArray > $TMPDIR/buildFlagsArray + else + touch $TMPDIR/buildFlagsArray + fi export -f buildGoDir # parallel needs to see the function if [ -z "$enableParallelBuilding" ]; then export NIX_BUILD_CORES=1