Install haskell ghci debugger adapter on WSL

82 Views Asked by At

I am using the Windows Subsystem for Linux and I was trying to install the haskell debugger on vscode so I follow the instructions from the Haskell GHCi Debug Adapter Phoityne extension and I run

stack install haskell-dap ghci-dap haskell-debug-adapter

however I get the following output with an error : (could you help me fix this?)

comonad                      > using precompiled package
indexed-traversable-instances> using precompiled package
streaming-commons            > using precompiled package
vector-algorithms            > using precompiled package
ghci-dap                     > configure
bifunctors                   > using precompiled package
witherable                   > using precompiled package
mono-traversable             > using precompiled package
assoc                        > using precompiled package
semigroupoids                > using precompiled package
conduit                      > using precompiled package
these                        > using precompiled package
conduit-extra                > using precompiled package
ghci-dap                     > Configuring ghci-dap-0.0.21.0...
semialign                    > using precompiled package
strict                       > using precompiled package
ghci-dap                     > build
aeson                        > using precompiled package
ghci-dap                     > Preprocessing library for ghci-dap-0.0.21.0..
ghci-dap                     > Building library for ghci-dap-0.0.21.0..
ghci-dap                     > [1 of 2] Compiling GHCi.DAP
ghci-dap                     > [2 of 2] Compiling Paths_ghci_dap
monad-control                > configure
ghci-dap                     > /usr/bin/ld.gold: error: cannot find -ltinfo
ghci-dap                     > collect2: error: ld returned 1 exit status
ghci-dap                     > `gcc' failed in phase `Linker'. (Exit code: 1)
monad-control                > Configuring monad-control-1.0.3.1...
monad-control                > build
profunctors                  > configure
monad-control                > Preprocessing library for monad-control-1.0.3.1..
monad-control                > Building library for monad-control-1.0.3.1..
monad-control                > [1 of 1] Compiling Control.Monad.Trans.Control
monad-control                >
monad-control                > /tmp/stack-9fbbcd177f54b6e0/monad-control-1.0.3.1/src/Control/Monad/Trans/Control.hs:207:19: warning: [-Wstar-is-type]
monad-control                >     Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’
monad-control                >     relies on the StarIsType extension, which will become
monad-control                >     deprecated in the future.
monad-control                >     Suggested fix: use ‘Type’ from ‘Data.Kind’ instead.
monad-control                >     |
monad-control                > 207 |   type StT t a :: *
monad-control                >     |                   ^
monad-control                >
monad-control                > /tmp/stack-9fbbcd177f54b6e0/monad-control-1.0.3.1/src/Control/Monad/Trans/Control.hs:546:21: warning: [-Wstar-is-type]
monad-control                >     Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’
monad-control                >     relies on the StarIsType extension, which will become
monad-control                >     deprecated in the future.
monad-control                >     Suggested fix: use ‘Type’ from ‘Data.Kind’ instead.
monad-control                >     |
monad-control                > 546 |     type StM m a :: *
monad-control                >     |                     ^
profunctors                  > Configuring profunctors-5.6.2...
monad-control                > copy/register
monad-control                > Installing library in /home/john/.stack/snapshots/x86_64-linux/1cdb20536a2b28f8a63c3ef0064064c7e8a40b9401b202e11484b066606a1626/9.0.2/lib/x86_64-linux-ghc-9.0.2/monad-control-1.0.3.1-Im9bTaF8aCBBfxvlDlLjt
monad-control                > Registering library for monad-control-1.0.3.1..
profunctors                  > build
profunctors                  > Preprocessing library for profunctors-5.6.2..
profunctors                  > Building library for profunctors-5.6.2..
profunctors                  > [ 1 of 16] Compiling Data.Profunctor.Unsafe
profunctors                  > [ 2 of 16] Compiling Data.Profunctor.Types
profunctors                  > [ 3 of 16] Compiling Data.Profunctor.Monad
profunctors                  > [ 4 of 16] Compiling Data.Profunctor.Adjunction
profunctors                  > [ 5 of 16] Compiling Data.Profunctor.Strong
profunctors                  > [ 6 of 16] Compiling Data.Profunctor.Closed
profunctors                  > [ 7 of 16] Compiling Data.Profunctor.Choice
profunctors                  > [ 8 of 16] Compiling Data.Profunctor.Traversing
profunctors                  > [ 9 of 16] Compiling Data.Profunctor.Mapping
profunctors                  > [10 of 16] Compiling Data.Profunctor
profunctors                  > [11 of 16] Compiling Data.Profunctor.Sieve
profunctors                  > [12 of 16] Compiling Data.Profunctor.Rep
profunctors                  > [13 of 16] Compiling Data.Profunctor.Composition
profunctors                  > [14 of 16] Compiling Data.Profunctor.Ran
profunctors                  > [15 of 16] Compiling Data.Profunctor.Cayley
profunctors                  > [16 of 16] Compiling Data.Profunctor.Yoneda
profunctors                  > copy/register
profunctors                  > Installing library in /home/john/.stack/snapshots/x86_64-linux/1cdb20536a2b28f8a63c3ef0064064c7e8a40b9401b202e11484b066606a1626/9.0.2/lib/x86_64-linux-ghc-9.0.2/profunctors-5.6.2-FpWdF7ZTYX8Inb0NOb1HIn
profunctors                  > Registering library for profunctors-5.6.2..
Progress 18/29

Error: [S-7282]
       Stack failed to execute the build plan.

       While executing the build plan, Stack encountered the error:

       [S-7011]
       While building package ghci-dap-0.0.21.0 (scroll up to its section to see the error) using:
       /home/john/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_6HauvNHV_3.4.1.0_ghc-9.0.2 --verbose=1 --builddir=.stack-work/dist/x86_64-linux/ghc-9.0.2 build --ghc-options " -fdiagnostics-color=always"
       Process exited with code: ExitFailure 1

Here are my ghcup settings :

enter image description here

edit

I did

sudo apt-get install libtinfo-dev

and then tried again

stack install haskell-dap ghci-dap haskell-debug-adapter

and I get the following

ghci-dap             > configure
ghci-dap             > Configuring ghci-dap-0.0.21.0...
ghci-dap             > build
free                 > configure
ghci-dap             > Preprocessing library for ghci-dap-0.0.21.0..
ghci-dap             > Building library for ghci-dap-0.0.21.0..
ghci-dap             > [1 of 2] Compiling GHCi.DAP
ghci-dap             > [2 of 2] Compiling Paths_ghci_dap
free                 > Configuring free-5.1.9...
ghci-dap             > Preprocessing executable 'ghci-dap' for ghci-dap-0.0.21.0..
ghci-dap             > Building executable 'ghci-dap' for ghci-dap-0.0.21.0..
free                 > build
invariant            > configure
free                 > Preprocessing library for free-5.1.9..
free                 > Building library for free-5.1.9..
ghci-dap             > [1 of 6] Compiling GHCi.DAP.Constant
ghci-dap             > [2 of 6] Compiling GHCi.DAP.Type
ghci-dap             >
ghci-dap             > /tmp/stack-1d9a0db1c5e8eb77/ghci-dap-0.0.21.0/app/GHCi/DAP/Type.hs:10:1: error:
ghci-dap             >     Could not find module ‘GHCi.GhcApiCompat’
ghci-dap             >     Use -v (or `:set -v` in ghci) to see a list of the files searched for.
ghci-dap             >    |
ghci-dap             > 10 | import qualified GHCi.GhcApiCompat as GAC
ghci-dap             >    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
free                 > [ 1 of 20] Compiling Control.Alternative.Free
free                 > [ 2 of 20] Compiling Control.Alternative.Free.Final
free                 > [ 3 of 20] Compiling Control.Applicative.Free
free                 > [ 4 of 20] Compiling Control.Applicative.Free.Fast
invariant            > Configuring invariant-0.5.6...
free                 > [ 5 of 20] Compiling Control.Applicative.Free.Final
free                 > [ 6 of 20] Compiling Control.Applicative.Trans.Free
invariant            > build
lifted-base          > configure
invariant            > Preprocessing library for invariant-0.5.6..
invariant            > Building library for invariant-0.5.6..
invariant            > [1 of 4] Compiling Data.Functor.Invariant
free                 > [ 7 of 20] Compiling Control.Comonad.Cofree.Class
free                 > [ 8 of 20] Compiling Control.Comonad.Trans.Cofree
lifted-base          > Configuring lifted-base-0.2.3.12...
lifted-base          > build
lifted-base          > Preprocessing library for lifted-base-0.2.3.12..
lifted-base          > Building library for lifted-base-0.2.3.12..
lifted-base          > [1 of 9] Compiling Control.Concurrent.Chan.Lifted
lifted-base          > [2 of 9] Compiling Control.Concurrent.MVar.Lifted
lifted-base          > [3 of 9] Compiling Control.Concurrent.QSem.Lifted
lifted-base          > [4 of 9] Compiling Control.Concurrent.QSemN.Lifted
lifted-base          > [5 of 9] Compiling Control.Exception.Lifted
free                 > [ 9 of 20] Compiling Control.Monad.Free.Class
free                 > [10 of 20] Compiling Control.Monad.Free.TH
lifted-base          > [6 of 9] Compiling Control.Concurrent.Lifted
lifted-base          > [7 of 9] Compiling Data.IORef.Lifted
lifted-base          > [8 of 9] Compiling Foreign.Marshal.Utils.Lifted
lifted-base          > [9 of 9] Compiling System.Timeout.Lifted
invariant            > [2 of 4] Compiling Data.Functor.Invariant.TH.Internal
lifted-base          > copy/register
lifted-base          > Installing library in /home/john/.stack/snapshots/x86_64-linux/1cdb20536a2b28f8a63c3ef0064064c7e8a40b9401b202e11484b066606a1626/9.0.2/lib/x86_64-linux-ghc-9.0.2/lifted-base-0.2.3.12-FQICkBXAGZYK6PUDakldm6
invariant            > [3 of 4] Compiling Data.Functor.Invariant.TH
lifted-base          > Registering library for lifted-base-0.2.3.12..
free                 > [11 of 20] Compiling Data.Functor.Classes.Compat
free                 > [12 of 20] Compiling Control.Monad.Trans.Iter
invariant            > [4 of 4] Compiling Paths_invariant
free                 > [13 of 20] Compiling Control.Monad.Trans.Free.Ap
invariant            > copy/register
invariant            > Installing library in /home/john/.stack/snapshots/x86_64-linux/1cdb20536a2b28f8a63c3ef0064064c7e8a40b9401b202e11484b066606a1626/9.0.2/lib/x86_64-linux-ghc-9.0.2/invariant-0.5.6-HCgtAV9j13i22GIr1ZZzMU
invariant            > Registering library for invariant-0.5.6..
free                 > [14 of 20] Compiling Control.Monad.Trans.Free
free                 > [15 of 20] Compiling Control.Monad.Trans.Free.Church
free                 > [16 of 20] Compiling Control.Monad.Free.Ap
free                 > [17 of 20] Compiling Control.Monad.Free
free                 > [18 of 20] Compiling Control.Monad.Free.Church
free                 > [19 of 20] Compiling Control.Comonad.Trans.Coiter
free                 > [20 of 20] Compiling Control.Comonad.Cofree
free                 > copy/register
free                 > Installing library in /home/john/.stack/snapshots/x86_64-linux/1cdb20536a2b28f8a63c3ef0064064c7e8a40b9401b202e11484b066606a1626/9.0.2/lib/x86_64-linux-ghc-9.0.2/free-5.1.9-5IqTsyB2LOL4XlgSpn1DjC
free                 > Registering library for free-5.1.9..
Progress 4/12

Error: [S-7282]
       Stack failed to execute the build plan.

       While executing the build plan, Stack encountered the error:

       [S-7011]
       While building package ghci-dap-0.0.21.0 (scroll up to its section to see the error) using:
       /home/john/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_6HauvNHV_3.4.1.0_ghc-9.0.2 --verbose=1 --builddir=.stack-work/dist/x86_64-linux/ghc-9.0.2 build --ghc-options " -fdiagnostics-color=always"
       Process exited with code: ExitFailure 1
0

There are 0 best solutions below