From ec01a84efbb9c8dcf55e82fe94e47362fa7f4093 Mon Sep 17 00:00:00 2001 From: Charles Hall Date: Fri, 25 Oct 2024 19:54:41 -0700 Subject: [PATCH] add custom release profile with debuginfo enabled This is primarily useful for profiling. Also change the nix package to decide whether to strip based on whether the "release" profile is used. --- Cargo.toml | 4 ++++ nix/pkgs/default/default.nix | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 053f605a..e5f30f91 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -166,3 +166,7 @@ jemalloc = ["dep:tikv-jemallocator"] rocksdb = ["dep:rocksdb"] sqlite = ["dep:rusqlite", "dep:parking_lot", "tokio/signal"] systemd = ["dep:sd-notify"] + +[profile.release-debug] +inherits = "release" +debug = true diff --git a/nix/pkgs/default/default.nix b/nix/pkgs/default/default.nix index 7aa9151e..cb7be038 100644 --- a/nix/pkgs/default/default.nix +++ b/nix/pkgs/default/default.nix @@ -78,7 +78,7 @@ let ]; }; - dontStrip = profile == "dev"; + dontStrip = profile != "release"; buildInputs = lib.optional (featureEnabled "jemalloc") rust-jemalloc-sys;