Commit e08a1ea8 authored by Edward Z. Yang's avatar Edward Z. Yang Committed by GitHub
Browse files

Merge pull request #3645 from grayjay/unknown-package-message

Avoid filtering the solver log before 'showMessages'.
parents 12ca63dd f2d02983
...@@ -43,8 +43,8 @@ logToProgress mbj l = let ...@@ -43,8 +43,8 @@ logToProgress mbj l = let
proc :: Maybe Int -> Progress Message a b -> Progress Message (Maybe (ConflictSet QPN)) b proc :: Maybe Int -> Progress Message a b -> Progress Message (Maybe (ConflictSet QPN)) b
proc _ (Done x) = Done x proc _ (Done x) = Done x
proc _ (Fail _) = Fail Nothing proc _ (Fail _) = Fail Nothing
proc mbj' (Step (Failure cs Backjump) xs@(Step Leave (Step (Failure cs' Backjump) _))) proc mbj' (Step x@(Failure cs Backjump) xs@(Step Leave (Step (Failure cs' Backjump) _)))
| cs == cs' = proc mbj' xs -- repeated backjumps count as one | cs == cs' = Step x (proc mbj' xs) -- repeated backjumps count as one
proc (Just 0) (Step (Failure cs Backjump) _) = Fail (Just cs) proc (Just 0) (Step (Failure cs Backjump) _) = Fail (Just cs)
proc (Just n) (Step x@(Failure _ Backjump) xs) = Step x (proc (Just (n - 1)) xs) proc (Just n) (Step x@(Failure _ Backjump) xs) = Step x (proc (Just (n - 1)) xs)
proc mbj' (Step x xs) = Step x (proc mbj' xs) proc mbj' (Step x xs) = Step x (proc mbj' xs)
......
...@@ -43,6 +43,7 @@ tests = [ ...@@ -43,6 +43,7 @@ tests = [
, runTest $ indep $ mkTest db1 "multipleInstances" ["F", "G"] anySolverFailure , runTest $ indep $ mkTest db1 "multipleInstances" ["F", "G"] anySolverFailure
, runTest $ mkTest db21 "unknownPackage1" ["A"] (SolverSuccess [("A", 1), ("B", 1)]) , runTest $ mkTest db21 "unknownPackage1" ["A"] (SolverSuccess [("A", 1), ("B", 1)])
, runTest $ mkTest db22 "unknownPackage2" ["A"] (SolverFailure (isInfixOf "unknown package: C")) , runTest $ mkTest db22 "unknownPackage2" ["A"] (SolverFailure (isInfixOf "unknown package: C"))
, runTest $ mkTest db23 "unknownPackage3" ["A"] (SolverFailure (isInfixOf "unknown package: B"))
] ]
, testGroup "Flagged dependencies" [ , testGroup "Flagged dependencies" [
runTest $ mkTest db3 "forceFlagOn" ["C"] (SolverSuccess [("A", 1), ("B", 1), ("C", 1)]) runTest $ mkTest db3 "forceFlagOn" ["C"] (SolverSuccess [("A", 1), ("B", 1), ("C", 1)])
...@@ -798,6 +799,17 @@ db22 = [ ...@@ -798,6 +799,17 @@ db22 = [
, Right $ exAv "A" 2 [ExAny "C"] , Right $ exAv "A" 2 [ExAny "C"]
] ]
-- | Another test for the unknown package message. This database tests that
-- filtering out redundant conflict set messages in the solver log doesn't
-- interfere with generating a message about a missing package (part of issue
-- #3617). The conflict set for the missing package is {A, B}. That conflict set
-- is propagated up the tree to the level of A. Since the conflict set is the
-- same at both levels, the solver only keeps one of the backjumping messages.
db23 :: ExampleDb
db23 = [
Right $ exAv "A" 1 [ExAny "B"]
]
-- | Database for (unsuccessfully) trying to expose a bug in the handling -- | Database for (unsuccessfully) trying to expose a bug in the handling
-- of implied linking constraints. The question is whether an implied linking -- of implied linking constraints. The question is whether an implied linking
-- constraint should only have the introducing package in its conflict set, -- constraint should only have the introducing package in its conflict set,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment