From 6d5c3023ce001c3b0bebbe909f2a3a96f70d4d8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=20Jason=20Dominus=20=28=E9=99=B6=E6=95=8F=E4=BF=AE=29?= Date: Mon, 21 Feb 2022 11:17:04 -0500 Subject: [PATCH] Discuss ghcup in tutorial installation instructions The instructions as written will not work on Ubuntu systems, which provide an extremely out-of-date Haskell toolchain. Addresses issue https://github.com/haskell-servant/servant/issues/1540 https://github.com/haskell-servant/servant/issues/1540 --- doc/tutorial/install.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/doc/tutorial/install.rst b/doc/tutorial/install.rst index e0d1a70d..ba2c506c 100644 --- a/doc/tutorial/install.rst +++ b/doc/tutorial/install.rst @@ -40,3 +40,29 @@ nix `Nix `_ users should feel free to take a look at the `nix/shell.nix` file in the repository and use it to provision a suitable environment to build and run the examples. + +Note for Ubuntu users +-------- + +Ubuntu's packages for `ghc`, `cabal`, and `stack` are years out of date. +If the instructions above fail for you, +try replacing the Ubuntu packages with up-to-date versions. +First remove the installed versions: + +.. code-block:: bash + + # remove the obsolete versions + $ sudo apt remove ghc haskell-stack cabal-install + +Then install fresh versions of the Haskell toolchain +using the `ghcup `_ installer. + +As of February 2022, one easy way to do this is by running a bootstrap script: + +.. code-block:: bash + + $ curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh + +The script is interactive and will prompt you for details about what +you want installed and where. To install manually, +see `the detailed instructions `_.