Skip to content

Fix ghc source plugins for GHC 9.2 #3311

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

Closed
wants to merge 2 commits into from

Conversation

fendor
Copy link
Collaborator

@fendor fendor commented Oct 31, 2022

This is supposed to fix ghc source plugins for GHC 9.4 as well, but I couldn't prove that locally.

After GHC 9.0, plugins no longer live in DynFlags, but in HscEnv. Thus, we need to make sure to pass the modified HscEnv to the subsequent typechecking phase.

Supposed to fix #2989, let's see whether it works out.

This is likely to have been introduced by #2128 (my bad!)

EDIT: I am going to write a regression test for this Just needed to enable the test.

This is supposed to fix ghc source plugins for GHC 9.4 as well,
but I couldn't prove that locally.

After GHC 9.0, plugins no longer live in DynFlags, but in HscEnv. Thus,
we need to make sure to pass the modified HscEnv to the subsequent
typechecking and renaming phase.
@fendor fendor requested a review from pepeiborra as a code owner October 31, 2022 19:11
@fendor fendor requested review from michaelpj and wz1000 October 31, 2022 19:12
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.

Good catch, thanks!

@@ -172,18 +172,18 @@ typecheckModule :: IdeDefer
typecheckModule (IdeDefer defer) hsc tc_helpers pm = do
let modSummary = pm_mod_summary pm
dflags = ms_hspp_opts modSummary
mmodSummary' <- catchSrcErrors (hsc_dflags hsc) "typecheck (initialize plugins)"
(mmodSummary') <- catchSrcErrors (hsc_dflags hsc) "typecheck (initialize plugins)"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
(mmodSummary') <- catchSrcErrors (hsc_dflags hsc) "typecheck (initialize plugins)"
mmodSummary' <- catchSrcErrors (hsc_dflags hsc) "typecheck (initialize plugins)"

@pepeiborra
Copy link
Collaborator

It seems that this PR and #3309 concurrently fix the same bug, but #3309 does a bit more fixing.

@fendor
Copy link
Collaborator Author

fendor commented Nov 1, 2022

Indeed, I did not see it! Closing this in favour of #3309

@fendor fendor closed this Nov 1, 2022
@m4dc4p
Copy link

m4dc4p commented Nov 15, 2022

I'm dying to have this fix and that other PR is stalled. Any chance you can merge this one?

@MorrowM
Copy link
Contributor

MorrowM commented Nov 19, 2022

@m4dc4p In the meantime you can ghcup compile hls --ghc 9.2.5 -g e8f4cfee4faa3896a633560a7e056fe07a41c546

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.

HLS reports non-existent errors when using Calamity and Polysemy with Polysemy.Plugin (polysemy-plugin)
4 participants