aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2019-07-31 17:07:39 +0200
committerDaniel Gröber (dxld) <dxld@darkboxed.org>2019-09-17 17:48:26 +0200
commita93ed8c7d93df1860d2e56b400b724ac47edf470 (patch)
tree85360f0ca82a0e920ffd38b0aaa0318555d9b072 /lib
parent5ab34761ed8789286cd382273503129cc7a7134f (diff)
Merge CompPrograms back into Programs
We need to support passing down the path to ghc to new-build/stack in order to support using a non-default 'ghc' executable.
Diffstat (limited to 'lib')
-rw-r--r--lib/Distribution/Helper.hs17
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/Distribution/Helper.hs b/lib/Distribution/Helper.hs
index c7689f9..c269a5c 100644
--- a/lib/Distribution/Helper.hs
+++ b/lib/Distribution/Helper.hs
@@ -60,7 +60,6 @@ module Distribution.Helper (
, mkQueryEnv
, qeReadProcess
, qePrograms
- , qeCompPrograms
, qeProjLoc
, qeDistDir
@@ -78,8 +77,6 @@ module Distribution.Helper (
-- * Programs
, Programs(..)
, defaultPrograms
- , CompPrograms(..)
- , defaultCompPrograms
-- * Query result types
, ChComponentInfo(..)
@@ -206,7 +203,6 @@ mkQueryEnv projloc distdir = do
-- something
callProcessStderr mcwd exe args
, qePrograms = defaultPrograms
- , qeCompPrograms = defaultCompPrograms
, qeProjLoc = projloc
, qeDistDir = distdir
, qeCacheRef = cr
@@ -613,15 +609,14 @@ withVerbosity act = do
withProgs
:: Verbose => ProjInfoImpl pt -> QueryEnvI c pt -> (Env => IO a) -> IO a
withProgs impl QueryEnv{..} f = do
- cprogs <- guessCompProgramPaths $ case impl of
+ progs <- guessCompProgramPaths $ case impl of
ProjInfoStack projPaths ->
- Stack.patchCompPrograms projPaths qeCompPrograms
- _ -> qeCompPrograms
- let ?cprogs = cprogs in
- let ?progs = qePrograms in f
+ Stack.patchCompPrograms projPaths qePrograms
+ _ -> qePrograms
+ let ?progs = progs in f
where
-- | Determine ghc-pkg path from ghc path
- guessCompProgramPaths :: Verbose => CompPrograms -> IO CompPrograms
+ guessCompProgramPaths :: Verbose => Programs -> IO Programs
guessCompProgramPaths progs
| same ghcProgram progs dprogs = return progs
guessCompProgramPaths progs = do
@@ -648,7 +643,7 @@ withProgs impl QueryEnv{..} f = do
}
same f o o' = f o == f o'
- dprogs = defaultCompPrograms
+ dprogs = defaultPrograms
newtype Helper pt
= Helper { runHelper :: Unit pt -> [String] -> IO [Maybe ChResponse] }