From 74704110ca0eb6760a6e133ac88133a590d4ef8f Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Wed, 30 Jan 2019 20:58:02 +0100 Subject: Fix ghc-pkg guessing logic when using v2-install --- lib/Distribution/Helper.hs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/Distribution/Helper.hs b/lib/Distribution/Helper.hs index 664ff01..ca5c1b1 100644 --- a/lib/Distribution/Helper.hs +++ b/lib/Distribution/Helper.hs @@ -588,13 +588,15 @@ withProgs impl QueryEnv{..} f = do where -- | Determine ghc-pkg path from ghc path guessCompProgramPaths :: Verbose => CompPrograms -> IO CompPrograms + guessCompProgramPaths progs + | same ghcProgram progs dprogs = return progs guessCompProgramPaths progs = do let v | ?verbose = deafening | otherwise = silent mGhcPath0 | same ghcProgram progs dprogs = Nothing - | otherwise = Just $ ghcProgram progs + | otherwise = Just $ ghcProgram progs mGhcPkgPath0 | same ghcPkgProgram progs dprogs = Nothing - | otherwise = Just $ ghcPkgProgram progs + | otherwise = Just $ ghcPkgProgram progs (_compiler, _mplatform, progdb) <- GHC.configure v @@ -608,9 +610,9 @@ withProgs impl QueryEnv{..} f = do { ghcProgram = fromMaybe (ghcProgram progs) mghcPath1 , ghcPkgProgram = fromMaybe (ghcProgram progs) mghcPkgPath1 } - where - same f o o' = f o == f o' - dprogs = defaultCompPrograms + + same f o o' = f o == f o' + dprogs = defaultCompPrograms getHelperExe :: ProjInfo pt -> QueryEnvI c pt -> IO FilePath -- cgit v1.2.3