on master help sign in
Work around extensible-exceptions with GHC 7.6 (#57)
commit7d5696ffd9ee4fe1ad1f078662c006d20b8d962a authorMichael Snoyman <michael@snoyman.com> dateTue 9 Apr 2013, 07:44 (14 years ago) parentddbb4c9
1 file changed+14−1
Stackage/CheckPlan.hs+14−1
Stackage/CheckPlan.hs+14−1
@@ -30,7 +30,7 @@ checkPlan bp = do
3030 exitWith ec
3131 let dryRun = sort $ filter notOptionalCore $ map (takeWhile (/= ' ')) $ drop 2 $ lines dryRun'
3232 let mismatches = getMismatches dryRun (filter notOptionalCore $ bpPackageList bp)
33− unless (null mismatches) $ do
33+ unless (null $ filter (not . acceptableMismatch) mismatches) $ do
3434 putStrLn "Found the following mismatches"
3535 mapM_ print mismatches
3636 exitWith $ ExitFailure 1
@@ -50,3 +50,16 @@ getMismatches =
5050 EQ -> go xs ys
5151 LT -> OnlyDryRun x : go xs (y:ys)
5252 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