Just this week, I once again had to help a newcomer with setting up the Haskell toolchain on a fresh Ubuntu machine. The issue there is, as it's often the case with newcomers, the system is completely fresh and misses certain system dependencies. I don't see the list of dependencies for such a prolific use case in the User Guide. Would it be possible to add it somewhere? E.g. the Troubleshooting section. I should say the error I saw was quite bizarre (something like "preprocessor sanity check failed" on the configure step for GHC).
As far as I'm aware, this should be enough for Ubuntu (again, a vastly dominant variant of Linux, if include all the flavors and remixes):
Good to know, thank you! My use-case for having those in the docs is that I can quickly copy and paste it to some novice who has trouble with the installation process. Unfortunately, novices usually not paying attention to the output. (It may also depend on the style and amount of output, and also whether they're prompted by the script to pay attention to the critical parts, but I don't wanna start that discussion here.)
Also, having a critical piece of requirements both in the output and in the docs is normal.
Of course, if you don't feel like supporting this use case, feel free to close.
Update: apologies, my actual problem was getting libnuma failures when installing ghcup itself (#125 (comment 462017)), so I didn't even get to the point of trying to install GHC
That being said, the output is a bit hidden in the logs
[ Info ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.7.yaml as file /root/.ghcup/cache/ghcup-0.0.7.yaml % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 191k 100 191k 0 0 754k 0 --:--:-- --:--:-- --:--:-- 755k[ Info ] Upgrading GHCup...[ Warn ] No GHCup update availableSystem requirements Please ensure the following distro packages are installed before continuing (you can exit ghcup and return at any time): build-essential curl libffi-dev libffi8ubuntu1 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5[ Info ] downloading: https://downloads.haskell.org/~ghc/9.2.5/ghc-9.2.5-aarch64-deb10-linux.tar.xz as file /root/.ghcup/cache/ghc-9.2.5-aarch64-deb10-linux.tar.xz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 263M 100 263M 0 0 25.5M 0 0:00:10 0:00:10 --:--:-- 28.9M[ Info ] verifying digest of: ghc-9.2.5-aarch64-deb10-linux.tar.xz[ Info ] Unpacking: ghc-9.2.5-aarch64-deb10-linux.tar.xz to /root/.ghcup/tmp/ghcup-08cbf401caafe505[ Info ] Installing GHC (this may take a while)[ ghc-configure ] checking for python3... no[ ghc-configure ] checking for gcc... no[ ghc-configure ] checking for clang... no[ ghc-configure ] configure: error: in `/root/.ghcup/tmp/ghcup-08cbf401caafe505/ghc-9.2.5':[ ghc-configure ] configure: error: no acceptable C compiler found in $PATH[ ghc-configure ] See `config.log' for more details[ Error ] Process "sh" with arguments ["./configure",[ ... ] "--prefix=/root/.ghcup/ghc/9.2.5"] failed with exit code 1.[ Error ] Also check the logs in /root/.ghcup/logs"_eghcup --cache install ghc recommended" failed!
Maybe it could be a bit more emphasized like
[ Info ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.7.yaml as file /root/.ghcup/cache/ghcup-0.0.7.yaml % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 191k 100 191k 0 0 754k 0 --:--:-- --:--:-- --:--:-- 755k[ Info ] Upgrading GHCup...[ Warn ] No GHCup update available================================================================================System requirements Please ensure the following distro packages are installed before continuing (you can exit ghcup and return at any time): build-essential curl libffi-dev libffi8ubuntu1 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5================================================================================...
The script even requires you to press enter before proceeding. You have to actively ignore the message
I don't think this is true (or at least, not anymore; the link seems to be broken). In a fresh docker run --rm -it ubuntu:latest, I'm seeing
#curl --proto'=https'--tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 shWelcome to Haskell!This script can download and install the following binaries: * ghcup - The Haskell toolchain installer * ghc - The Glasgow Haskell Compiler * cabal - The Cabal build tool for managing Haskell software * stack - A cross-platform program for developing Haskell projects (similar to cabal) * hls - (optional) A language server for developers to integrate with their editor/IDEghcup installs only into the following directory,which can be removed anytime: /root/.ghcup % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 51.5M 100 51.5M 0 0 20.7M 0 0:00:02 0:00:02 --:--:-- 20.7M/root/.ghcup/bin/ghcup: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory"_eghcup config set downloader Curl" failed!
#curl --proto'=https'--tlsv1.2 -sSf https://get-ghcup.haskell.org | shWelcome to Haskell!This script can download and install the following binaries: * ghcup - The Haskell toolchain installer * ghc - The Glasgow Haskell Compiler * cabal - The Cabal build tool for managing Haskell software * stack - A cross-platform program for developing Haskell projects (similar to cabal) * hls - (optional) A language server for developers to integrate with their editor/IDEghcup installs only into the following directory,which can be removed anytime: /root/.ghcupPress ENTER to proceed or ctrl-c to abort.Note that this script can be re-run at any given time.-------------------------------------------------------------------------------Do you want to install haskell-language-server (HLS)?HLS is a language-server that provides IDE-like functionalityand can integrate with different editors, such as Vim, Emacs, VS Code, Atom, ...Also see https://haskell-language-server.readthedocs.io/en/stable/[Y] Yes [N] No [?] Help (default is "N").n-------------------------------------------------------------------------------Do you want to enable better integration of stack with GHCup?This means that stack won't install its own GHC versions, but uses GHCup's.For more information see: https://docs.haskellstack.org/en/stable/yaml_configuration/#ghc-installation-customisation-experimentalIf you want to keep stacks vanilla behavior, answer 'No'.[Y] Yes [N] No [?] Help (default is "Y").n % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 51.5M 100 51.5M 0 0 37.8M 0 0:00:01 0:00:01 --:--:-- 37.8M/root/.ghcup/bin/ghcup: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory"_eghcup config set downloader Curl" failed!
Yes it's true you don't get a list of system dependencies if ghcup itself fails to start. That's a GHC bug. They can't seem to fix the libnuma thing properly. You're also not running x86_64, which is statically linked and will never fail to start.