quchen / stgi

A user-centric visual STG implementation to help understand GHC/Haskell's execution model.
Other
527 stars 26 forks source link

Cabal build error #104

Closed coot closed 3 years ago

coot commented 3 years ago

I am getting the following error when I try to build lib:stgi

src/Stg/Parser/Parser.hs:74:39: error:
    • Couldn't match type ‘Data.Text.Prettyprint.Doc.Internal.Doc
                             Data.Text.Prettyprint.Doc.Render.Terminal.Internal.AnsiStyle’
                     with ‘Doc’
      NB: ‘Doc’
            is defined in ‘Text.PrettyPrint.ANSI.Leijen.Internal’
                in package ‘ansi-wl-pprint-0.6.9’
          ‘Data.Text.Prettyprint.Doc.Internal.Doc’
            is defined in ‘Data.Text.Prettyprint.Doc.Internal’
                in package ‘prettyprinter-1.2.1.1’
      Expected type: Either Doc ast
        Actual type: Either
                       (Data.Text.Prettyprint.Doc.Internal.Doc
                          Data.Text.Prettyprint.Doc.Render.Terminal.Internal.AnsiStyle)
                       ast
    • In the expression: Left e
      In a case alternative: Failure ErrInfo {_errDoc = e} -> Left e
      In the expression:
        case
            parseString (whiteSpace *> p <* eof) mempty (T.unpack input)
        of
          Success a -> Right a
          Failure ErrInfo {_errDoc = e} -> Left e
   |
74 |     Failure ErrInfo{ _errDoc = e } -> Left e
   |                                       ^^^^^^

I am using the following cabal.project.local config file to match lts-14.4:

with-compiler: ghc-8.6.5

constraints:
  prettyprinter == 1.2.1.1,
  prettyprinter-ansi-terminal == 1.1.1.2

A similar errors pops out with ghc-8.10.4 without additional constraints (prettyprinter == 1.7).

quchen commented 3 years ago

I haven’t built this with Cabal ever, so I can’t comment on this – STGi was created before Cabal got polished again, and was developed using Stack only. If there’s an easy fix I’m open to it.

coot commented 3 years ago

103 fixed it, it builds with cabal now without any modifications.