Commit 02e5f82
feat: add haskell-language-server 2.14.0.0 (#214)
* feat: add haskell-language-server 2.14.0.0
Add package for the Haskell Language Server (HLS), the official LSP
implementation for Haskell. Builds from source using GHC + Cabal with
dynamic linking, copying the binary and all required shared libraries
via ldd dependency resolution.
- Source: GitHub tag 2.14.0.0 with automatic extraction
- Build deps: base, cabal, ghc
- Runtime deps: glibc
- Network access enabled for cabal dependency index updates
- Includes standalone version check test
* fix: restrict dynamic library bundling to Haskell-specific libs
* fix(haskell-language-server): add missing build deps and disable test/benchmark builds
The HLS cabal.project ships with tests:True and benchmarks:True, which makes
cabal resolve and compile test/benchmark deps for every transitive dependency
— a major cost and failure surface for a 16+ minute build. Pass
--disable-tests --disable-benchmarks to build only the executable.
Also add alex, happy, and zlib as explicit build_deps. alex and happy are in
ghc's build_deps (not runtime_deps), so they aren't injected into downstream
builds — cabal would otherwise have to download and compile them from Hackage.
zlib provides the C library needed by HLS's Haskell dependencies.
* fix(haskell-language-server): set CABAL_DIR and capture build errors
Without CABAL_DIR, cabal has no writable home for its config, package index,
and build store in the sandboxed build environment — the most likely root
cause of the 17-minute build failures. Every other Haskell package in the
repo (tamarin-prover, stack) sets this; HLS was the only one that didn't.
Also add --with-compiler for explicitness, -v1 for verbose output, and an
error-capture block (matching tamarin-prover's pattern) that extracts the
real compile/link error on failure instead of a bare "build failed" exit.
* fix(haskell-language-server): use cabal-level parallelism to avoid OOM
Replace --ghc-options="-j$(nproc)" (per-module GHC parallelism) with
--jobs="$(nproc)" (per-package cabal parallelism). HLS is a massive
project — running nproc GHC instances each with nproc internal module
threads exhausts memory on the build host. Cabal-level parallelism
compiles packages concurrently while keeping module compilation
sequential within each package, matching the tamarin-prover build.
* fix(haskell-language-server): add gmp, libffi, zlib to runtime_deps
The HLS binary links against libgmp, libffi, and libz (GHC runtime
dependencies), but runtime_deps only declared glibc — causing the
missing-runtime-deps and standalone-test post-build checks to fail.
Move zlib from build_deps to runtime_deps (runtime_deps are injected
into the build env, so it covers both roles), and add gmp + libffi
matching GHC's own runtime_deps.
* fix(haskell-language-server): fix alex/happy version detection for cabal
Cabal installs alex/happy from Hackage as build-tool-depends, but the
installed binaries link against GHC's shared libraries (libHSrts etc.)
which aren't on the default library search path — so they fail to run
and cabal reports "version could not be determined" (Cabal-1008).
Two fixes:
- Add GHC's libdir to LD_LIBRARY_PATH so cabal-installed build tools
can actually execute
- Pass --with-alex/--with-happy pointing at the pre-installed system
versions so cabal uses those for version checks instead of its own
broken copies
* fix(haskell-language-server): let cabal install its own alex/happy
The system alex/happy were built with ghc-bootstrap 9.8.1, so their
template files live in /usr/share/x86_64-linux-ghc-9.8.1/... — wrong
GHC version. Passing --with-alex/--with-happy made cabal use those
binaries, which then failed looking for templates in the 9.8.1 data
dir. Remove the --with-* flags so cabal installs its own alex/happy
from Hackage (built with 9.10.3, correct data dir). The LD_LIBRARY_PATH
fix ensures those cabal-installed tools can actually execute.
* fix(haskell): ship alex/happy template files and use them in HLS
alex and happy only captured their binary (usr/bin/alex, usr/bin/happy)
as OutputBin — the template files that ./Setup copy installs to
usr/share/x86_64-linux-ghc-<version>/... were discarded. Without the
templates, the tools fail with "openFile: does not exist" when any
downstream package uses them.
Add a data OutputData (usr/share/**) to both alex and happy so the
template files ship with the package. Then use --with-alex/--with-happy
in the HLS build to point cabal at the pre-packaged versions instead of
letting it download and build its own copies from Hackage — those
copies were the source of the "version could not be determined"
(Cabal-1008) failures.
alex/happy are standalone code generators; they don't need to match
the downstream GHC version, they just need their template files at
the hardcoded path.
---------
Co-authored-by: edge-delta[bot] <226719692+edge-delta[bot]@users.noreply.github.com>1 parent 436b57e commit 02e5f82
4 files changed
Lines changed: 142 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
0 commit comments