From 42c8e4dd18002f20fc8a5507cdaea59ecc581072 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 15 Jan 2023 00:11:55 -0800 Subject: [PATCH] build-rust-crate: dontStrip=!release Without this PR, unlike `RUST_LIB_BACKTRACE=1 cargo run` you won't get line numbers in backtraces from binaries built with: ``` nix build -f Cargo.nix --arg release false ``` This PR fixes that. --- pkgs/build-support/rust/build-rust-crate/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/build-support/rust/build-rust-crate/default.nix b/pkgs/build-support/rust/build-rust-crate/default.nix index c4d1ef7b209e..17ce3f75fb1b 100644 --- a/pkgs/build-support/rust/build-rust-crate/default.nix +++ b/pkgs/build-support/rust/build-rust-crate/default.nix @@ -352,6 +352,7 @@ crate_: lib.makeOverridable metadata hasCrateBin crateBin verbose colors extraRustcOpts buildTests codegenUnits; }; + dontStrip = !release; installPhase = installCrate crateName metadata buildTests; # depending on the test setting we are either producing something with bins