Commit 3f604e47 authored by Vaibhav Sagar's avatar Vaibhav Sagar

Always set -dynamic-too

This improves Nix compatibility without changing Stack or Cabal
compatibility. See #728.
parent b49fc4a1
......@@ -62,14 +62,6 @@ let
ihaskell = nixpkgs.haskell.lib.overrideCabal (
self.callCabal2nix "ihaskell" ihaskell-src {}) (_drv: {
postPatch = let
# Nix-built IHaskell expects to load a *.dyn_o file instead of *.o,
# see https://github.com/gibiansky/IHaskell/issues/728
original = ''
setSessionDynFlags
flags'';
replacement = ''
setSessionDynFlags $ flip gopt_set Opt_BuildDynamicToo
flags'';
# The tests seem to 'buffer' when run during nix-build, so this is
# a throw-away test to get everything running smoothly and passing.
originalTest = ''
......@@ -80,8 +72,6 @@ let
let throwAway string _ = evaluationComparing (const $ shouldBe True True) string
in throwAway "True" ["True"]'';
in ''
substituteInPlace ./src/IHaskell/Eval/Evaluate.hs --replace \
'${original}' '${replacement}'
substituteInPlace ./src/tests/IHaskell/Test/Eval.hs --replace \
'${originalTest}' '${replacementTest}'
'';
......
......@@ -40,14 +40,6 @@ let
ihaskell = nixpkgs.haskell.lib.overrideCabal (
self.callCabal2nix "ihaskell" ihaskell-src {}) (_drv: {
postPatch = let
# Nix-built IHaskell expects to load a *.dyn_o file instead of *.o,
# see https://github.com/gibiansky/IHaskell/issues/728
original = ''
setSessionDynFlags
flags'';
replacement = ''
setSessionDynFlags $ flip gopt_set Opt_BuildDynamicToo
flags'';
# The tests seem to 'buffer' when run during nix-build, so this is
# a throw-away test to get everything running smoothly and passing.
originalTest = ''
......@@ -58,8 +50,6 @@ let
let throwAway string _ = evaluationComparing (const $ shouldBe True True) string
in throwAway "True" ["True"]'';
in ''
substituteInPlace ./src/IHaskell/Eval/Evaluate.hs --replace \
'${original}' '${replacement}'
substituteInPlace ./src/tests/IHaskell/Test/Eval.hs --replace \
'${originalTest}' '${replacementTest}'
'';
......
......@@ -1080,7 +1080,7 @@ doLoadModule name modName = do
-- Compile loaded modules.
flags <- getSessionDynFlags
errRef <- liftIO $ newIORef []
setSessionDynFlags
setSessionDynFlags $ flip gopt_set Opt_BuildDynamicToo
flags
{ hscTarget = objTarget flags
#if MIN_VERSION_ghc(8,0,0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment