Skip to content

Commit

Permalink
buildGoModule: share the buildFlagsArray with the parallel subprocesses
Browse files Browse the repository at this point in the history
  • Loading branch information
shlevy committed Mar 15, 2017
1 parent 162845d commit d6c3e74
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkgs/development/go-modules/generic/default.nix
Original file line number Diff line number Diff line change
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

2 comments on commit d6c3e74

@shlevy
Copy link
Member Author

@shlevy shlevy commented on d6c3e74 Mar 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copumpkin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omg this has been frustrating me for so long, thanks for fixing it!

Please sign in to comment.