Fix cabal-helper >= 0.5

This commit is contained in:
Daniel Gröber 2015-08-12 09:04:09 +02:00
parent 6a01550d3f
commit 9b286cc4e1
2 changed files with 7 additions and 4 deletions

View File

@ -125,6 +125,10 @@ withCabal :: (IOish m, GmEnv m, GmLog m) => m a -> m a
withCabal action = do
crdl <- cradle
opts <- options
let projdir = cradleRootDir crdl
distdir = projdir </> "dist"
mCabalFile <- liftIO $ timeFile `traverse` cradleCabalFile crdl
mCabalConfig <- liftIO $ timeMaybe (setupConfigFile crdl)
@ -133,8 +137,7 @@ withCabal action = do
pkgDbStackOutOfSync <-
case mCusPkgDbStack of
Just cusPkgDbStack -> do
let root = cradleRootDir crdl
pkgDb <- runQuery' (helperProgs opts) root (root </> "dist") $
pkgDb <- runQuery' (helperProgs opts) projdir distdir $
map chPkgToGhcPkg <$> packageDbStack
return $ pkgDb /= cusPkgDbStack
@ -161,7 +164,7 @@ withCabal action = do
++ map pkgDbArg cusPkgStack
liftIO $ void $ readProcess (T.cabalProgram opts) ("configure":progOpts) ""
gmLog GmDebug "" $ strDoc $ "writing Cabal autogen files"
liftIO $ writeAutogenFiles $ cradleRootDir crdl </> "dist"
liftIO $ writeAutogenFiles readProcess projdir distdir
action
pkgDbArg :: GhcPkgDb -> String

View File

@ -132,7 +132,7 @@ Library
, bytestring
, cereal >= 0.4
, containers
, cabal-helper == 0.4.* && >= 0.4.0.0
, cabal-helper == 0.5.* && >= 0.5.0.0
, deepseq
, directory
, filepath