@@ -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 {.. } <- useWithSeparateFingerprintRule_ GetFileModuleGraphFingerprint GetModuleGraph file
475
+ DependencyInformation {.. } <- useWithSeparateFingerprintRule_ GetModuleGraphTransDepsFingerprints 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 []
@@ -628,12 +628,6 @@ getModuleGraphRule recorder = defineEarlyCutOffNoFile (cmapWithPrio LogShake rec
628
628
fs <- toKnownFiles <$> useNoFile_ GetKnownTargets
629
629
dependencyInfoForFiles (HashSet. toList fs)
630
630
631
- getModuleGraphSingleFileRule :: Recorder (WithPriority Log ) -> Rules ()
632
- getModuleGraphSingleFileRule recorder =
633
- defineNoDiagnostics (cmapWithPrio LogShake recorder) $ \ GetFileModuleGraphFingerprint file -> do
634
- di <- useNoFile_ GetModuleGraph
635
- return $ lookupFingerprint file di
636
-
637
631
dependencyInfoForFiles :: [NormalizedFilePath ] -> Action (BS. ByteString , DependencyInformation )
638
632
dependencyInfoForFiles fs = do
639
633
(rawDepInfo, bm) <- rawDependencyInformation fs
@@ -669,7 +663,7 @@ typeCheckRuleDefinition hsc pm fp = do
669
663
unlift <- askUnliftIO
670
664
let dets = TypecheckHelpers
671
665
{ getLinkables = unliftIO unlift . uses_ GetLinkable
672
- , getModuleGraph = unliftIO unlift $ useWithSeparateFingerprintRule_ GetFileModuleGraphFingerprint GetModuleGraph fp
666
+ , getModuleGraph = unliftIO unlift $ useWithSeparateFingerprintRule_ GetModuleGraphTransDepsFingerprints GetModuleGraph fp
673
667
}
674
668
addUsageDependencies $ liftIO $
675
669
typecheckModule defer hsc dets pm
@@ -768,7 +762,7 @@ ghcSessionDepsDefinition fullModSummary GhcSessionDepsConfig{..} env file = do
768
762
let inLoadOrder = map (\ HiFileResult {.. } -> HomeModInfo hirModIface hirModDetails emptyHomeModInfoLinkable) ifaces
769
763
mg <- do
770
764
if fullModuleGraph
771
- then depModuleGraph <$> useWithSeparateFingerprintRule_ GetFileModuleGraphFingerprint GetModuleGraph file
765
+ then depModuleGraph <$> useWithSeparateFingerprintRule_ GetModuleGraphTransDepsFingerprints GetModuleGraph file
772
766
else do
773
767
let mgs = map hsc_mod_graph depSessions
774
768
-- On GHC 9.4+, the module graph contains not only ModSummary's but each `ModuleNode` in the graph
@@ -781,7 +775,7 @@ ghcSessionDepsDefinition fullModSummary GhcSessionDepsConfig{..} env file = do
781
775
nubOrdOn mkNodeKey (ModuleNode final_deps ms : concatMap mgModSummaries' mgs)
782
776
liftIO $ evaluate $ liftRnf rwhnf module_graph_nodes
783
777
return $ mkModuleGraph module_graph_nodes
784
- de <- useWithSeparateFingerprintRule_ GetFileModuleGraphFingerprint GetModuleGraph file
778
+ de <- useWithSeparateFingerprintRule_ GetModuleGraphTransDepsFingerprints GetModuleGraph file
785
779
session' <- liftIO $ mergeEnvs hsc mg de ms inLoadOrder depSessions
786
780
787
781
-- Here we avoid a call to to `newHscEnvEqWithImportPaths`, which creates a new
@@ -811,7 +805,7 @@ getModIfaceFromDiskRule recorder = defineEarlyCutoff (cmapWithPrio LogShake reco
811
805
, old_value = m_old
812
806
, get_file_version = use GetModificationTime_ {missingFileDiagnostics = False }
813
807
, get_linkable_hashes = \ fs -> map (snd . fromJust . hirCoreFp) <$> uses_ GetModIface fs
814
- , get_module_graph = useWithSeparateFingerprintRule_ GetFileModuleGraphFingerprint GetModuleGraph f
808
+ , get_module_graph = useWithSeparateFingerprintRule_ GetModuleGraphTransDepsFingerprints GetModuleGraph f
815
809
, regenerate = regenerateHiFile session f ms
816
810
}
817
811
hsc_env' <- setFileCacheHook (hscEnv session)
@@ -1145,7 +1139,7 @@ needsCompilationRule file
1145
1139
| " boot" `isSuffixOf` fromNormalizedFilePath file =
1146
1140
pure (Just $ encodeLinkableType Nothing , Just Nothing )
1147
1141
needsCompilationRule file = do
1148
- graph <- useWithSeparateFingerprintRule GetFileModuleGraphFingerprint GetModuleGraph file
1142
+ graph <- useWithSeparateFingerprintRule GetModuleGraphImmediateReverseDepsFingerprints GetModuleGraph file
1149
1143
res <- case graph of
1150
1144
-- Treat as False if some reverse dependency header fails to parse
1151
1145
Nothing -> pure Nothing
@@ -1236,7 +1230,6 @@ mainRule recorder RulesConfig{..} = do
1236
1230
getModIfaceRule recorder
1237
1231
getModSummaryRule templateHaskellWarning recorder
1238
1232
getModuleGraphRule recorder
1239
- getModuleGraphSingleFileRule recorder
1240
1233
getFileHashRule recorder
1241
1234
knownFilesRule recorder
1242
1235
getClientSettingsRule recorder
@@ -1258,6 +1251,15 @@ mainRule recorder RulesConfig{..} = do
1258
1251
persistentDocMapRule
1259
1252
persistentImportMapRule
1260
1253
getLinkableRule recorder
1254
+ defineNoDiagnostics (cmapWithPrio LogShake recorder) $ \ GetModuleGraphTransDepsFingerprints file -> do
1255
+ di <- useNoFile_ GetModuleGraph
1256
+ return $ lookupFingerprint file di (depTransDepsFingerprints di)
1257
+ defineNoDiagnostics (cmapWithPrio LogShake recorder) $ \ GetModuleGraphTransReverseDepsFingerprints file -> do
1258
+ di <- useNoFile_ GetModuleGraph
1259
+ return $ lookupFingerprint file di (depTransReverseDepsFingerprints di)
1260
+ defineNoDiagnostics (cmapWithPrio LogShake recorder) $ \ GetModuleGraphImmediateReverseDepsFingerprints file -> do
1261
+ di <- useNoFile_ GetModuleGraph
1262
+ return $ lookupFingerprint file di (depImmediateReverseDepsFingerprints di)
1261
1263
1262
1264
-- | Get HieFile for haskell file on NormalizedFilePath
1263
1265
getHieFile :: NormalizedFilePath -> Action (Maybe HieFile )
0 commit comments