Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHC 9.4 compatibility + Multiple Home Units #2994

Merged
merged 8 commits into from
Sep 1, 2022
Merged

GHC 9.4 compatibility + Multiple Home Units #2994

merged 8 commits into from
Sep 1, 2022

Conversation

wz1000
Copy link
Collaborator

@wz1000 wz1000 commented Jun 28, 2022

TODO

  • CI for 9.4.1
  • Fixing testsuite
  • ExactPrint stuff (everything that needs it is disabled for now)
  • Plugins

@pepeiborra
Copy link
Collaborator

pepeiborra commented Jun 29, 2022

Perhaps we should move all the code actions that depend on ghc-exactprint out of ghcide. Or simply move all the code actions out of ghcide, period.

@guibou
Copy link
Collaborator

guibou commented Aug 16, 2022

I've added one commit which adds the required files for GHC 9.4 for nix.

Copy link
Collaborator

@isovector isovector left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for wingman

Copy link
Collaborator

@konn konn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I haven't tested in my environment, it seems ok as for the Splice Plugin.

Just curious: is this change to make the splice plugin dependent on hls-refactor-plugin also fixes the Splice Plugin also on GHC 9.2, or do we need an extra effort?

@wz1000 wz1000 force-pushed the wip/9.4 branch 2 times, most recently from f425458 to 4232bd3 Compare August 31, 2022 11:30
@wz1000 wz1000 force-pushed the wip/9.4 branch 2 times, most recently from 3308000 to 6a6ffa1 Compare August 31, 2022 11:34
@wz1000 wz1000 force-pushed the wip/9.4 branch 5 times, most recently from a888817 to 88fd42f Compare August 31, 2022 13:14
wz1000 and others added 3 commits August 31, 2022 20:45
I've just added naively the different nix lines. The configuration file
comes from a copy of the one for 9.2.

With that, we can open a shell with `nix develop
.\#haskell-language-server-941-dev` and type `cabal build`.

(cherry picked from commit 48084ab)
@wz1000
Copy link
Collaborator Author

wz1000 commented Aug 31, 2022

@guibou could you help with the nix failure?

Copy link
Collaborator

@pepeiborra pepeiborra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments only, as the slice of HLS that I understand shrinks with every GHC update.

This is a massive amount of work, thank you @wz1000 !!!

ghcide/src/Development/IDE/Core/Compile.hs Outdated Show resolved Hide resolved
ghcide/src/Development/IDE/Core/Rules.hs Outdated Show resolved Hide resolved
then uses_ GetModSummary fs
else uses_ GetModSummaryWithoutTimestamps fs
return (map (NodeKey_Module . msKey) dep_mss)
ms <- msrModSummary <$> use_ GetModSummary file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can use GetModSummaryWithoutTimestamps when fullModSummary is false here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, its for the new ModuleGraph which includes all ModSummarys paired with their direct dependencies (Earlier GHC versions only had the ModSummarys). It shouldn't be used for much other than mgTransDeps gives us a reasonably fast and cached way of querying for transitive dependencies (which is used in hscCompileCoreExprHook to get all the Linkables needed for a splice). I don't think omitting timestamps will matter here, especially since we omitted timestamps in the ModSummarys we put into the ModuleGraph on older GHCs.

session' <- liftIO $ mergeEnvs hsc mss inLoadOrder depSessions
let inLoadOrder = map (\HiFileResult{..} -> HomeModInfo hirModIface hirModDetails Nothing) ifaces
#if MIN_VERSION_ghc(9,3,0)
mss_imports <- uses_ GetLocatedImports (file : deps)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment explaining why collecting the mod summaries of the direct dependencies here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You were right, there was something fishy here. We were including the ModSummary for the current module in GHC 9.4 but not before. I've changed this to always include the current ModSummary, which allows us to not query imports of direct dependencies. We still need to get the ModSummarys of direct dependencies in order to know their Modules, which we need to reference in the ModuleGraph.

I've written a short note documenting all the assumptions we now make.

@wz1000 wz1000 force-pushed the wip/9.4 branch 5 times, most recently from 1269371 to bb49204 Compare August 31, 2022 20:14
@guibou
Copy link
Collaborator

guibou commented Aug 31, 2022

@guibou could you help with the nix failure?

Yes, for sure, I'll have a look at it tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants