about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorfigsoda <figsoda@pm.me>2023-09-29 15:54:49 -0400
committerGitHub <noreply@github.com>2023-09-29 15:54:49 -0400
commit14d44173e4081f0617e9f3e1786a829ca2c592b5 (patch)
tree9e5f1e9f06cdd13f5b4f54e086e895e8bdd2d069 /pkgs/build-support
parent50751b0602e568403898fc17c4bbb5f3101ccbbd (diff)
parent8674922276e2b9e717d1f6886ba660c620586175 (diff)
downloadnixlib-14d44173e4081f0617e9f3e1786a829ca2c592b5.tar
nixlib-14d44173e4081f0617e9f3e1786a829ca2c592b5.tar.gz
nixlib-14d44173e4081f0617e9f3e1786a829ca2c592b5.tar.bz2
nixlib-14d44173e4081f0617e9f3e1786a829ca2c592b5.tar.lz
nixlib-14d44173e4081f0617e9f3e1786a829ca2c592b5.tar.xz
nixlib-14d44173e4081f0617e9f3e1786a829ca2c592b5.tar.zst
nixlib-14d44173e4081f0617e9f3e1786a829ca2c592b5.zip
Merge pull request #256949 from andresilva/build-rust-package-profiles
buildRustPackage: support custom cargo profiles
Diffstat (limited to 'pkgs/build-support')
-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 15b32a746501..ed982c7ff30a 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 613c81a8d6fd..971a140ec178 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 055cabdc2204..29ba18a6a1e3 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