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 <aseipp@pobox.com>
This commit is contained in:
Austin Seipp 2024-04-04 02:03:36 -05:00
parent ad34d10951
commit 1eac4812c8

View file

@ -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;
};
}));