tomjaguarpaw / tilapia

Improving all Haskell's programmer interfaces

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ghci segfaults after fresh installtion from ghcup.

LAC-Tech opened this issue · comments

First off, this was done in alpine linux, which means musl. This may save you some time if musl isn't supported :)

Regardless, here's console output showing a fresh install and segfault:

$ curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh

Welcome 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/IDE

ghcup installs only into the following directory,
which can be removed anytime:
  /home/lewis/.ghcup

Press ENTER to proceed or ctrl-c to abort.
Note that this script can be re-run at any given time.

-------------------------------------------------------------------------------

Detected bash shell on your system...
Do you want ghcup to automatically add the required PATH variable to "/home/lewis/.bashrc"?

[P] Yes, prepend  [A] Yes, append  [N] No  [?] Help (default is "P").

a
-------------------------------------------------------------------------------
Do you want to install haskell-language-server (HLS)?
HLS is a language-server that provides IDE-like functionality
and 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").

y
-------------------------------------------------------------------------------
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-experimental
If you want to keep stacks vanilla behavior, answer 'No'.

[Y] Yes  [N] No  [?] Help (default is "Y").

y
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 15.4M  100 15.4M    0     0  4805k      0  0:00:03  0:00:03 --:--:-- 4804k
[ Info  ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.7.yaml as file /home/lewis/.ghcup/cache/ghcup-0.0.7.yaml
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  286k  100  286k    0     0   368k      0 --:--:-- --:--:-- --:--:--  367k
[ 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): binutils-gold curl gcc g++ gmp-dev libc-dev libffi-dev make musl-dev ncurses-dev perl tar xz
Press ENTER to proceed or ctrl-c to abort.
Installation may take a while.


[ Info  ] downloading: https://downloads.haskell.org/~ghc/9.2.8/ghc-9.2.8-x86_64-alpine3.12-linux-gmp.tar.xz as file /home/lewis/.ghcup/cache/ghc-9.2.8-x86_64-alpine3.12-linux-gmp.tar.xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  197M  100  197M    0     0  7401k      0  0:00:27  0:00:27 --:--:-- 7872k
[ Info  ] verifying digest of: ghc-9.2.8-x86_64-alpine3.12-linux-gmp.tar.xz
[ Info  ] Unpacking: ghc-9.2.8-x86_64-alpine3.12-linux-gmp.tar.xz to /home/lewis/.ghcup/tmp/ghcup-1f8c0d5a1f43fa2f
[ Info  ] Installing GHC (this may take a while)
[ Info  ] Merging file tree from "/home/lewis/.ghcup/tmp/ghcup-e4b0cc7cf366b134/home/lewis/.ghcup/ghc/9.2.8" to "/home/lewis/.ghcup/ghc/9.2.8"
[ Info  ] GHC installation successful
[ Info  ] GHC 9.2.8 successfully set as default version
[ Info  ] downloading: https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal/3.6.2.0/cabal-install-3.6.2.0-x86_64-linux-alpine-static.tar.xz as file /home/lewis/.ghcup/cache/cabal-install-3.6.2.0-x86_64-linux-alpine-static.tar.xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 4523k  100 4523k    0     0  4687k      0 --:--:-- --:--:-- --:--:-- 4687k
[ Info  ] verifying digest of: cabal-install-3.6.2.0-x86_64-linux-alpine-static.tar.xz
[ Info  ] Unpacking: cabal-install-3.6.2.0-x86_64-linux-alpine-static.tar.xz to /home/lewis/.ghcup/tmp/ghcup-a9cc6fad49f57a43
[ Info  ] Installing cabal
[ Info  ] Cabal installation successful
Downloading the latest package list from hackage.haskell.org
Updated package list of hackage.haskell.org to the index-state 2023-08-26T20:54:39Z
To revert to previous state run:
    cabal v2-update 'hackage.haskell.org,2023-08-02T06:54:18Z'
[ Error ] [GHCup-07140] Both installation and setting the tool failed. Install error was: Unable to find a download for the requested version/distro. 
[ ...   ] Set error was: The version 2.0.0.1 of the tool hls is not installed.
[ Error ] Also check the logs in /home/lewis/.ghcup/logs
"ghcup --metadata-fetching-mode=Strict --cache install hls" failed!
HLS installation failed, continuing anyway
[ Info  ] downloading: https://github.com/commercialhaskell/stack/releases/download/v2.9.3/stack-2.9.3-linux-x86_64-static.tar.gz as file /home/lewis/.ghcup/cache/stack-2.9.3-linux-x86_64-static.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 13.2M  100 13.2M    0     0  3625k      0  0:00:03  0:00:03 --:--:-- 6920k
[ Info  ] verifying digest of: stack-2.9.3-linux-x86_64-static.tar.gz
[ Info  ] Unpacking: stack-2.9.3-linux-x86_64-static.tar.gz to /home/lewis/.ghcup/tmp/ghcup-747d5381a2656137
[ Info  ] Installing stack
[ Info  ] Stack installation successful
[ Info  ] Stack manages GHC versions internally by default. To improve integration, please visit:
[ ...   ]   https://www.haskell.org/ghcup/guide/#stack-integration
[ ...   ] 
[ ...   ] Also check out:
[ ...   ]   https://docs.haskellstack.org/en/stable/yaml_configuration
[ ...   ] 
/home/lewis/.stack/hooks/ghc-install.sh already exists, skipping hook installation.
If you want to reinstall the hook, delete it manually and re-run
this script!

===============================================================================

OK! /home/lewis/.bashrc has been modified. Restart your terminal for the changes to take effect,
or type "source /home/lewis/.ghcup/env" to apply them in your current terminal session.

===============================================================================

All done!

To start a simple repl, run:
  ghci

To start a new haskell project in the current directory, run:
  cabal init --interactive

To install other GHC versions and tools, run:
  ghcup tui

If you are new to Haskell, check out https://www.haskell.org/ghcup/steps/
lightgrey:~$ which ghci
lightgrey:~$ ghci
bash: ghci: command not found
lightgrey:~$ source /home/lewis/.ghcup/env
lightgrey:~$ ghci
GHCi, version 9.2.8: https://www.haskell.org/ghc/  :? for help
Segmentation fault

Reading over the output it does determine it can't find a download, but seems to proceed and download a tool anyway.

commented

I'd recommend opening an issue on the GHC bug tracker: https://gitlab.haskell.org/ghc/ghc/-/issues

@noughtmare I asked @LAC-Tech to file the issue here because I wanted to make sure the issue got captured and creating a new account on Haskell GitLab is high enough friction that we risked losing the issue.

commented

Ah, great! I see you have also opened one on the GHC issue tracker now: https://gitlab.haskell.org/ghc/ghc/-/issues/23894

Yes, thanks for linking it. I forgot to do so myself!