jfeltz / dash-haskell

dash docset builder for Haskell packages and cabal project dependencies
GNU Lesser General Public License v3.0
79 stars 12 forks source link

ReaderT build error in 1.0.0.1 #6

Closed neapel closed 10 years ago

neapel commented 10 years ago

I'm getting the following build error when installing (including the dependent versions as well, maybe there was a breaking change somewhere?)

$ cabal install dash-haskell
Installed ghc-paths-0.1.0.9
Installed mmorph-1.0.4
Installed prelude-extras-0.4
Installed stm-2.4.3
Installed mtl-2.1.3.1
Installed primitive-0.5.4.0
Installed ansi-terminal-0.6.1.1
Installed tagged-0.7.2
Installed transformers-base-0.4.3
Installed random-1.1
Installed exceptions-0.6.1
Installed ansi-wl-pprint-0.6.7.1
Installed transformers-compat-0.3.3.4
Installed monad-control-0.3.3.0
Installed pipes-4.1.3
Installed MonadRandom-0.3
Installed distributive-0.4.4
Installed optparse-applicative-0.11.0.1
Installed haddock-library-1.1.1
Installed haddock-api-2.15.0
Installed vector-0.10.12.1
Installed text-1.2.0.0
Installed hashable-1.2.2.0
Installed nats-0.2
Installed blaze-builder-0.3.3.4
Installed blaze-textual-0.2.0.9
Installed scientific-0.3.3.1
Installed parsec-3.1.7
Installed tagsoup-0.13.3
Installed unordered-containers-0.2.5.1
Installed semigroups-0.15.3
Installed void-0.6.1
Installed contravariant-1.2
Installed direct-sqlite-2.3.14
Installed comonad-4.2.2
Installed system-filepath-0.4.12
Installed semigroupoids-4.2
Installed system-fileio-0.3.14
Installed profunctors-4.2.0.1
Installed bifunctors-4.1.1.1
Installed free-4.9
Installed either-4.3.1
Installed attoparsec-0.12.1.2
Installed sqlite-simple-0.4.8.0
Failed to install dash-haskell-1.0.0.1
Configuring dash-haskell-1.0.0.1...
Building dash-haskell-1.0.0.1...
Preprocessing executable 'dash-haskell' for dash-haskell-1.0.0.1...
[ 1 of 17] Compiling Package.Conf     ( src/Package/Conf.hs, dist/build/dash-haskell/dash-haskell-tmp/Package/Conf.o )
[ 2 of 17] Compiling Data.String.Indent ( src/Data/String/Indent.hs, dist/build/dash-haskell/dash-haskell-tmp/Data/String/Indent.o )
[ 3 of 17] Compiling Data.String.Util ( src/Data/String/Util.hs, dist/build/dash-haskell/dash-haskell-tmp/Data/String/Util.o )
[ 4 of 17] Compiling Options.DbProvider ( src/Options/DbProvider.hs, dist/build/dash-haskell/dash-haskell-tmp/Options/DbProvider.o )

src/Options/DbProvider.hs:40:17:
    Couldn't match type ‘Either ParseError b0’
                  with ‘Control.Monad.Trans.Reader.ReaderT
                          String
                          (transformers-compat-0.3.3.4:Control.Monad.Trans.Except.Except
                             ParseError)
                          (Maybe [Char])’
    Expected type: ParseError
                   -> Control.Monad.Trans.Reader.ReaderT
                        String
                        (transformers-compat-0.3.3.4:Control.Monad.Trans.Except.Except
                           ParseError)
                        (Maybe [Char])
      Actual type: ParseError -> Either ParseError b0
    In the first argument of ‘(.)’, namely ‘Left’
    In the second argument of ‘(.)’, namely ‘Left . ErrorMsg’

src/Options/DbProvider.hs:59:21:
    Couldn't match expected type ‘Control.Monad.Trans.Reader.ReaderT
                                    String
                                    (transformers-compat-0.3.3.4:Control.Monad.Trans.Except.Except
                                       ParseError)
                                    (Maybe String -> ReadM DbProvider)’
                with actual type ‘Either ParseError b2’
    In the first argument of ‘maybe’, namely
      ‘(Left . ErrorMsg $ "invalid db provider")’
    In the second argument of ‘($)’, namely
      ‘maybe (Left . ErrorMsg $ "invalid db provider") Right f’
    In the expression:
      ReadM $ maybe (Left . ErrorMsg $ "invalid db provider") Right f

src/Options/DbProvider.hs:59:62:
    Couldn't match type ‘Either a0 (Maybe String -> ReadM DbProvider)’
                  with ‘Control.Monad.Trans.Reader.ReaderT
                          String
                          (transformers-compat-0.3.3.4:Control.Monad.Trans.Except.Except
                             ParseError)
                          (Maybe String -> ReadM DbProvider)’
    Expected type: (Maybe String -> ReadM DbProvider)
                   -> Control.Monad.Trans.Reader.ReaderT
                        String
                        (transformers-compat-0.3.3.4:Control.Monad.Trans.Except.Except
                           ParseError)
                        (Maybe String -> ReadM DbProvider)
      Actual type: (Maybe String -> ReadM DbProvider)
                   -> Either a0 (Maybe String -> ReadM DbProvider)
    In the second argument of ‘maybe’, namely ‘Right’
    In the second argument of ‘($)’, namely
      ‘maybe (Left . ErrorMsg $ "invalid db provider") Right f’

src/Options/DbProvider.hs:69:24:
    Couldn't match type ‘Either ParseError b1’
                  with ‘Control.Monad.Trans.Reader.ReaderT
                          String
                          (transformers-compat-0.3.3.4:Control.Monad.Trans.Except.Except
                             ParseError)
                          DbProvider’
    Expected type: ParseError
                   -> Control.Monad.Trans.Reader.ReaderT
                        String
                        (transformers-compat-0.3.3.4:Control.Monad.Trans.Except.Except
                           ParseError)
                        DbProvider
      Actual type: ParseError -> Either ParseError b1
    In the first argument of ‘(.)’, namely ‘Left’
    In the second argument of ‘(.)’, namely ‘Left . ErrorMsg’
Updating documentation index /Users/pascal/.cabal/share/doc/index.html
cabal: Error: some packages failed to install:
dash-haskell-1.0.0.1 failed during the building phase. The exception was:
ExitFailure 1
jfeltz commented 10 years ago

Interesting, I'm having trouble reproducing this bug, and I'll need some time to look into possible causes, sorry.

benjaminfjones commented 10 years ago

I ran into the same error doing a sandboxed build with GHC 7.8.3 on Mac OS X.

It looks like the problem stems from the internal representation of ReadM in optparse-applicative. That representation changed when the package went from 0.10 to 0.11 (and 0.11.0.1 which is current as of now). Changing the build depends to the following worked for me:

optparse-applicative >= 0.10.0 && < 0.11
jfeltz commented 10 years ago

thanks @benjaminfjones, your fix is in c6b70127b4627686585a54dcdba077802620ce10

benjaminfjones commented 10 years ago

Sure! Thanks for writing dash-haskell :)