aboutsummaryrefslogtreecommitdiff
path: root/tests/GhcSession.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/GhcSession.hs')
-rw-r--r--tests/GhcSession.hs17
1 files changed, 5 insertions, 12 deletions
diff --git a/tests/GhcSession.hs b/tests/GhcSession.hs
index 91e30aa..b555f47 100644
--- a/tests/GhcSession.hs
+++ b/tests/GhcSession.hs
@@ -17,7 +17,6 @@ import qualified Control.Exception as E
import Control.Monad
import Control.Monad.IO.Class
import Data.List
-import Data.Tuple
import Data.Version
import Data.Bifunctor
import qualified Data.Map as Map
@@ -26,6 +25,7 @@ import System.Exit
import System.FilePath ((</>), (<.>), makeRelative, takeDirectory)
import System.Directory
import System.IO
+import System.IO.Unsafe (unsafePerformIO)
import System.IO.Temp
import Text.Printf (printf)
-- import Text.Show.Pretty (pPrint)
@@ -409,17 +409,10 @@ lookupStackResolver ghcVer = maybe (Left msg) Right $
msg = SkipReason $ "missing stack_resolver_table entry for "++
showVersion ghcVer
-stack_resolver_table :: [(Version, String)]
-stack_resolver_table = map (swap . second parseVer)
- [ ("lts-13.5", "8.6.3")
- , ("lts-12.26", "8.4.4")
- , ("lts-12.14", "8.4.3")
- , ("lts-11.22", "8.2.2")
- , ("lts-9.21", "8.0.2")
- , ("lts-7.24", "8.0.1")
- , ("lts-6.35", "7.10.3")
- , ("lts-3.22", "7.10.2")
- ]
+stack_resolver_table :: [(Version, String)] -- ^ (ghc version, stack resolver)
+stack_resolver_table = unsafePerformIO $
+ map (\(words -> [g, l]) -> (parseVer g, l)) . lines
+ <$> readFile "tests/stack-resolvers"
copyStackYamls :: FilePath -> FilePath -> IO ()
copyStackYamls srcdir destdir = do