From f5d83840943fb336a89d220e104045d7771df68e Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Wed, 7 Jun 2023 17:42:06 +0000 Subject: [PATCH] rustPlatform.cargoBuildHook: don't let cargo strip This fixes debug info of cloud-hypervisor, which recently added strip = true to its release profile in Cargo.toml. --- pkgs/build-support/rust/hooks/cargo-build-hook.sh | 4 ++++ 1 file changed, 4 insertions(+) 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"