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

closed-fixed
None
5
2010-05-20
2010-01-25
Anonymous
No

when doing cabal install I get the errors below:

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

Setup.hs:51:37:
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:

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

Discussion

  • 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 1.8.0.2 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. 
    Undo

    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':

    -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-1.6.0.3
    as the global installed cabal package which is overridden by a user
    install of Cabal-1.8.0.2. 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.