diff --git a/pkgs/build-support/rust/hooks/cargo-build-hook.sh b/pkgs/build-support/rust/hooks/cargo-build-hook.sh index 7503fae4cd7f..af94e02e38ae 100644 --- a/pkgs/build-support/rust/hooks/cargo-build-hook.sh +++ b/pkgs/build-support/rust/hooks/cargo-build-hook.sh @@ -5,6 +5,10 @@ cargoBuildHook() { runHook preBuild + # Let stdenv handle stripping, for consistency and to not break + # separateDebugInfo. + export "CARGO_PROFILE_${cargoBuildType@U}_STRIP"=false + if [ ! -z "${buildAndTestSubdir-}" ]; then # ensure the output doesn't end up in the subdirectory export CARGO_TARGET_DIR="$(pwd)/target"