about summary refs log tree commit diff
path: root/pkgs/build-support/rust
diff options
context:
space:
mode:
authorAndré Silva <andrerfosilva@gmail.com>2023-09-23 19:58:14 +0100
committerAndré Silva <andrerfosilva@gmail.com>2023-09-24 18:40:24 +0100
commit8674922276e2b9e717d1f6886ba660c620586175 (patch)
treeca058cbf6d2851b236b3148613fc5d45e67354fd /pkgs/build-support/rust
parent1ff350f7b806e02c65c1bbc78b905b80244df5d6 (diff)
downloadnixlib-8674922276e2b9e717d1f6886ba660c620586175.tar
nixlib-8674922276e2b9e717d1f6886ba660c620586175.tar.gz
nixlib-8674922276e2b9e717d1f6886ba660c620586175.tar.bz2
nixlib-8674922276e2b9e717d1f6886ba660c620586175.tar.lz
nixlib-8674922276e2b9e717d1f6886ba660c620586175.tar.xz
nixlib-8674922276e2b9e717d1f6886ba660c620586175.tar.zst
nixlib-8674922276e2b9e717d1f6886ba660c620586175.zip
buildRustPackage: support custom cargo profiles
Diffstat (limited to 'pkgs/build-support/rust')
-rw-r--r--pkgs/build-support/rust/build-rust-package/default.nix1
-rw-r--r--pkgs/build-support/rust/hooks/cargo-build-hook.sh2
-rw-r--r--pkgs/build-support/rust/hooks/cargo-check-hook.sh2
-rw-r--r--pkgs/build-support/rust/hooks/cargo-nextest-hook.sh2
4 files changed, 3 insertions, 4 deletions
diff --git a/pkgs/build-support/rust/build-rust-package/default.nix b/pkgs/build-support/rust/build-rust-package/default.nix
index 9b2e62fc240a..cb83a7bc95cf 100644
--- a/pkgs/build-support/rust/build-rust-package/default.nix
+++ b/pkgs/build-support/rust/build-rust-package/default.nix
@@ -62,7 +62,6 @@
 assert cargoVendorDir == null && cargoLock == null
     -> !(args ? cargoSha256 && args.cargoSha256 != null) && !(args ? cargoHash && args.cargoHash != null)
     -> throw "cargoSha256, cargoHash, cargoVendorDir, or cargoLock must be set";
-assert buildType == "release" || buildType == "debug";
 
 let
 
diff --git a/pkgs/build-support/rust/hooks/cargo-build-hook.sh b/pkgs/build-support/rust/hooks/cargo-build-hook.sh
index af94e02e38ae..1c60467b11d3 100644
--- a/pkgs/build-support/rust/hooks/cargo-build-hook.sh
+++ b/pkgs/build-support/rust/hooks/cargo-build-hook.sh
@@ -17,7 +17,7 @@ cargoBuildHook() {
     fi
 
     if [ "${cargoBuildType}" != "debug" ]; then
-        cargoBuildProfileFlag="--${cargoBuildType}"
+        cargoBuildProfileFlag="--profile ${cargoBuildType}"
     fi
 
     if [ -n "${cargoBuildNoDefaultFeatures-}" ]; then
diff --git a/pkgs/build-support/rust/hooks/cargo-check-hook.sh b/pkgs/build-support/rust/hooks/cargo-check-hook.sh
index 57fc2779cfe9..c03eb04aeb68 100644
--- a/pkgs/build-support/rust/hooks/cargo-check-hook.sh
+++ b/pkgs/build-support/rust/hooks/cargo-check-hook.sh
@@ -17,7 +17,7 @@ cargoCheckHook() {
     fi
 
     if [ "${cargoCheckType}" != "debug" ]; then
-        cargoCheckProfileFlag="--${cargoCheckType}"
+        cargoCheckProfileFlag="--profile ${cargoCheckType}"
     fi
 
     if [ -n "${cargoCheckNoDefaultFeatures-}" ]; then
diff --git a/pkgs/build-support/rust/hooks/cargo-nextest-hook.sh b/pkgs/build-support/rust/hooks/cargo-nextest-hook.sh
index de85683ead2a..4a5c2d6339a5 100644
--- a/pkgs/build-support/rust/hooks/cargo-nextest-hook.sh
+++ b/pkgs/build-support/rust/hooks/cargo-nextest-hook.sh
@@ -17,7 +17,7 @@ cargoNextestHook() {
     fi
 
     if [ "${cargoCheckType}" != "debug" ]; then
-        cargoCheckProfileFlag="--${cargoCheckType}"
+        cargoCheckProfileFlag="--cargo-profile ${cargoCheckType}"
     fi
 
     if [ -n "${cargoCheckNoDefaultFeatures-}" ]; then