#52 cabal install wxcore fails / Setup.hs type error


when doing cabal install I get the errors below:

Couldn't match expected type `GenericPackageDescription'
against inferred type `Either
GenericPackageDescription PackageDescription'
Expected type: (GenericPackageDescription, HookedBuildInfo)
Inferred type: (Either
GenericPackageDescription PackageDescription,
In the `confHook' field of a record
In the first argument of `defaultMainWithHooks', namely
`simpleUserHooks {confHook = myConfHook}'

Couldn't match expected type `GenericPackageDescription'
against inferred type `Either
GenericPackageDescription PackageDescription'
In the expression: pkg0
In the second argument of `confHook', namely `(pkg0, pbi)'
In a stmt of a 'do' expression:
lbi <- confHook simpleUserHooks (pkg0, pbi) flags

the following patch seemed to solve it:

< main = defaultMainWithHooks simpleUserHooks { confHook = myConfHook }
> main =
> defaultMainWithHooks simpleUserHooks { confHook = f }
> where
> f (x, y) = myConfHook (Left x, y)
< lbi <- confHook simpleUserHooks (pkg0, pbi) flags
> let Left t = pkg0
> lbi <- confHook simpleUserHooks (t, pbi) flags


  • Eric Kow

    Eric Kow - 2010-01-31

    I couldn't reproduce this problem on the darcs version of wxhaskell with GHC 6.10 and cabal-install version 0.8.0 using version of the Cabal library

    Perhaps you should send your modification as a patch to the wxhaskell-devel list?

    darcs record and darcs send will do it.

  • Comment has been marked as spam. 

    You can see all pending comments posted by this user  here

    Anonymous - 2010-02-25

    I had the same problem both with 'cabal configure' and 'runhaskell Setup
    configure'. My solution was to simply change the type signature of

    -myConfHook :: (Either GenericPackageDescription PackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo
    +myConfHook :: (GenericPackageDescription, HookedBuildInfo) -> ConfigFlags -> IO LocalBuildInfo

    If I'm correct that has the same effect as the patch used above.

    Now for the reproducability: My ghc version is 6.10.4 with Cabal-
    as the global installed cabal package which is overridden by a user
    install of Cabal- If I force usage of the global (older) cabal
    package by specifying 'cabal-version: < 1.8' in 'wxcore.cabal' then
    'cabal configure' errors out with a type error if the patch is applied
    and completes fine if it isn't.
    Specifying 'cabal-version: >= 1.8' makes 'cabal configure' give a type
    error if without the patch.
    Hope this is of any value.

  • Jeremy O\'Donoghue

    Fixed in Cabal release 0.12.4

  • Jeremy O\'Donoghue

    • assigned_to: nobody --> jodonoghue
    • status: open --> closed-fixed

Log in to post a comment.