From 1eac4812c8e619b621bb53f1556b6efcf4a275e9 Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Thu, 4 Apr 2024 02:03:36 -0500 Subject: [PATCH] nix: zstd-compressed debug sections in devShell This cuts the size of a final debug binary in half (~250MiB -> 127MiB) in my dev shell, and saves about 15% of total `target/` directory size when a full build from scratch happens (2GiB -> 1.7GiB). Let's take an easy free win. Signed-off-by: Austin Seipp --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 4a3bdfd93..7b769e904 100644 --- a/flake.nix +++ b/flake.nix @@ -178,7 +178,7 @@ export RUSTFLAGS="-Zthreads=0" '' + pkgs.lib.optionalString useMoldLinker '' - export RUSTFLAGS+=" -C link-arg=-fuse-ld=mold" + export RUSTFLAGS+=" -C link-arg=-fuse-ld=mold -C link-arg=-Wl,--compress-debug-sections=zstd" '' + darwinNextestHack; }; }));