3

I'm trying to install GHC with ghcup on an windows laptop running an Ubuntu subsystem. I keep getting the same error and I don't even really know what is going wrong. Here are the error messages:

[ Info  ] verifying digest of: ghc-8.10.7-x86_64-fedora27-linux.tar.xz
[ Info  ] Unpacking: ghc-8.10.7-x86_64-fedora27-linux.tar.xz to /tmp/ghcup-61d1fb5776edc19e
[ Info  ] Installing GHC (this may take a while)
[ ghc-make ] # on Win64, "install -s" calls a strip that doesn't understand 64bit binaries.
[ ghc-make ] # For some reason, this means the DLLs end up non-executable, which means
[ ghc-make ] "utils/ghc-cabal/dist-install/build/tmp/ghc-cabal-bindist" copy compiler stage2 "strip" '' '/home/levi...
i...         Installing library in /home/levi/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/ghc-8.10.7
i...         "/home/levi/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/bin/ghc-pkg" --force --global-package-db "/home/levi/.gh...
[ ghc-make ] ghc-pkg: Couldn't open database /home/levi/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/package.conf.d for modific...
i...         make[1]: *** [ghc.mk:985: install_packages] Error 1
             make: *** [Makefile:51: install] Error 2
[ Error ] BuildFailed failed in dir "/tmp/ghcup-61d1fb5776edc19e": Process "make" with arguments ["install"] failed with exit code 2.
[ ...   ]     Check the logs at /home/levi/.ghcup/logs and the build directory /tmp/ghcup-61d1fb5776edc19e for more clues.
[ ...   ]     Make sure to clean up /tmp/ghcup-61d1fb5776edc19e afterwards.
"_eghcup --cache install ghc recommended" failed!
levi@LAPTOP-BBDADJ2R:~$

Any ideas on why this is happening and how to fix it?

Artem Pelenitsyn
  • 2,508
  • 22
  • 38
NFTLevi
  • 43
  • 1
  • 5
  • What does the log shows (/home/levi/.ghcup/logs)? – Willem Van Onsem Sep 09 '21 at 17:57
  • in /.ghcup/logs there are 3 logs: ghc-configure.log, ghc-make.log and ghcup.log. config log shows nothing out the ordinary ending in https://gyazo.com/6e6bbe16118dcb11e15f83051b62e6d4, the make log shows a few warnings https://gyazo.com/0bb41867757b81603facec27737e8888 https://gyazo.com/bb21cba484d51bc1131df7006742e744 then ends in the error messages https://gyazo.com/7e44e24f1dbecb7cb422a476bc3ecae5. – NFTLevi Sep 09 '21 at 18:28
  • ghcup.log just shows the same lines as above https://gyazo.com/09904853880003c65118e0c0a89a5ee9 – NFTLevi Sep 09 '21 at 18:35

3 Answers3

4

Judging by this issue on the ghcup repo (it cites the same error as yours), you are using WSL 1, which is not supported. You have to upgrade to WSL 2.

Artem Pelenitsyn
  • 2,508
  • 22
  • 38
  • 1
    Oh boy this sent me through a rabbit hole, You're correct Ubuntu was still running in WSL version 1. Thank you! – NFTLevi Sep 10 '21 at 13:15
2
$ sudo apt-get update -y && sudo apt-get install build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 -y
Jason Mullings
  • 850
  • 14
  • 10
0
  1. open you home-> on rifgt side menu select " show hidden files"
  2. You will able to see .ghcup folder
  3. open .ghcup->cache
  4. crate a file named ghcup-0.0.7.yaml
  5. paste with lobalTools: ShimGen: dlUri: https://downloads.haskell.org/~ghcup/shimgen/shim-2.exe dlHash: 7c55e201f71860c5babea886007c8fa44b861abf50d1c07e5677eb0bda387a70 toolRequirements: GHC: unknown_version: Linux_Debian: unknown_versioning: distroPKGs: - build-essential - curl - libffi-dev - libffi6 - libgmp-dev - libgmp10 - libncurses-dev - libncurses5 - libtinfo5 notes: '' ">= 11": distroPKGs: - build-essential - curl - libffi-dev - libffi7 - libgmp-dev - libgmp10 - libncurses-dev - libncurses5 - libtinfo5 notes: ''