Skip to content
This repository was archived by the owner on Feb 13, 2021. It is now read-only.

Commit

Permalink
Dynamically link HIE for great TH speedup
Browse files Browse the repository at this point in the history
See domenkozar/hie-nix#59

Thanks to @mpickering for pointing this out
  • Loading branch information
infinisil committed Apr 27, 2019
1 parent 504bb9c commit b1ee410
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ let
# Embed the ghc version into the name
pname = "${old.pname}-${ghcVersion}";
version = lib.substring 0 8 revision;

# Link Haskell libraries dynamically, improves startup time for projects
# using TH by a lot (40x faster in one of my tests), but also Increases
# closure size by about 50% (=~ 1.2GB) per HIE version
# Can be disabled again for GHC versions that have a fix for
# https://gitlab.haskell.org/ghc/ghc/issues/15524
enableSharedExecutables = true;
isLibrary = false;
doHaddock = false;
})).overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs or [] ++ [ pkgs.makeWrapper ];
# Make sure hie-x.x.x binary exists
Expand Down Expand Up @@ -98,9 +107,7 @@ let
pkgs = forGhc.pkgs;
};

build = hlib.justStaticExecutables
(expr.override overrideFun).haskell-ide-engine;

build = (expr.override overrideFun).haskell-ide-engine;
in build;

# A set of all ghc versions for all hie versions, like
Expand Down

0 comments on commit b1ee410

Please sign in to comment.