diff options
author | Ana Hobden <operator@hoverbear.org> | 2021-03-03 10:09:04 -0800 |
---|---|---|
committer | Ana Hobden <operator@hoverbear.org> | 2021-03-04 07:16:29 -0800 |
commit | a84cb88c47995042995d334f497514b20da19312 (patch) | |
tree | 3204166fabb8414c6983f5908c20b46036f757ad /pkgs/build-support | |
parent | a9fc5a39c5f686ab2e54a48b0c94ecd4c165c00e (diff) |
rustPlatform.buildRustPackage: support debug builds
Signed-off-by: Ana Hobden <operator@hoverbear.org>
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/rust/hooks/cargo-build-hook.sh | 6 | ||||
-rw-r--r-- | pkgs/build-support/rust/hooks/cargo-check-hook.sh | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/pkgs/build-support/rust/hooks/cargo-build-hook.sh b/pkgs/build-support/rust/hooks/cargo-build-hook.sh index 54f4512d67ca..6760277c2941 100644 --- a/pkgs/build-support/rust/hooks/cargo-build-hook.sh +++ b/pkgs/build-support/rust/hooks/cargo-build-hook.sh @@ -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} ) diff --git a/pkgs/build-support/rust/hooks/cargo-check-hook.sh b/pkgs/build-support/rust/hooks/cargo-check-hook.sh index bc913c6ab074..e4c906f873c4 100644 --- a/pkgs/build-support/rust/hooks/cargo-check-hook.sh +++ b/pkgs/build-support/rust/hooks/cargo-check-hook.sh @@ -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 |