on master help sign in
Work around extensible-exceptions with GHC 7.6 (#57)
7d5696fMichael Snoyman
Stackage/CheckPlan.hs+14−1
@@ -30,7 +30,7 @@ checkPlan bp = do
30 exitWith ec
30 exitWith ec
31 let dryRun = sort $ filter notOptionalCore $ map (takeWhile (/= ' ')) $ drop 2 $ lines dryRun'
31 let dryRun = sort $ filter notOptionalCore $ map (takeWhile (/= ' ')) $ drop 2 $ lines dryRun'
32 let mismatches = getMismatches dryRun (filter notOptionalCore $ bpPackageList bp)
32 let mismatches = getMismatches dryRun (filter notOptionalCore $ bpPackageList bp)
33− unless (null mismatches) $ do
33+ unless (null $ filter (not . acceptableMismatch) mismatches) $ do
34 putStrLn "Found the following mismatches"
34 putStrLn "Found the following mismatches"
35 mapM_ print mismatches
35 mapM_ print mismatches
36 exitWith $ ExitFailure 1
36 exitWith $ ExitFailure 1
@@ -50,3 +50,16 @@ getMismatches =
50 EQ -> go xs ys
50 EQ -> go xs ys
51 LT -> OnlyDryRun x : go xs (y:ys)
51 LT -> OnlyDryRun x : go xs (y:ys)
52 GT -> OnlySimpleList y : go (x:xs) ys
52 GT -> OnlySimpleList y : go (x:xs) ys
53+
54+-- | Some mismatches are going to be acceptable. The reasons are described
55+-- below.
56+acceptableMismatch :: Mismatch -> Bool
57+acceptableMismatch m =
58+ case m of
59+ -- GHC 7.4 included extensible-extensions as a core package, and
60+ -- therefore the HP at time of writing (2012.4.0.0) includes it in that
61+ -- list. However, GHC 7.6 does /not/ include that package. As a result,
62+ -- we get that package included in the dry run but not our list of
63+ -- packages to build. See issue #57.
64+ OnlyDryRun s | "extensible-exceptions-" `isPrefixOf` s -> True
65+ _ -> False