-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
Improve template haskell support (upstream fix and workaround for compiler crashes) #1431
Comments
I don't use TH so I cannot really help much. My understanding is that the main issue is a bug in the GHC static linker for Mac OS, which causes segfaults. The best way to address this would be to enable using the system linker even when the ghc package is statically linked, lifting the restriction described here. But this is a GHC change and it would need some speccing out and a qualified mentor. |
So maybe @wz1000?, what do you think about this possible line of work? |
I am gonna remove the label for now, as this dont have an actionable outcome |
All issues seems to be related with the ghc dynamic linker so i would label this as blocked upstream on https://gitlab.haskell.org/ghc/ghc/-/issues/19021 (opened in #469) and with the generic workaround of compile hls from source with this config in cabal.project or cabal.project.local
|
It seems a way to fix template haskell handling in ghc itself has been opened: see #2000 (comment) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
For completeness, there is an issue in the ghcup about just that workaround: https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/245 |
About make hls prebuilt executables dinamically linked: It is true that hls built dynamically linked provides a good workaround for a bad hls/ghc interaction, but it is a workaround after all. The proper fix should be done in ghc, to make possible evaluate th code in a reliable way independently on how the executable requesting that evaluation (hls in our case) is linked. The relevant upstream issues where imho the definitive fix should be done are: So i am a little bit reluctant to change our ci to make it produce dynamically linked binaries, having those ci changes and the executables built that way its own problems and issues and being the goal provide a temporary workaround. Related with documentation we have added recently an entry in the troubleshooting section: https://haskell-language-server.readthedocs.io/en/latest/troubleshooting.html#problems-with-template-haskell and https://haskell-language-server.readthedocs.io/en/latest/troubleshooting.html#problems-with-dynamic-linking Feel free to suggest more docs changes to make easier indentify the problem and find the workaround. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
They are not. The first applies |
This comment has been minimized.
This comment has been minimized.
I tried the workaround #1431 (comment) in my nix environment setting this line: to However, in my nix-shell, I got this error:
So the error is Reason it's in
Anybody happen to know what's up here? Very ugly workaround: Given that all these This, together with #365 (comment), apparently makes HLS work completely for my larger project that uses a lot of |
I am gonna close all th issues about compiler crashes but this and #2000 as all of them seems to have the same root cause |
Description of the problem (from #469 (comment)):
Hot to check if you hls binary is using the ghc dynamic linker (from #1982 (comment)):
@pepeiborra @wz1000 could we sketch what could be the needed changes (mainly in ghcide i suppose) to improve it? is it even a good idea?
The text was updated successfully, but these errors were encountered: