Skip to content

Commit

Permalink
buildGoModule: share the buildFlagsArray with the parallel subprocesses
Browse files Browse the repository at this point in the history
(cherry picked from commit d6c3e74)
  • Loading branch information
shlevy authored and globin committed Mar 15, 2017
1 parent 186bd52 commit 55da471
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkgs/development/go-modules/generic/default.nix
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 55da471

Please sign in to comment.