diff options
author | Daniƫl de Kok <me@danieldk.eu> | 2021-03-05 06:58:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-05 06:58:00 +0100 |
commit | d8a19fb9ef2f7a5184f9350a6bdf531a9d1369a9 (patch) | |
tree | de0ae9fe3564ef62b6fe06e2b7fa3fb6936b2c0c /pkgs/build-support | |
parent | 51080ae4c46a09935e2ef146fa8835c3702c63cc (diff) | |
parent | a84cb88c47995042995d334f497514b20da19312 (diff) |
Merge pull request #115008 from Hoverbear/rust-debug-build-support
rustPlatform.buildRustPackage: support debug builds
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 |