Skip to content

Problems building the time library with Cabal / Setup.hs

I get the following error when building the time library using ghc-6.6.1 and Cabal-1.1.6.2.

C:\Temp\time>runhaskell Setup.hs configure

Setup.hs:17:29:
    Couldn't match expected type `GHC.IOBase.ExitCode'
           against inferred type `()'
      Expected type: Args
                     -> Bool
                     -> PackageDescription
                     -> LocalBuildInfo
                     -> IO GHC.IOBase.ExitCode
      Inferred type: Args
                     -> Bool
                     -> PackageDescription
                     -> LocalBuildInfo
                     -> IO ()
    In the `runTests' field of a record
    In the expression:
        defaultUserHooks
            {confHook = add_Win32_dep $ (confHook defaultUserHooks),
             runTests = runTestScript}

I solved it by changing the type signature of runTestScript and removing the maybeExit function call from the body:

import GHC.IOBase
...
runTestScript :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO GHC.IOBase.ExitCode
runTestScript _args _flag _pd _lbi
 = withCurrentDirectory "test" $ system "make"

Then, the Setup.hs script compiles but I get a dependency problem

C:\Temp\time>runhaskell Setup.hs configure
Configuring time-1.1.1...
configure: Dependency Win32-any: using Win32-2.1.1
configure: Dependency base-any: using base-2.1.1
Setup.hs: cannot satisfy dependency old-locale-any

I solved it with removing that dependency from the time.cabal file.

Last issue: at installation HsTimeConfig.h is missing (copied it from ghc-6.6.1 source).

I don't know to which extent those problems are related to my specific installation. Looks like the user hooks signature has changed in the latest versions of Cabal.

Trac metadata
Trac field Value
Version 6.6.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries (other)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information