git.iko.soy/typeable/nixpkgs
on master help sign in
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`'

commit6498f468afc29293cc602e29fe5448cfd046d657 authorChuck <chuck@intelligence.org> dateFri 13 Dec 2019, 14:08 (7 years ago) parentfbfd77b
1 file changed+1
pkgs/build-support/writers/default.nix+1
pkgs/build-support/writers/default.nix+1
@@ -148,6 +148,7 @@ rec {
148148 cp $contentPath tmp.hs
149149 ${ghc.withPackages (_: libraries )}/bin/ghc tmp.hs
150150 mv tmp $out
151+ ${pkgs.binutils-unwrapped}/bin/strip --strip-unneeded "$out"
151152 '';
152153 } name;
153154