-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
HLS is broken with some TH code: "Error dynamically loading libm.so.6" #1601
Comments
@sonowz wow, this is a almost perfect bug report, many thanks 😄 Not sure what could be a definitive solution, pinging @pepeiborra just in case. |
The best solution is probably to build HLS with Nix, and not reuse the pre-built binaries |
I came up with something like this: res <- loadDLL hscEnv "libm.so.6"
case res of
Nothing -> pure ()
Just err -> downloadLibM >> loadDLL hscEnv "libm.so.6" Is this possible? I have no expertise in these OS-level thingy.. |
I am gonna close this issue as all compiler crashes seems to have the same root cause:
If any of you think the issue should not be included generically feel free to reopen it (with a brief explanation if possible) |
Your environment
The error
The cause
haskell-language-server/ghcide/session-loader/Development/IDE/Session.hs
Lines 345 to 349 in b9c6e6c
Related PR: haskell/ghcide#723
The cause is straightforward: by default NixOS does not have
libm.so.6
norglibc
in its system environment. Thus HLS literally can't loadlibm.so.6
.The workaround
Setting
LD_LIBRARY_PATH
to the path whichlibm.so.6
lives works and the error is gone. XDLong description
For NixOS, it seems like the error is raised every time I use HLS.
Generally, HLS works as normal, and the error doesn't affect anything. Just error message above (
Error dynamically loading libm.so.6
).However, if the source code uses some TemplateHaskell, almost every HLS feature is broken and produces error below. No code highlighting, no type hints.
I think HLS is broken only when system calls in
libm.so.6
really gets called.The text was updated successfully, but these errors were encountered: