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
commit d8a19fb9ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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