Skip to content

Commit fa2c7c1

Browse files
committed
fix always add SessionCacheVersion deps
1 parent 98a8ca1 commit fa2c7c1

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

ghcide/session-loader/Development/IDE/Session.hs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -722,21 +722,21 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir = do
722722
hieYamlRule :: Rules ()
723723
hieYamlRule = defineNoDiagnostics (cmapWithPrio LogShake recorder) $ \HieYaml file ->
724724
-- only one cradle consult at a time
725-
UnliftIO.withMVar cradleLock $ const $ do
725+
UnliftIO.withMVar cradleLock $ const $ do
726726
hieYaml <- use_ CradleLoc file
727727
-- check the reason we are called
728728
v <- Map.findWithDefault HM.empty hieYaml <$> (liftIO$readVar fileToFlags)
729+
case HM.lookup file v of
730+
-- we already have the cache but it is still called, it must be deps changed
731+
-- clear the cache and reconsult
732+
-- we bump the version of the cache to inform others
733+
Just _ -> do
734+
liftIO clearCache
735+
-- we don't have the cache, consult
736+
Nothing -> pure ()
737+
-- install cache version check to avoid recompilation
738+
_ <- useNoFile_ SessionCacheVersion
729739
catchError file hieYaml $ do
730-
case HM.lookup file v of
731-
-- we already have the cache but it is still called, it must be deps changed
732-
-- clear the cache and reconsult
733-
-- we bump the version of the cache to inform others
734-
Just _ -> do
735-
liftIO clearCache
736-
-- we don't have the cache, consult
737-
Nothing -> pure ()
738-
-- install cache version check to avoid recompilation
739-
_ <- useNoFile_ SessionCacheVersion
740740
result@(_, deps) <- consultCradle file
741741
-- add the deps to the Shake graph
742742
let addDependency fp = do

0 commit comments

Comments
 (0)