Open jasagredo opened 5 days ago
My understanding is that compiling HLS should create a haskell-language-server-
.exe even if the custom ghc has a tag at the end, otherwise HLS-wrapper won't be able to find it.
I don't see how that can work. You'd potentially overwrite another version.
The problem generally is that there is a discrepancy between ghc version in GHCup and ghc --numeric-version
. HLS uses the latter, afaiu. I don't know how to solve this.
@fendor maybe has an idea
We encountered a similar issue with the same root cause in https://github.com/haskell/vscode-haskell/issues/1151.
Afaik, there is no way to trick HLS-wrapper to do what you want in this case, unfortunately. The simplest workaround is to instruct your editor to simply launch the correct HLS binary.
However, this general workflow is quite interesting for testing changes, perhaps we can teach the wrapper to be aware of potential additional suffixes?
For example, hls-wrapper-<custom>
could always look for hls-<ghc-version>-<custom>
? However, when a user would still need to point the editor to the custom wrapper binary.
Alternatively, we could try to patch the shim to additionally look for hls-<ghc-version>-<custom>
binaries. Assuming, we can get the <custom>
part somehow out of the GHC binary.
Perhaps this also happens on Linux?
I'm not sure anymore if this issue belongs to GHCup or to HLS, but perhaps it is worth some note in GHCup when installing a custom HLS?
Perhaps this also happens on Linux?
I believe so, yeah.
It is a joint issue, I believe, the solution needs to be implemented in HLS, but for the best UX we need to coordinate.
What do you think about the proposed solution? Do you think having a custom hls-wrapper-<custom>
binary which you have to manually tell your editor to use is feasible?
I think that should be fine. Most editors allow you to specify the binary to be used.
Thinking about it, if you can specify the binary, you could also simply specify the binary you built with the custom ghc as well, right? Simply avoid the hls-wrapper
altogether?
What do you think about the proposed solution? Do you think having a custom hls-wrapper-
binary which you have to manually tell your editor to use is feasible?
Non-numeric versions are a hack (or leniency) of GHCup.
I do not think HLS should do anything here. I'm also not sure this edge case is interesting enough to dream up a solution.
I do think we could send a post-install warning message in GHCup if we detect such an oddly named hls-wrapper binary.
After compiling HLS for my 9.6.6-patched GHC (see #1149), the process terminates succesfully:
There is no
haskell-language-server-9.6.6.exe
binary, but there is ahaskell-language-server-wrapper.exe
which fails because the former is missing:My understanding is that compiling HLS should create a
haskell-language-server-<ghcver>.exe
even if the custom ghc has a tag at the end, otherwise HLS-wrapper won't be able to find it.Manually creating the shim works: