Skip to content


Fix build with GHC 6.12 #1154

merged 1 commit into from

2 participants


These are the changes necessary for me to build Cabal on GHC 6.12.3. I can't run the test-suite with them because it fails even without my changes, but I think they're reasonably non-controversial (except that I can't find a good changelog for the time package, so I'm not certain there were no functionality changes we should be worried about, but I don't think so)


Update on the test situation: I managed, via some considerable effort, to get the unit tests running and passing on 6.12.3.

I can't get the package tests to run. I'm not yet sure why but I suspect it's something to do with HUnit invoking the wrong ghc version.


I managed to get the package tests to run at last – I needed to set GHC=ghc-6.12.3 in the environment, so that the various Setup.hs files were compiled with the right compiler. I feel like that ought to be done automatically, but I'm not going to lose sleep over it.

The result was three failures, but they're the same three failures I get running it on GHC 7.6.1, so I don't think they're to do with my patch.

Haskell member

I had to add the GHC environment variable to make it possible to run the test suite if you change the compiler using configure -w. Before the tests would just call the ghc executable on the path, even if it was different from the one the library was built with. It would be nice to improve this. We'd somehow need to figure out which GHC to use in the tests. Perhaps we could read the configure GHC from within dist/setup-config (I think that's the right file) in the test runner and make sure we call the right ghc and ghc-pkg executables.

@tibbe tibbe merged commit 3f72127 into haskell:master

Yeah, don't get me wrong, I'm grateful the env var exists at all :) but it would indeed be nice to retrieve the setup-config information.

I opened #1156 to keep track of that idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 17, 2012
  1. @bmillwood

    Fix build with GHC 6.12

    bmillwood committed
Showing with 2 additions and 5 deletions.
  1. +1 −1 Cabal/Cabal.cabal
  2. +1 −4 Cabal/Distribution/Simple/BuildTarget.hs
2 Cabal/Cabal.cabal
@@ -37,7 +37,7 @@ Library
filepath >= 1 && < 1.4,
directory >= 1 && < 1.3,
process >= 1 && < 1.2,
- time >= 1.4 && < 1.5,
+ time >= 1.1 && < 1.5,
containers >= 0.1 && < 0.6,
array >= 0.1 && < 0.5,
pretty >= 1 && < 1.2,
5 Cabal/Distribution/Simple/BuildTarget.hs
@@ -55,7 +55,6 @@ import Data.Maybe
import Data.Either
( partitionEithers )
import qualified Data.Map as Map
-import Data.Map (Map)
import Control.Monad
import qualified Distribution.Compat.ReadP as Parse
import Distribution.Compat.ReadP
@@ -884,7 +883,7 @@ matchExactly xs =
-- function, then we would get case insensitive matching (but it will still
-- report an exact match when the case matches too).
-matchInexactly :: forall a a' b. (Ord a, Ord a') =>
+matchInexactly :: (Ord a, Ord a') =>
(a -> a') ->
[(a, b)] -> (a -> Match b)
matchInexactly cannonicalise xs =
@@ -894,11 +893,9 @@ matchInexactly cannonicalise xs =
Just ys -> inexactMatches ys
Nothing -> matchZero
- m :: Ord a => Map a [b]
m = Map.fromListWith (++) [ (k,[x]) | (k,x) <- xs ]
-- the map of canonicalised keys to groups of inexact matches
- m' :: Ord a' => Map a' [b]
m' = Map.mapKeysWith (++) cannonicalise m
Something went wrong with that request. Please try again.