Commit 21be7d9d authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Fix the InstallPlan Processing invariant

Previously it required:
  noIntersection processingClosure failedSet

Lets see what it's saying and why it's wrong. Suppose we have P1 and P2
in the processing set. We have Q that depends on P1 and P2. So the
processingClosure is {P1,P2,Q}. Now suppose building P1 fails. The
failedSet is now {P1,Q1}, and the processingSet is {P2}. The
processingClosure however is {P2,Q}. Thus we have a non-empty
intersection between the processingClosure and failedSet, namely {Q}.

So clearly it's bogus, but also it's not clear if I was thinking of
something else that is correct. So we just drop this part of the
invariant.

This should fix issue #3889.
parent 3b6585ad
......@@ -596,9 +596,9 @@ processingInvariant plan (Processing processingSet completedSet failedSet) =
&& all (isJust . flip Graph.lookup (planIndex plan)) (Set.toList failedSet)
&& noIntersection processingSet completedSet
&& noIntersection processingSet failedSet
-- intersection processingClosure failedSet is quite possible however
&& noIntersection failedSet completedSet
&& noIntersection processingClosure completedSet
&& noIntersection processingClosure failedSet
&& and [ case Graph.lookup pkgid (planIndex plan) of
Just (Configured _) -> True
Just (PreExisting _) -> False
......
Markdown is supported
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