@@ -472,7 +472,7 @@ rawDependencyInformation fs = do
472
472
reportImportCyclesRule :: Recorder (WithPriority Log ) -> Rules ()
473
473
reportImportCyclesRule recorder =
474
474
defineEarlyCutoff (cmapWithPrio LogShake recorder) $ Rule $ \ ReportImportCycles file -> fmap (\ errs -> if null errs then (Just " 1" ,([] , Just () )) else (Nothing , (errs, Nothing ))) $ do
475
- DependencyInformation {.. } <- use_ GetFileModuleGraph file
475
+ DependencyInformation {.. } <- useWithSeparateFingerprintRule_ GetFileModuleGraphFingerprint GetModuleGraph file
476
476
case pathToId depPathIdMap file of
477
477
-- The header of the file does not parse, so it can't be part of any import cycles.
478
478
Nothing -> pure []
@@ -630,9 +630,9 @@ getModuleGraphRule recorder = defineEarlyCutOffNoFile (cmapWithPrio LogShake rec
630
630
631
631
getModuleGraphSingleFileRule :: Recorder (WithPriority Log ) -> Rules ()
632
632
getModuleGraphSingleFileRule recorder =
633
- defineEarlyCutoff (cmapWithPrio LogShake recorder) $ Rule $ \ GetFileModuleGraph file -> do
633
+ defineNoDiagnostics (cmapWithPrio LogShake recorder) $ \ GetFileModuleGraphFingerprint file -> do
634
634
di <- useNoFile_ GetModuleGraph
635
- return (fingerprintToBS <$> lookupFingerprint file di, ( [] , Just di))
635
+ return $ lookupFingerprint file di
636
636
637
637
dependencyInfoForFiles :: [NormalizedFilePath ] -> Action (BS. ByteString , DependencyInformation )
638
638
dependencyInfoForFiles fs = do
@@ -669,7 +669,7 @@ typeCheckRuleDefinition hsc pm fp = do
669
669
unlift <- askUnliftIO
670
670
let dets = TypecheckHelpers
671
671
{ getLinkables = unliftIO unlift . uses_ GetLinkable
672
- , getModuleGraph = unliftIO unlift $ use_ GetFileModuleGraph fp
672
+ , getModuleGraph = unliftIO unlift $ useWithSeparateFingerprintRule_ GetFileModuleGraphFingerprint GetModuleGraph fp
673
673
}
674
674
addUsageDependencies $ liftIO $
675
675
typecheckModule defer hsc dets pm
@@ -768,7 +768,7 @@ ghcSessionDepsDefinition fullModSummary GhcSessionDepsConfig{..} env file = do
768
768
let inLoadOrder = map (\ HiFileResult {.. } -> HomeModInfo hirModIface hirModDetails emptyHomeModInfoLinkable) ifaces
769
769
mg <- do
770
770
if fullModuleGraph
771
- then depModuleGraph <$> use_ GetFileModuleGraph file
771
+ then depModuleGraph <$> useWithSeparateFingerprintRule_ GetFileModuleGraphFingerprint GetModuleGraph file
772
772
else do
773
773
let mgs = map hsc_mod_graph depSessions
774
774
-- On GHC 9.4+, the module graph contains not only ModSummary's but each `ModuleNode` in the graph
@@ -781,7 +781,7 @@ ghcSessionDepsDefinition fullModSummary GhcSessionDepsConfig{..} env file = do
781
781
nubOrdOn mkNodeKey (ModuleNode final_deps ms : concatMap mgModSummaries' mgs)
782
782
liftIO $ evaluate $ liftRnf rwhnf module_graph_nodes
783
783
return $ mkModuleGraph module_graph_nodes
784
- de <- use_ GetFileModuleGraph file
784
+ de <- useWithSeparateFingerprintRule_ GetFileModuleGraphFingerprint GetModuleGraph file
785
785
session' <- liftIO $ mergeEnvs hsc mg de ms inLoadOrder depSessions
786
786
787
787
-- Here we avoid a call to to `newHscEnvEqWithImportPaths`, which creates a new
@@ -811,7 +811,7 @@ getModIfaceFromDiskRule recorder = defineEarlyCutoff (cmapWithPrio LogShake reco
811
811
, old_value = m_old
812
812
, get_file_version = use GetModificationTime_ {missingFileDiagnostics = False }
813
813
, get_linkable_hashes = \ fs -> map (snd . fromJust . hirCoreFp) <$> uses_ GetModIface fs
814
- , get_module_graph = use_ GetFileModuleGraph f
814
+ , get_module_graph = useWithSeparateFingerprintRule_ GetFileModuleGraphFingerprint GetModuleGraph f
815
815
, regenerate = regenerateHiFile session f ms
816
816
}
817
817
hsc_env' <- setFileCacheHook (hscEnv session)
@@ -1145,7 +1145,7 @@ needsCompilationRule file
1145
1145
| " boot" `isSuffixOf` fromNormalizedFilePath file =
1146
1146
pure (Just $ encodeLinkableType Nothing , Just Nothing )
1147
1147
needsCompilationRule file = do
1148
- graph <- use GetFileModuleGraph file
1148
+ graph <- useWithSeparateFingerprintRule GetFileModuleGraphFingerprint GetModuleGraph file
1149
1149
res <- case graph of
1150
1150
-- Treat as False if some reverse dependency header fails to parse
1151
1151
Nothing -> pure Nothing
0 commit comments