Regarding a working version of
haskell-language-server I received some help by Malte, who agreed that I share our conversation here.
Jan 14th, 2021 Ruben wrote:
I am trying to get haskell-language-server to work with reflex-platform.
For both projects the support for nixos is there, but sometimes combining stuff still is difficult.
My current problem is this:
The nixos binaries for haskell-language-server are compiled with GHC-8.10.
reflex-platform supports up to GHC-8.8.
Now I have a particular question. In the nixos package search, I find haskell-language-server version 0.8.0.0 on the unstable channel with this:
This package provides haskell-language-server, haskell-language-server-wrapper, haskell-language-server-8.6.5, haskell-language-server-8.6, haskell-language-server-8.8.4, haskell-language-server-8.8, haskell-language-server-8.10.2, haskell-language-server-8.10. You can override the list supportedGhcVersions.
However, checking out the actual .nix files in
nixpkgs/pkgs/development/tools/haskell/haskell-language-server/ there is no such thing as “supportedGhcVersion”. And: The version of haskell-language-server seems to be fixed to GHC-8.10.
Any clue what the origin of this inconsistency might be? Is there, somewhere, a nix-package ready to use, with haskell-language-server compiled by GHC-8.6.5?
If you point me to some repo, I will gladly post this as a public issue.
Jan 14th, 2021 Ruben wrote:
I just realized, there is a difference between
The latter one might be the solution to my problems.
Still interesting how this all comes about.
Jan 14th, 2021 Malte Brandy wrote:
I have my project setup in a way, that the majority of my code compiles
against reflex out of current nixpkgs master.
And I only compile the server and for android using reflex-platform with
a very thin layer of code that does not work without it.
The part that compiles to native+webkit via ghc+jsaddle works on ghc
8.10 and I really like that.
If you are curious you can see my project which uses this approach here:
All those words were just to say: I don‘t have a running setup for what
you which for because I didn‘t want the trouble.
That being said: Using hls from one nixpkgs version so far apart from
the one your ghc is from. i.e hls from unstable + ghc from
reflex-platform won‘t work for various reasons. a) Incompatible glibc
versions b) at least the ghc used by obelisk is even a patched ghc so
it’s not the same as ghc-8.6.5 from unstable.
So I think the only chance you have to get this to run would be to
compile hls with the nixpkgs pinned by reflex-platform. I would not say
this is impossible. I have done this with ghcide about a year ago and it
was challenging. But hls is quite a beast with a lot of quite new
dependencies so manually updating/introducing all of those dependencies
into the old nixpkgs will take days and probably end in hundreds of
lines of overrides.
Right now the haskellPackages infrastructure is very unflexible in
generating all dependencies from a Cabal build plan. haskell.nix is
better in that, but reflex-platform does not use haskell.nix so I don‘t
think this helps you very much either.
So I am not saying what you want is impossible I can just say from my
experience that I don‘t know a realiable or practical way to achieve it.
Other than that it seems you have figured out the structure. Our manual
has a section on it:
I which I had better news.
Btw. good places to have these discussions more openly is
https://discourse.nixos.org or just the GitHub - NixOS/nixpkgs: Nix Packages collection
issue tracker. Feel free to ping me on either if you have issues either
with reflex or with hls. I am deep down those rabbit-holes.