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.
This commit is contained in:
Alyssa Ross 2023-06-07 17:42:06 +00:00
parent 25e7c47892
commit f5d8384094
No known key found for this signature in database
GPG key ID: F9DBED4859B271C0

View file

@ -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"