From cd293cc8ef24d5014bdea150f7d315d43126d055 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Sun, 29 Dec 2019 15:55:20 +0100 Subject: 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. --- src/CabalHelper/Compiletime/Program/GHC.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/CabalHelper/Compiletime') 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) -- cgit v1.2.3