Closed
Description
Description of the problem (from #469 (comment)):
GHC has its own dynamic linker, in the rts, and it gets used in certain cases:
- when GHC the binary is linked statically, by GHCI and TH
- when ghc the library is linked statically, by TH and the ghc interactive api
Implementing a dynamic linker with support for >=3 platforms is a risky and complex exercise. Fortunately there is an easy opt-out (-dynamic) but unfortunately that opt-out makes distribution much harder, and the precompiled HLS binaries are statically linked.
Hot to check if you hls binary is using the ghc dynamic linker (from #1982 (comment)):
/path/to/haskell-language-server +RTS --info | grep "RTS way" | grep dyn && echo "Dynamic" || echo "Static
- We have plenty of serious bugs involving the use of template haskell: https://github.com/haskell/haskell-language-server/issues?q=is%3Aissue+is%3Aopen++label%3A%22type%3A+template+haskell+related%22+
- Surely there would be some more that are not diagnosed
- Surely we cant tacke all of them in a unified way
- But i hope there would be something we can do to improve the handling in a global way
- Maybe we could take advantage of gsoc 2021 to make progress on it although it could not be the more attractive work
@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?