From d1da6ab2896fa37aecf31d9822a12056eecec365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Fri, 9 May 2014 20:36:20 +0200 Subject: [PATCH] Make getSystemLibDir use `GHC.Paths` instead of running `ghc` --- Language/Haskell/GhcMod/GHCApi.hs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Language/Haskell/GhcMod/GHCApi.hs b/Language/Haskell/GhcMod/GHCApi.hs index ec87093..e30b3b0 100644 --- a/Language/Haskell/GhcMod/GHCApi.hs +++ b/Language/Haskell/GhcMod/GHCApi.hs @@ -24,22 +24,18 @@ import Data.Maybe (isJust, fromJust) import Exception (ghandle, SomeException(..)) import GHC (Ghc, GhcMonad, DynFlags(..), GhcLink(..), HscTarget(..), LoadHowMuch(..)) import qualified GHC as G +import GHC.Paths (libdir) import qualified Language.Haskell.GhcMod.Gap as Gap import Language.Haskell.GhcMod.Types import System.Exit (exitSuccess) import System.IO (hPutStr, hPrint, stderr) import System.IO.Unsafe (unsafePerformIO) -import System.Process (readProcess) ---------------------------------------------------------------- -- | Obtaining the directory for system libraries. getSystemLibDir :: IO (Maybe FilePath) -getSystemLibDir = do - res <- readProcess "ghc" ["--print-libdir"] [] - return $ case res of - "" -> Nothing - dirn -> Just (init dirn) +getSystemLibDir = return $ Just libdir ----------------------------------------------------------------