-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Issues around th warning (This HLS binary does not support Template Haskell
) and build hls with dynamic linking
#2659
Comments
I've reproduced the error in wsl ubuntu with
|
@pepeiborra please, could confirm if |
What is the source for this information? It doesn't match my understanding, which is:
But it does in my system! (Mac OS). Have you been able to validate this information yourself?
The condition is accurate (I think). So if the condition is firing, I think the risk of segfaults still exists.
This is what happens if you try to build both with |
Firstly an user in discord built hls with Then i got to reproduce locally in wsl ubuntu. Will double check, in ci if possible to get a shareable reproducer
Second hand, the same discord user in manjaro checked the first executable made the alert go away and the second one did not and another user in macos checked the alert continued being showed building with Will check myself locally in wsl ubuntu
It might be, the user is a beginner who probably dont know even how to enable profiling (but maybe it is activated and they were not aware). That was trying to build hls itself to get the wanted dynamically linked executable after checking it out the project. We dont have profiling enabled in the project but maybe it is enabled in the global cabal config 🤔 The entire discord talk is in https://discord.com/channels/280033776820813825/505370075402862594/937443543667056711 and posterior comments |
see also @hasufell comment about diff between |
Probably user error.
Building with |
The other way around. |
That was also my understanding, however we are suggesting that (ghc-options variant) in the actual troubleshooting guide, precisely due to
And for stack it seems simply there is no |
I missed that change to the If |
Why would it not work? I'm using that right now.
I linked two of them here #2659 (comment) |
I am confused: those tickets don't seem to mention |
Those are all the same issue with similar flags. |
I've built hls with
maybe it is due the mentioned bug? |
All right, I can confirm that I think it's time to bite the bullet and add the dynamic flag in the |
Hmm i've revised almost all issues about th and compiler crashes and we suggested |
|
Nice to see thing are slowly becoming clearer, quoting myself from the pr #2668: otoh at this point I am not sure if this is needed for sure to get a hls binary which works for TH are we 100% sure a binary dinamically linked in the target os only against system libs (the default link mode in Linux!) does not work? maybe simply build hls in the target os is the key, as we are compiling exactly with same ghc used in the projects the fact we did not get to reproduce the th issue in CI makes very difficult get a solution so I think it worths to investigate a little bit more the issue before enable this which could open a new whole kind of issues |
Hey. Thanks for replying to my messages on Twitter. Several people on my team and I have gone multiple rounds on this today. I'll try my best to summarize what we've found:
This is all from HEAD of this Git repo. So, yeay? My guess is that the fully static build that your release pipeline is making (on Alpine? Nix? whatever) and making available via GitHub (?) to VS Code is not working because glibc + static = boom, but that building locally brought me back to the Haskell default on Linux of dynamic executable but with the Haskell code statically linked into it. [it sure would be nice if we could actually get dynamic linking of the Haskell code working reliably on Linux, but that's a conversation for another day!] So I think my report is that the other work you have been doing recently to impove the Template Haskell situation has paid off, but that the problem with the release binaries remains (and isn't likely to go away any time soon). What line do I hack out to make the warning go away? AfC |
@istathar thanks for the feedback and sorry for the trouble caused |
This HLS binary does not support Template Haskell
) and build hls with dynamic linking
I've just checked it in debian 10 and i observed:
so to avoid errors like the posted above:
maybe we should consider use |
I just did
and it appears to have worked, both remotely on a build server and locally, tested in VS Code. To be honest, I don't know how much of a clean-room I have at this point but it seems to NOT be segfaulting ... but it still DOES have the annoying warning at Code startup. |
ok, thanks for trying, what about #2668?, to have a confirmation it works in your env with stack would be helpful it could be done with |
(sorry, I should clarify, two changes: 1. Happy to try that branch. Will do so in the morning. |
oh yeah, we have a little bit outdated the lts, the |
So I tried it.
ldd reports a fully dynamic executable (!), not just the system libraries.
which not only is not a segfault, but is also better than the "0 worked 5 failed" from before. No warning from VS Code on startup. Summary: your 'dynamic' branch works with both stack.yaml and stack-8.10.7.yaml. So does 'master' compiled with |
yeah that was expected
thanks! happy to see it is working out of curiosity, did you have actually segfaults due to the use of TH? |
nvm, the regular build (without any linking option) also builds the libs with and it does not make the executable be dynamically linked as checked in #2659 (comment) |
Yes. I was the one reopening #800 (comment) |
Works for me as well! 🥳 |
Another minor issue: the instructions link leads to |
my bad (changed the title to make it more discoverable), will correct it asap. To have hardcoded urls in the code is a real PITA |
Final question: how do you compile for multiple GHC versions? How do you make |
If you compile via ghcup, this is done for you: ghcup compile hls -v 1.6.1.0 -j10 --ghc 8.10.7 --cabal-project-local https://paste.tomsmeding.com/eKoT0X8q/raw/1
ghcup compile hls -v 1.6.1.0 -j10 --ghc 9.0.2 --cabal-project cabal-ghc90.project --cabal-project-local https://paste.tomsmeding.com/eKoT0X8q/raw/1
ghcup compile hls -v 1.6.1.0 -j10 --ghc 9.2.1 --cabal-project cabal-ghc921.project --cabal-project-local https://paste.tomsmeding.com/eKoT0X8q/raw/1 |
Is there a naming convention for the actual binaries that |
haskell-language-server-${ghcVersion} https://haskell-language-server.readthedocs.io/en/latest/installation.html We have to update install from source instructions |
Ok, that's neat. fyi the VSCode plugin seems to place binaries with this naming pattern: haskell-language-server-1.5.1-linux-8.10.7 |
I ran |
Try
|
That worked! Thanks a lot, @hasufell |
in case it's helpful, I tried The only thing that worked was |
After adding the warning about TH a bunch of issues have come up:
ghcup compile hls
: i tried to fix that with Post 1.6.0.0 fixes and prepare 1.6.1.0 bug fix release #2647--enable-executable-dynamic
(which links dynamically only the system libs) instead of--ghc-options="-dynamic"
(which additionally links dynamically all haskell deps) the warning does not go away. However i thought the first option was sufficient to workaround th problems (maybe i am wrong but i infer that from comments like this)stack install haskell-language-server --ghc-options="dynamic"
seems to not work out of the box. It seems you have to build it both statically and dynamically (i am trying to reproduce)cabal install pkg:haskell-language-server --ghc-options="-dynamic"
:The text was updated successfully, but these errors were encountered: