-
-
Notifications
You must be signed in to change notification settings - Fork 414
Description
Hi!
When compiling from source on a moderately-powered (4-core but RAM-limited) machine, managing GHC memory usage becomes an obstacle. With some particularly heavyweight dependencies (ghc-lib, Cabal), the ghc process easily reaches 2 GiB usage.
That's not an issue in itself — my usual workaround is disabling build parallelism via -j1 (on top of shutting down everything else running on the system except the bare minimum).
The issue is, that ./install.hs claims to support -j1 but in fact doesn't:
$ ./install.hs --help | grep CPU
-j[N], --jobs[=N] Allow N jobs/threads at once [default CPUs].
This is easily checked by running with -j1 and observing the build log (it shows compiling multiple packages at once) or the process tree.
My environment
$ haskell-language-server --probe-tools
haskell-language-server version: 1.1.0.0 (GHC: 8.6.5) (PATH: /home/ulidtko/.local/bin/haskell-language-server) (GIT hash: f1c096927186a93d8e3ccd4fe8385cc1b070350b)
Tool versions found on the $PATH
cabal: 3.2.0.0
stack: 2.5.1
ghc: 8.10.4
OS: ArchLinux
lsp-client: neovim
Steps to reproduce
• In HLS tree, run ./install.hs hls-8.6.5 -j1
Expected behavior
• -j1 is respected and the build becomes single-threaded.
Actual behavior
• -j1 is ignored and the build runs $ncpus GHCs.