More sensitive to cache invalidation.

This addresses a problem where changes to a .cabal file were not
invalidating the cache files.
This commit is contained in:
Anthony Cowley 2015-07-02 21:50:08 -04:00
parent 3bf4243baf
commit e06e4d25df

View File

@ -199,8 +199,9 @@ resolvedComponentsCache = Cached {
cacheFile = resolvedComponentsCacheFile,
cachedAction = \tcfs comps ma -> do
Cradle {..} <- cradle
let mums =
case invalidatingInputFiles tcfs of
let iifsM = invalidatingInputFiles tcfs
mums =
case iifsM of
Nothing -> Nothing
Just iifs ->
let
@ -210,10 +211,12 @@ resolvedComponentsCache = Cached {
in if null changedFiles
then Nothing
else Just $ map Left changedFiles
case ma of
Just mcs -> gmsGet >>= \s -> gmsPut s { gmComponents = mcs }
Nothing -> return ()
setupChanged = maybe False
(elem $ cradleRootDir </> setupConfigPath)
iifsM
case (setupChanged, ma) of
(False, Just mcs) -> gmsGet >>= \s -> gmsPut s { gmComponents = mcs }
_ -> return ()
-- liftIO $ print ("changed files", mums :: Maybe [Either FilePath ()])