Skip to content

Commit

Permalink
justStaticExecutables: enable -dead_strip on mac to shrink closure
Browse files Browse the repository at this point in the history
  • Loading branch information
cleverca22 committed Jun 14, 2017
1 parent 0032e55 commit 24d313e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkgs/development/haskell-modules/lib.nix
Expand Up @@ -89,7 +89,10 @@ rec {
isLibrary = false;
doHaddock = false;
postFixup = "rm -rf $out/lib $out/nix-support $out/share/doc";
});
} // (if pkgs.stdenv.isDarwin then {
configureFlags = (drv.configureFlags or []) ++ ["--ghc-option=-optl=-dead_strip"];
} else {})
);

buildFromSdist = pkg: pkgs.lib.overrideDerivation pkg (drv: {
unpackPhase = let src = sdistTarball pkg; tarname = "${pkg.pname}-${pkg.version}"; in ''
Expand Down

4 comments on commit 24d313e

@matthewbauer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are getting this issue now on macOS:

https://hydra.nixos.org/build/71620813/nixlog/2

"ld: -r and -dead_strip cannot be used together"

Does that mean we need to revert this commit?

/cc @pikajude @cleverca22

@LnL7
Copy link
Member

@LnL7 LnL7 commented on 24d313e Mar 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it specific to ShellCheck or do more executables have problems with this?

@matthewbauer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't seen any others with the issue. Don't know where the '-r' option is coming from but at least I'm pretty sure that we are always setting '-dead_strip' here.

@matthewbauer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like others have it to. #37750

Please sign in to comment.