diff options
-rw-r--r-- | lib/Distribution/Helper.hs | 12 | ||||
-rw-r--r-- | src/CabalHelper/Compiletime/Program/CabalInstall.hs | 2 |
2 files changed, 8 insertions, 6 deletions
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 diff --git a/src/CabalHelper/Compiletime/Program/CabalInstall.hs b/src/CabalHelper/Compiletime/Program/CabalInstall.hs index 6b6d401..3f87215 100644 --- a/src/CabalHelper/Compiletime/Program/CabalInstall.hs +++ b/src/CabalHelper/Compiletime/Program/CabalInstall.hs @@ -228,7 +228,7 @@ cabalV2WithGHCProgOpts :: Progs => [String] cabalV2WithGHCProgOpts = concat [ [ "--with-compiler=" ++ ghcProgram ?cprogs ] , if ghcPkgProgram ?cprogs /= ghcPkgProgram defaultCompPrograms - then error "cabalV2WithGHCProgOpts: ghc-pkg path was changed from default but cabal v2-install does not support passing --with-ghc-pkg!" + then [ "--with-hc-pkg=" ++ ghcPkgProgram ?cprogs ] else [] ] |