Ticket #1521 (closed bug: wontfix)

Opened 6 years ago

Last modified 3 years ago

Problems building the time library with Cabal / Setup.hs

Reported by: Olivier Boudry Owned by:
Priority: normal Milestone: Not GHC
Component: libraries (other) Version: 6.6.1
Keywords: Cc: michal.terepeta@…
Operating System: Windows Architecture: x86
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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.

Change History

Changed 3 years ago by michalt

  • cc michal.terepeta@… added
  • failure set to None/Unknown
  • status changed from new to closed
  • resolution set to wontfix

This is not a ticket about GHC and seems to be fixed anyway (time-1.2.0.3 builds just fine for me and looking at the code the types seem to work out).

Note: See TracTickets for help on using tickets.