Skip to content

Commit

Permalink
Merge pull request #95622 from marsam/buildrustpackage-parallel-build
Browse files Browse the repository at this point in the history
buildRustPackage: add support for parallel build
  • Loading branch information
Mic92 committed Aug 19, 2020
2 parents bf88039 + b52808f commit 542f4e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkgs/build-support/rust/default.nix
Expand Up @@ -181,7 +181,7 @@ stdenv.mkDerivation (args // {
"CXX_${rust.toRustTarget stdenv.buildPlatform}"="${cxxForBuild}" \
"CC_${rust.toRustTarget stdenv.hostPlatform}"="${ccForHost}" \
"CXX_${rust.toRustTarget stdenv.hostPlatform}"="${cxxForHost}" \
cargo build \
cargo build -j $NIX_BUILD_CORES \
${stdenv.lib.optionalString (buildType == "release") "--release"} \
--target ${rustTarget} \
--frozen ${concatStringsSep " " cargoBuildFlags}
Expand All @@ -208,7 +208,7 @@ stdenv.mkDerivation (args // {
${stdenv.lib.optionalString (buildAndTestSubdir != null) "pushd ${buildAndTestSubdir}"}
runHook preCheck
echo "Running cargo test ${argstr} -- ''${checkFlags} ''${checkFlagsArray+''${checkFlagsArray[@]}}"
cargo test ${argstr} -- ''${checkFlags} ''${checkFlagsArray+"''${checkFlagsArray[@]}"}
cargo test -j $NIX_BUILD_CORES ${argstr} -- --test-threads=$NIX_BUILD_CORES ''${checkFlags} ''${checkFlagsArray+"''${checkFlagsArray[@]}"}
runHook postCheck
${stdenv.lib.optionalString (buildAndTestSubdir != null) "popd"}
'');
Expand Down

0 comments on commit 542f4e4

Please sign in to comment.