I came back to a project I haven’t worked on for a year, using VS Code and stack. The goal is to get HLS to run. I was using the ghc-9.6.3 resolver. At some point, I did a “stack clean.” After that I couldn’t build my project. Stack said that lens depended on other libraries and that no version of those libraries was in the build plan. I switched to the lts-23.18 resolver and the project built fine, but now HLS says that it doesn’t support ghc 9.8.4.
ghcup reports that ghc-9.8.1 is HLS-powered.
Putting ghc-9.8.1 as the resolver caused a return of the failure to build.
I don’t understand what’s significant about the “lts” in the resolver name that helps the project build, but at this point I wanted to search for an “lts” that was associated with ghc 9.8.1 but I don’t know where to look up that information. A google search returned many examples using 9.8.4 but not 9.8.1
hmm, the highest version of HLS shown by ghcup is 2.9.0.1. How do I get 2.10.0.0? Also, I think the vs code extension automagically downloads the appropriate version of HLS and gives an error ‘HLS does not work with GHC 9.8.4’.
In that case I’d recommend switching back to lts-22.43 which uses GHC 9.6.6 which is supported by HLS 2.9.0.1.
I don’t know if there is a place to easily find the latest stackage lts for each GHC version, but I just did quick search, by first checking 23.1 which still uses GHC 9.8.4 and then I went back to 22 and saw that the latest was 22.43 which uses GHC 9.6.6. You can see what the latest version of each major lts snapshot is by just omitting the minor version in the url, e.g.: https://www.stackage.org/lts-22
I don’t know exactly what the ghc-... snapshots do, I don’t think you’re normally supposed to use them.
I didn’t see it mentioned yet: ghc-... is a very minimal snapshot containing only the ghc boot libs. You would have to specify any other deps as extra-deps. Standard practice is to use the appropriate lts-... or nightly-... snapshot containing that ghc version instead, those are more complete.
Thanks, everyone. Can someone explain, given a GHC version x.y.z, how to look up the LTS that contains that version? For now looks like the previously mentioned LTS 22.43 should work, but I’m just curious for the future if necessary.
If you want to find a Stackage snapshot for GHC 9.8.1, it is going to have to be a Nightly one, because GHC 9.8.x was not ‘mature’ enough for LTS status until GHC 9.8.4 and LTS 23.0. That is indicated by the list of historical LTS snapshots on Stackage’s home page.
There may be a quicker way, but I started with the ‘Snapshots’ menu item on the Stackage home page, and then clicked through the pages until I came to:
which currently shows me that the most recent GHC 9.8.1 snapshot was nightly-2024-03-07.
An alternative approach might be to try using LTS 23.18 (for GHC 9.8.4) but specifying that the specified compiler be downgraded to GHC 9.8.1 - a stack.yaml file that starts off looking like this:
A ghc-* snapshot is a ‘compiler only’ one. If you specify it, you are specifying a particular version of GHC and the boot packages that come with that version of GHC. EDIT: The different types of snapshot location are documented here.
One way to understand the boot packages that come with a certain version of GHC is to look in Stack’s ‘global hints’ YAML file, available online at: