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:
Adelbert Chang 2019-07-31 05:19:01 -07:00 committed by Jörg Thalheim
parent 4bcc6e11d3
commit 4403d44763

View File

@ -46,7 +46,6 @@ let
ccForHost="${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
cxxForHost="${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++";
releaseDir = "target/${stdenv.hostPlatform.config}/${buildType}";
in stdenv.mkDerivation (args // {
inherit cargoDeps;
@ -104,7 +103,7 @@ in stdenv.mkDerivation (args // {
"CC_${stdenv.hostPlatform.config}"="${ccForHost}" \
"CXX_${stdenv.hostPlatform.config}"="${cxxForHost}" \
cargo build \
--${buildType} \
${stdenv.lib.optionalString (buildType == "release") "--release"} \
--target ${stdenv.hostPlatform.config} \
--frozen ${concatStringsSep " " cargoBuildFlags}
)