rustPlatform.buildRustPackage: support debug builds

Signed-off-by: Ana Hobden <operator@hoverbear.org>
This commit is contained in:
Ana Hobden 2021-03-03 10:09:04 -08:00
parent a9fc5a39c5
commit a84cb88c47
2 changed files with 10 additions and 2 deletions

View File

@ -9,6 +9,10 @@ cargoBuildHook() {
pushd "${buildAndTestSubdir}"
fi
if [ "${cargoBuildType}" != "debug" ]; then
cargoBuildProfileFlag="--${cargoBuildType}"
fi
(
set -x
env \
@ -19,7 +23,7 @@ cargoBuildHook() {
cargo build -j $NIX_BUILD_CORES \
--target @rustTargetPlatformSpec@ \
--frozen \
--${cargoBuildType} \
${cargoBuildProfileFlag} \
${cargoBuildFlags}
)

View File

@ -16,7 +16,11 @@ cargoCheckHook() {
threads=1
fi
argstr="--${cargoCheckType} --target @rustTargetPlatformSpec@ --frozen ${cargoTestFlags}";
if [ "${cargoBuildType}" != "debug" ]; then
cargoBuildProfileFlag="--${cargoBuildType}"
fi
argstr="${cargoBuildProfileFlag} --target @rustTargetPlatformSpec@ --frozen ${cargoTestFlags}";
(
set -x