aboutsummaryrefslogtreecommitdiff
path: root/src/CabalHelper
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2019-12-29 15:55:20 +0100
committerDaniel Gröber <dxld@darkboxed.org>2019-12-29 16:35:59 +0100
commitcd293cc8ef24d5014bdea150f7d315d43126d055 (patch)
treefb47d1a4b9cd0dbd92da4e5228dcbd3606f3b9ba /src/CabalHelper
parent621f81d9a5b31990c08453c67b26fbfc11ae3bf4 (diff)
ghc-session: Get GHC libdir from --print-libdir command
Using ghc-paths bypasses cabal's rebuild checks though, for example, installing the compiler into a different directory will change the libdir but cabal won't recompile ghc-paths.
Diffstat (limited to 'src/CabalHelper')
-rw-r--r--src/CabalHelper/Compiletime/Program/GHC.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/CabalHelper/Compiletime/Program/GHC.hs b/src/CabalHelper/Compiletime/Program/GHC.hs
index 293d0af..b24222f 100644
--- a/src/CabalHelper/Compiletime/Program/GHC.hs
+++ b/src/CabalHelper/Compiletime/Program/GHC.hs
@@ -64,6 +64,10 @@ ghcVersion :: (Verbose, Progs) => IO GhcVersion
ghcVersion = GhcVersion .
parseVer . trim <$> readProcess' (ghcProgram ?progs) ["--numeric-version"] ""
+ghcLibdir :: (Verbose, Progs) => IO FilePath
+ghcLibdir = do
+ trim <$> readProcess' (ghcProgram ?progs) ["--print-libdir"] ""
+
ghcPkgVersion :: (Verbose, Progs) => IO Version
ghcPkgVersion =
parseVer . trim . dropWhile (not . isDigit)