Recache cabal-helper stuff when cabal-helper-* executable changes
This commit is contained in:
@@ -80,18 +80,17 @@ data CabalHelper = CabalHelper {
|
||||
|
||||
cabalHelper :: (MonadIO m, GmEnv m) => m CabalHelper
|
||||
cabalHelper = withCabal $ do
|
||||
Cradle {..} <- cradle
|
||||
let cmds = [ "entrypoints"
|
||||
, "source-dirs"
|
||||
, "ghc-options"
|
||||
, "ghc-src-options"
|
||||
, "ghc-pkg-options" ]
|
||||
distdir = cradleRootDir </> "dist"
|
||||
|
||||
Cradle {..} <- cradle
|
||||
exe <- liftIO $ findLibexecExe "cabal-helper-wrapper"
|
||||
|
||||
let distdir = cradleRootDir </> "dist"
|
||||
|
||||
res <- liftIO $ cached cradleRootDir (cabalHelperCache cmds) $ do
|
||||
hexe <- liftIO $ readProcess exe [distdir, "print-exe"] ""
|
||||
res <- liftIO $ cached cradleRootDir (cabalHelperCache hexe cmds) $ do
|
||||
out <- readProcess exe (distdir:cmds) ""
|
||||
evaluate (read out) `E.catch`
|
||||
\(SomeException _) -> error "cabalHelper: read failed"
|
||||
|
||||
@@ -233,9 +233,10 @@ cabalBuildPlatform = dropWhileEnd isSpace $ unsafePerformIO $
|
||||
packageCache :: String
|
||||
packageCache = "package.cache"
|
||||
|
||||
cabalHelperCache :: [String] -> Cached [String] [Maybe GmCabalHelperResponse]
|
||||
cabalHelperCache cmds = Cached {
|
||||
inputFiles = [setupConfigPath],
|
||||
cabalHelperCache ::
|
||||
FilePath -> [String] -> Cached [String] [Maybe GmCabalHelperResponse]
|
||||
cabalHelperCache cabalHelperExe cmds = Cached {
|
||||
inputFiles = [cabalHelperExe, setupConfigPath],
|
||||
inputData = cmds,
|
||||
cacheFile = setupConfigPath <.> "ghc-mod.cabal-helper"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user