-
-
Notifications
You must be signed in to change notification settings - Fork 378
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
Support TemplateHaskell #1121
Comments
I have also seen some issue around async exceptions and TH which seemed to make GHC very unhappy (I don’t recall the precise error message). |
I've noticed a huge slowdown when TH is enabled. After some searching I've noticed the folks at hie-engine ran into what looks like the same issue (HIE github issue), which was fixed in Infinisil/all-hies |
Hi, anyone is in a position to estimate how much work this would entail? Since my team started using ghcide we can’t imagine going back to the stone age ever. You guys did an amazing job! On our end TH support seems to be the last big issue that’s in the way of full adoption. |
My guess is you need to:
So probably not obviously hard, but I'd almost be surprised if something didn't get in your way. |
@DavidEichmann in case you were using ghcide-nix, that has been fixed now. |
I would like to tackle this issue, since out team uses TH in quite some places. |
None that I'm aware of @serras - but best of luck! |
This seems to be related https://gitlab.haskell.org/ghc/ghc/issues/8025, at least it ends up with the same error as haskell/ghcide#212 |
I have started working on the issue at serras/ghcide@90c784b in a quite crude way, asking to compile all dependencies even if the file does not use Template Haskell.
Is there any way I can check which rules are firing? At least I can be sure that the bytecode for |
You can use shake profiling to figure out the rules, see https://github.com/digital-asset/ghcide/blob/master/src/Development/IDE/Types/Options.hs#L44 (I think this is not exposed via the CLI so you’ll have to set it in the code somewhere) but that’s more useful for benchmarking than for debugging imho. I would probably just use some printf statements in the rules. |
I was testing out this PR and run into similar errors about a missing _closure despite said close being in the relevant library being loaded when I inspect it via |
I'm seeing the following using these changes: |
Yeah, I'm seeing similar errors, and I have some suspicions but I'm not really sure enough how to debug ghcide to investigate further. Essentially, I seem to have both a static library (missing some symbols) and a dynamic library (not missing said symbols) in my |
I'm trying to trick it into loading the dynamic library to see if that works, but that's not working :\ |
We don’t do anything explicit atm wtr to linking external libraries in our code. I was hoping that this just magically works™ if we setup the GHC API with the right flags but it looks like we need to figure out the right incantation. |
I've been trying to find the right incantation with explicit |
Ghcide uses hie-bios to set up its session, which essentially dumps command line flags into a GHC session. If flags work in ghci, my experience is it usually works in ghcide too. |
@ndmitchell I wish :) ghci seems perfectly happy to work with just |
@merijn you can have a look at |
@merijn yeah, |
I was under the impression that ghcide used them to find dependencies? Because that seems to work fine in most of my simple-ish projects. I do have a hie.yaml to resolve the look source paths, but I'm always a bit mystified what else has to go in there. |
@merijn nope, |
Ah, so maybe that's where things go wrong, because in other projects I haven't had to use a hie.yaml to set things up! I'll start fiddling with |
As far as I know, we do pick up |
API's being influenced by random environment files scares me. The more I see about these environment files, the less I like them! |
Trying to synthesise one ticket that describes all the TH work. My understanding of the current state is:
The solution is likely to make sure we have compiled the dependencies to bytecode and send them at the linker before type checking a module that uses TH or ANN.
However, we don't have tests for the current state, and it works by luck rather than deliberately.
The text was updated successfully, but these errors were encountered: