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

View File

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