3

I am using VS Code 1.68.1 on Windows 10 and have installed the Haskell language support plugin. I tried to install ghcup but the installation script just fails with no error message and the IRC channel #ghcup wasn't able to help so I've given up on ghcup and decided to handle this manually. I just installed HLS 1.7.0 and pointed VS Code at it. The problem is I get an error message from VS Code:

ghcide compiled against GHC 9.2.2 but currently using 8.6.5 
This is unsupported, ghcide must be compiled with the same GHC version as the project.

Upon further investigation, this seems to be complaining that the ghcide library that's a part of HLS was built using ghc 9.2.2 but my current codebase was built (by Stack) using ghc 8.6.5. At least that's my reading of it, since the HLS page itself says that 1.7.0 is compatible with 8.6.5! So my first question is how on earth am I supposed to know what version of ghc was used to build HLS, and honestly why should I care?? And my second question is, how do I find the version of HLS that's compatible with my current ghc?

(Another option is to migrate Stack from 8.6.5 to 9.2.2 but I'm not sure exactly how to do this. It appears to be just a case of changing the resolver entry in stack.yaml which is currently resolver: lts-14.21. But what do I change it to? It looks like the most recent version of LTS is 19.14 https://www.stackage.org/lts-19.14. But I'm a bit nervous about making that change since the page says ghc 9.0.2 not 9.2.2. The entire Haskell ecosystem just seems really finicky and I'm new enough to Stack that don't want to end up with a messed up Stack config and possibly in Haskell package mismatch hell.

Can anyone offer any good solutions?

Motorhead
  • 928
  • 6
  • 16
  • 1
    What's the problem you have with `ghcup`?. It is orders of magnitude easier with it, so is worth to try to solve that problem rather than a manual instalation of HLS. some questions: how did you installed HLS?. There are a few problems I see with your set up. First `lts-14.21` is two years old, that is before HLS existed. Secondly, HLS _must_ be compiled with the same version of ghc you are using. That's why `ghcup` is the best alternative. – lsmor Jul 05 '22 at 08:44
  • Also, what's your platform? and btw: https://haskell-language-server.readthedocs.io/en/latest/supported-versions.html – lsmor Jul 05 '22 at 08:46
  • @Ismor: I did briefly explain the problem with ghcup - literally the powershell executes the 3 commands, and immediately closes the window with no error message whatsoever. The 3 commands are the ones I copied fom here https://www.haskell.org/ghcup/install/#vscode-integration. Not very helpful right? I also did say the platform is Windows 10 – Motorhead Jul 05 '22 at 20:12
  • @Ismor: regarding the link you posted, if you look on there it says that the current version of HLS (what I have) supports 8.6.5, which seems very misleading since it obviously doesn't like it (as I also noted in my original post) – Motorhead Jul 05 '22 at 20:20
  • I guess you installed `ghc` using `stack` isn't it? If that the case, notice you _must_ compile from source `hls` did you do it that way? If not, how did you install `hls`?. Then you point me to `ghcup` vs-code integration, which is weird since you didn't install `ghcup` at all. My advice, update `stack` lts to something modern. Current recommended is `lts-18.28`. Open vscode with now project at all (to avoid language extension to launch), then configure the haskell extension and avoid any reference to `ghcup` usage. – lsmor Jul 06 '22 at 07:17
  • @Ismor: yes that is what I discovered elsewhere too. Its a bit unfortunate they don't tell you what the binaries were built with, otherwise I wouldn't have downloaded it. I pointed you at that page because you were previously asking what the problem was with using ghcup, and that page has the commands for installing ghcup and I wanted to let you know which command was problematic. Anyway it turns out that my company proxies were responsible, as they were blocking remote script execution/downloads – Motorhead Jul 06 '22 at 18:12
  • wow, glad your find the problem!! – lsmor Jul 07 '22 at 06:08

0 Answers0