From 736462d995435ad14540f8137fddbd467db63a0a Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 13 May 2020 01:15:23 +0200 Subject: [PATCH] rustPlatform: make it possible to override the profile for `cargo test` --- pkgs/build-support/rust/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix index aa5edc1f5bf..e79e902bcda 100644 --- a/pkgs/build-support/rust/default.nix +++ b/pkgs/build-support/rust/default.nix @@ -28,6 +28,7 @@ , meta ? {} , target ? null , cargoVendorDir ? null +, checkType ? buildType , ... } @ args: assert cargoVendorDir == null -> cargoSha256 != "unset"; @@ -191,7 +192,7 @@ stdenv.mkDerivation (args // { ''; checkPhase = args.checkPhase or (let - argstr = "${stdenv.lib.optionalString (buildType == "release") "--release"} --target ${rustTarget} --frozen"; + argstr = "${stdenv.lib.optionalString (checkType == "release") "--release"} --target ${rustTarget} --frozen"; in '' runHook preCheck echo "Running cargo test ${argstr} -- ''${checkFlags} ''${checkFlagsArray+''${checkFlagsArray[@]}}"