@@ -677,6 +677,7 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
677
677
atomicModifyIORef' error_loading_files (\ xs -> (failedLoadingFiles <> xs,() ))
678
678
-- retry without other files
679
679
atomically $ forM_ pendingFiles (writeTQueue pendingFilesTQueue)
680
+ logWith recorder Info $ LogSessionReloadOnError cfp (Set. toList pendingFiles)
680
681
consultCradle hieYaml cfp
681
682
else do
682
683
dep_info <- getDependencyInfo (maybeToList hieYaml)
@@ -724,8 +725,7 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
724
725
atomicModifyIORef' cradle_files (\ _ -> (Set. empty,() ))
725
726
726
727
v <- Map. findWithDefault HM. empty hieYaml <$> readVar fileToFlags
727
- let cfp = toAbsolutePath file
728
- case HM. lookup (toNormalizedFilePath' cfp) v of
728
+ case HM. lookup (toNormalizedFilePath' file) v of
729
729
Just (opts, old_di) -> do
730
730
deps_ok <- checkDependencyInfo old_di
731
731
if not deps_ok
@@ -739,26 +739,27 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
739
739
modifyVar_ filesMap (const (return HM. empty))
740
740
-- Keep the same name cache
741
741
modifyVar_ hscEnvs (return . Map. adjust (const [] ) hieYaml )
742
- consultCradle hieYaml cfp
742
+ consultCradle hieYaml file
743
743
else return (opts, Map. keys old_di)
744
- Nothing -> consultCradle hieYaml cfp
744
+ Nothing -> consultCradle hieYaml file
745
745
746
746
-- The main function which gets options for a file. We only want one of these running
747
747
-- at a time. Therefore the IORef contains the currently running cradle, if we try
748
748
-- to get some more options then we wait for the currently running action to finish
749
749
-- before attempting to do so.
750
750
let getOptions :: FilePath -> IO (IdeResult HscEnvEq , [FilePath ])
751
751
getOptions file = do
752
- let ncfp = toNormalizedFilePath' (toAbsolutePath file)
752
+ let ncfp = toNormalizedFilePath' file
753
753
cachedHieYamlLocation <- HM. lookup ncfp <$> readVar filesMap
754
754
hieYaml <- cradleLoc file
755
755
sessionOpts (join cachedHieYamlLocation <|> hieYaml, file) `Safe.catch` \ e ->
756
756
return (([renderPackageSetupException file e], Nothing ), maybe [] pure hieYaml)
757
757
758
758
returnWithVersion $ \ file -> do
759
- atomically $ writeTQueue pendingFilesTQueue $ toAbsolutePath file
759
+ let absFile = toAbsolutePath file
760
+ atomically $ writeTQueue pendingFilesTQueue absFile
760
761
-- see Note [Serializing runs in separate thread]
761
- awaitRunInThread que $ getOptions file
762
+ awaitRunInThread que $ getOptions absFile
762
763
763
764
-- | Run the specific cradle on a specific FilePath via hie-bios.
764
765
-- This then builds dependencies or whatever based on the cradle, gets the
0 commit comments