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
1 changed files with 5 additions and 5 deletions

View File

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