Fix writeAutogen when no systemwide ghc is installed (#660)
This commit is contained in:
parent
3bba2d1be9
commit
33e9751390
@ -113,32 +113,30 @@ getComponents = chCached $ \distdir -> Cached {
|
||||
, (a', c) <- lc
|
||||
, a == a'
|
||||
]
|
||||
runCHQuery :: (IOish m, GmOut m, GmEnv m) => Query m b -> m b
|
||||
runCHQuery a = do
|
||||
|
||||
getQueryEnv :: (IOish m, GmOut m, GmEnv m) => m QueryEnv
|
||||
getQueryEnv = do
|
||||
crdl <- cradle
|
||||
progs <- patchStackPrograms crdl =<< (optPrograms <$> options)
|
||||
readProc <- gmReadProcess
|
||||
let projdir = cradleRootDir crdl
|
||||
distdir = projdir </> cradleDistDir crdl
|
||||
return (defaultQueryEnv projdir distdir) {
|
||||
qeReadProcess = readProc
|
||||
, qePrograms = helperProgs progs
|
||||
}
|
||||
|
||||
opts <- options
|
||||
progs <- patchStackPrograms crdl (optPrograms opts)
|
||||
|
||||
readProc <- gmReadProcess
|
||||
|
||||
let qe = (defaultQueryEnv projdir distdir) {
|
||||
qeReadProcess = readProc
|
||||
, qePrograms = helperProgs progs
|
||||
}
|
||||
runCHQuery :: (IOish m, GmOut m, GmEnv m) => Query m b -> m b
|
||||
runCHQuery a = do
|
||||
qe <- getQueryEnv
|
||||
runQuery qe a
|
||||
|
||||
|
||||
prepareCabalHelper :: (IOish m, GmEnv m, GmOut m, GmLog m) => m ()
|
||||
prepareCabalHelper = do
|
||||
crdl <- cradle
|
||||
let projdir = cradleRootDir crdl
|
||||
distdir = projdir </> cradleDistDir crdl
|
||||
readProc <- gmReadProcess
|
||||
when (isCabalHelperProject $ cradleProject crdl) $
|
||||
withCabal $ liftIO $ prepare readProc projdir distdir
|
||||
withCabal $ prepare' =<< getQueryEnv
|
||||
|
||||
withAutogen :: (IOish m, GmEnv m, GmOut m, GmLog m) => m a -> m a
|
||||
withAutogen action = do
|
||||
@ -155,15 +153,14 @@ withAutogen action = do
|
||||
|
||||
when (mCabalMacroHeader < mCabalFile || mCabalPathsModule < mCabalFile) $ do
|
||||
gmLog GmDebug "" $ strDoc $ "autogen files out of sync"
|
||||
writeAutogen projdir distdir
|
||||
writeAutogen
|
||||
|
||||
action
|
||||
|
||||
where
|
||||
writeAutogen projdir distdir = do
|
||||
readProc <- gmReadProcess
|
||||
writeAutogen = do
|
||||
gmLog GmDebug "" $ strDoc $ "writing Cabal autogen files"
|
||||
liftIO $ writeAutogenFiles readProc projdir distdir
|
||||
writeAutogenFiles' =<< getQueryEnv
|
||||
|
||||
|
||||
withCabal :: (IOish m, GmEnv m, GmOut m, GmLog m) => m a -> m a
|
||||
|
@ -160,7 +160,7 @@ Library
|
||||
, bytestring < 0.11
|
||||
, binary < 0.8 && >= 0.5.1.0
|
||||
, containers < 0.6
|
||||
, cabal-helper < 0.7 && >= 0.6.1.0
|
||||
, cabal-helper < 0.7 && >= 0.6.3.0
|
||||
, deepseq < 1.5
|
||||
, directory < 1.3
|
||||
, filepath < 1.5
|
||||
|
Loading…
Reference in New Issue
Block a user