From bbcf25323427cae2cf74f38d5e1d8eb7f024c40b Mon Sep 17 00:00:00 2001 From: Patrick Date: Sun, 7 Jul 2024 17:47:40 +0800 Subject: [PATCH 1/2] remove componentInternalUnits --- ghcide/session-loader/Development/IDE/Session.hs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ghcide/session-loader/Development/IDE/Session.hs b/ghcide/session-loader/Development/IDE/Session.hs index 31b1f5965b..9c2a1bb9b8 100644 --- a/ghcide/session-loader/Development/IDE/Session.hs +++ b/ghcide/session-loader/Development/IDE/Session.hs @@ -525,11 +525,10 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do all_deps' <- forM all_deps $ \RawComponentInfo{..} -> do -- Remove all inplace dependencies from package flags for -- components in this HscEnv - let (df2, uids) = (rawComponentDynFlags, []) + let df2 = rawComponentDynFlags let prefix = show rawComponentUnitId -- See Note [Avoiding bad interface files] - let hscComponents = sort $ map show uids - cacheDirOpts = hscComponents ++ componentOptions opts + let cacheDirOpts = componentOptions opts cacheDirs <- liftIO $ getCacheDirs prefix cacheDirOpts processed_df <- setCacheDirs recorder cacheDirs df2 -- The final component information, mostly the same but the DynFlags don't @@ -538,7 +537,6 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do pure $ ComponentInfo { componentUnitId = rawComponentUnitId , componentDynFlags = processed_df - , componentInternalUnits = uids , componentTargets = rawComponentTargets , componentFP = rawComponentFP , componentCOptions = rawComponentCOptions @@ -1017,10 +1015,6 @@ data ComponentInfo = ComponentInfo -- | Processed DynFlags. Does not contain inplace packages such as local -- libraries. Can be used to actually load this Component. , componentDynFlags :: DynFlags - -- | Internal units, such as local libraries, that this component - -- is loaded with. These have been extracted from the original - -- ComponentOptions. - , componentInternalUnits :: [UnitId] -- | All targets of this components. , componentTargets :: [GHC.Target] -- | Filepath which caused the creation of this component From 2febf420f35d6597c6dc42bfd1354017d48e028b Mon Sep 17 00:00:00 2001 From: Patrick Date: Sun, 7 Jul 2024 17:51:29 +0800 Subject: [PATCH 2/2] cleanup --- ghcide/session-loader/Development/IDE/Session.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ghcide/session-loader/Development/IDE/Session.hs b/ghcide/session-loader/Development/IDE/Session.hs index 9c2a1bb9b8..a1d778ab0e 100644 --- a/ghcide/session-loader/Development/IDE/Session.hs +++ b/ghcide/session-loader/Development/IDE/Session.hs @@ -523,14 +523,11 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do _inplace = map rawComponentUnitId $ NE.toList all_deps all_deps' <- forM all_deps $ \RawComponentInfo{..} -> do - -- Remove all inplace dependencies from package flags for - -- components in this HscEnv - let df2 = rawComponentDynFlags let prefix = show rawComponentUnitId -- See Note [Avoiding bad interface files] let cacheDirOpts = componentOptions opts cacheDirs <- liftIO $ getCacheDirs prefix cacheDirOpts - processed_df <- setCacheDirs recorder cacheDirs df2 + processed_df <- setCacheDirs recorder cacheDirs rawComponentDynFlags -- The final component information, mostly the same but the DynFlags don't -- contain any packages which are also loaded -- into the same component.