Skip to content

haskell-language-server missing wrapping scripts checking ABI compatibility #175565

@cdepillabout

Description

@cdepillabout

At some point haskell-language-server (HLS) gained a wrapper bash script that helpfully checks GHC ABI compatibility between HLS itself, and the compiler you are trying to use it with:

https://github.com/haskell/haskell-language-server/blob/6742c205c8386a2898d3a8baa830ecc75713845d/bindist/wrapper.in#L77

I believe this was introduced in HLS-1.7.0.0 (but I didn't dig through the history to confirm).

When installing HLS through ghcup, HLS is installed with this wrapper script. The following is on Ubuntu with ghcup:

$ which haskell-language-server-8.10.7
~/.ghcup/bin/haskell-language-server-8.10.7
$ file ~/.ghcup/bin/haskell-language-server-8.10.7
~/.ghcup/bin/haskell-language-server-8.10.7: symbolic link to haskell-language-server-8.10.7~1.7.0.0
$ file ~/.ghcup/bin/haskell-language-server-8.10.7~1.7.0.0
~/.ghcup/bin/haskell-language-server-8.10.7~1.7.0.0: symbolic link to ../hls/1.7.0.0/bin/haskell-language-server-8.10.7
$ file ~/.ghcup/hls/1.7.0.0/bin/haskell-language-server-8.10.7 
~/.ghcup/hls/1.7.0.0/bin/haskell-language-server-8.10.7: POSIX shell script, ASCII text executable, with very long lines (1639)
$ head ~/.ghcup/hls/1.7.0.0/bin/haskell-language-server-8.10.7
#!/bin/sh

exedir="/home/illabout/.ghcup/hls/1.7.0.0/lib/haskell-language-server-1.7.0.0/bin/"
executablename="haskell-language-server-8.10.7"
GHC_VERSION="8.10.7"
ABI_HASHES="Cabal-3.2.1.0:9aa4b9691119bc22fff33e788e96f702 array-0.5.4.0:84daffa90f3ca103cdf9f63b2e3dc42b ...

I think it would be nice to include this script in HLS from Nixpkgs, since it is so easy to accidentally pull in an HLS that has been compiled with a GHC that produces different abi hashes than you are trying to use in your own project.

cc @maralorn and @sternenseemann (since I think you guys have done a lot of the HLS work)


There are also a lot of issues upstream that discuss the problems with HLS/GHC ABI-compatibility, although none are really directly related to this feature request:

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: enhancementAdd something new or improve an existing system.6.topic: haskellGeneral-purpose, statically typed, purely functional programming language
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions