From 6498f468afc29293cc602e29fe5448cfd046d657 Mon Sep 17 00:00:00 2001 From: Chuck Date: Fri, 13 Dec 2019 14:08:56 -0800 Subject: [PATCH] WriteHaskell: Strip binaries This reduces the size of Hello World [1] from 3.06 MiB to 678 KiB. [1] As measured by nix-shell -p 'writers.writeHaskellBin "hello" {} "main = putStrLn \"hello\""' --run 'ls -l `which hello`' --- pkgs/build-support/writers/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/build-support/writers/default.nix b/pkgs/build-support/writers/default.nix index 2cd4f1af022b..b90c6490e4a6 100644 --- a/pkgs/build-support/writers/default.nix +++ b/pkgs/build-support/writers/default.nix @@ -148,6 +148,7 @@ rec { cp $contentPath tmp.hs ${ghc.withPackages (_: libraries )}/bin/ghc tmp.hs mv tmp $out + ${pkgs.binutils-unwrapped}/bin/strip --strip-unneeded "$out" ''; } name;