@@ -680,17 +680,19 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
680
680
return (([renderPackageSetupException cfp GhcVersionMismatch {.. }], Nothing ),Map. empty)
681
681
-- Failure case, either a cradle error or the none cradle
682
682
Left err -> do
683
- if (not $ null extraToLoads)
683
+ let attemptToLoadFiles = (Set. delete cfp $ Set. fromList $ concatMap cradleErrorLoadingFiles err)
684
+ `Set.difference` old_files
685
+ if (not $ null attemptToLoadFiles)
684
686
then do
685
687
-- mark as less loaded files as failedLoadingFiles as possible
686
688
-- limitation is that when we are loading files, and the dependencies of old_files
687
689
-- are changed, and old_files are not valid anymore.
688
690
-- but they will still be in the old_files, and will not move to error_loading_files.
689
691
-- And make other files failed to load in batch mode.
690
- let failedLoadingFiles = (Set. insert cfp extraToLoads) `Set.difference` old_files
692
+ let failedLoadingFiles = (Set. insert cfp attemptToLoadFiles)
691
693
atomicModifyIORef' error_loading_files (\ xs -> (failedLoadingFiles <> xs,() ))
692
694
-- retry without other files
693
- logWith recorder Info $ LogSessionReloadOnError cfp (Set. toList pendingFiles )
695
+ logWith recorder Info $ LogSessionReloadOnError cfp (Set. toList attemptToLoadFiles )
694
696
consultCradle hieYaml cfp
695
697
else do
696
698
dep_info <- getDependencyInfo ((maybeToList hieYaml) ++ concatMap cradleErrorDependencies err)
0 commit comments