buildGoPackage: remove build-time dependency on parallel (and perl)

xargs is as good as parallel for our job

fixes #50752
This commit is contained in:
Jörg Thalheim 2018-11-19 17:11:05 +00:00
parent 26725b4628
commit 9564927888
No known key found for this signature in database
GPG key ID: CA4106B8D7CC79FA

View file

@ -1,4 +1,4 @@
{ go, govers, parallel, lib, fetchgit, fetchhg, fetchbzr, rsync
{ go, govers, lib, fetchgit, fetchhg, fetchbzr, rsync
, removeReferencesTo, fetchFromGitHub }:
{ name, buildInputs ? [], nativeBuildInputs ? [], passthru ? {}, preFixup ? ""
@ -78,7 +78,7 @@ go.stdenv.mkDerivation (
(builtins.removeAttrs args [ "goPackageAliases" "disabled" ]) // {
inherit name;
nativeBuildInputs = [ removeReferencesTo go parallel ]
nativeBuildInputs = [ removeReferencesTo go ]
++ (lib.optional (!dontRenameImports) govers) ++ nativeBuildInputs;
buildInputs = [ go ] ++ buildInputs;
@ -162,11 +162,11 @@ go.stdenv.mkDerivation (
else
touch $TMPDIR/buildFlagsArray
fi
export -f buildGoDir # parallel needs to see the function
export -f buildGoDir # xargs needs to see the function
if [ -z "$enableParallelBuilding" ]; then
export NIX_BUILD_CORES=1
fi
getGoDirs "" | parallel -j $NIX_BUILD_CORES buildGoDir install
getGoDirs "" | xargs -n1 -P $NIX_BUILD_CORES bash -c 'buildGoDir install "$@"' --
runHook postBuild
'';
@ -175,7 +175,7 @@ go.stdenv.mkDerivation (
checkPhase = args.checkPhase or ''
runHook preCheck
getGoDirs test | parallel -j $NIX_BUILD_CORES buildGoDir test
getGoDirs test | xargs -n1 -P $NIX_BUILD_CORES bash -c 'buildGoDir test "$@"' --
runHook postCheck
'';