buildRustPackage: fix cargo flag for release/debug build (#61521)
Previous behavior did not actually allow for "debug" build as it would try to pass --debug to cargo, which is not a valid flag.
This commit is contained in:
parent
4bcc6e11d3
commit
4403d44763
@ -46,7 +46,6 @@ let
|
|||||||
ccForHost="${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
|
ccForHost="${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
|
||||||
cxxForHost="${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++";
|
cxxForHost="${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++";
|
||||||
releaseDir = "target/${stdenv.hostPlatform.config}/${buildType}";
|
releaseDir = "target/${stdenv.hostPlatform.config}/${buildType}";
|
||||||
|
|
||||||
in stdenv.mkDerivation (args // {
|
in stdenv.mkDerivation (args // {
|
||||||
inherit cargoDeps;
|
inherit cargoDeps;
|
||||||
|
|
||||||
@ -104,7 +103,7 @@ in stdenv.mkDerivation (args // {
|
|||||||
"CC_${stdenv.hostPlatform.config}"="${ccForHost}" \
|
"CC_${stdenv.hostPlatform.config}"="${ccForHost}" \
|
||||||
"CXX_${stdenv.hostPlatform.config}"="${cxxForHost}" \
|
"CXX_${stdenv.hostPlatform.config}"="${cxxForHost}" \
|
||||||
cargo build \
|
cargo build \
|
||||||
--${buildType} \
|
${stdenv.lib.optionalString (buildType == "release") "--release"} \
|
||||||
--target ${stdenv.hostPlatform.config} \
|
--target ${stdenv.hostPlatform.config} \
|
||||||
--frozen ${concatStringsSep " " cargoBuildFlags}
|
--frozen ${concatStringsSep " " cargoBuildFlags}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user