diff options
author | Mario Rodas <marsam@users.noreply.github.com> | 2020-08-16 10:00:00 -0500 |
---|---|---|
committer | Mario Rodas <marsam@users.noreply.github.com> | 2020-08-16 10:00:00 -0500 |
commit | b52808f1ad485da9e6202ed840140e434ede3c00 (patch) | |
tree | a8382d6a3c5995ae757e913d82f62edb65b07035 /pkgs/build-support/rust | |
parent | d4d9ad66a082f46c6e46010101aad7fcd64e110a (diff) |
buildRustPackage: add support for parallel build
Diffstat (limited to 'pkgs/build-support/rust')
-rw-r--r-- | pkgs/build-support/rust/default.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix index c292b8ea4d438..f270fe97326c1 100644 --- a/pkgs/build-support/rust/default.nix +++ b/pkgs/build-support/rust/default.nix @@ -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} @@ -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"} ''); |