Merge pull request #115008 from Hoverbear/rust-debug-build-support

rustPlatform.buildRustPackage: support debug builds
This commit is contained in:
Daniël de Kok
2021-03-05 06:58:00 +01:00
committed by GitHub
2 changed files with 10 additions and 2 deletions
@@ -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}
) )
@@ -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