@@ -89,6 +89,8 @@ import Distribution.Solver.Types.SolverId
89
89
import Distribution.Solver.Types.InstSolverPackage
90
90
91
91
import Distribution.Utils.LogProgress
92
+ import Distribution.Client.Utils.Assertion
93
+ import Distribution.Compat.Stack
92
94
93
95
-- TODO: Need this when we compute final UnitIds
94
96
-- import qualified Distribution.Simple.Configure as Configure
@@ -102,6 +104,7 @@ import Distribution.Pretty
102
104
import qualified Distribution.Compat.Graph as Graph
103
105
import Distribution.Compat.Graph (Graph , IsNode (.. ))
104
106
import Distribution.Compat.Binary (Binary (.. ))
107
+ import Distribution.Utils.Generic
105
108
import GHC.Generics
106
109
import Data.Typeable
107
110
import Control.Monad
@@ -629,19 +632,26 @@ isInstalled _ = False
629
632
-- process), along with the updated 'Processing' state.
630
633
--
631
634
completed :: (IsUnit ipkg , IsUnit srcpkg )
632
- => GenericInstallPlan ipkg srcpkg
635
+ => WithCallStack ( GenericInstallPlan ipkg srcpkg
633
636
-> Processing -> UnitId
634
- -> ([GenericReadyPackage srcpkg ], Processing )
637
+ -> ([GenericReadyPackage srcpkg ], Processing ))
635
638
completed plan (Processing processingSet completedSet failedSet) pkgid =
636
- assert (pkgid `Set.member` processingSet) $
639
+ pprAssert (pkgid `Set.member` processingSet)
640
+ (text " Completed" <+> pretty pkgid <+> text " was not member of processing set:" $$
641
+ pretty (Set. toList processingSet) $$
642
+ text " Already completed:" <+> pretty (Set. toList completedSet) $$
643
+ text " Failed:" <+> pretty (Set. toList failedSet)) $
637
644
assert (processingInvariant plan processing') $
645
+ pprAssert (length (ordNub newlyReadyKeys) == length newlyReadyKeys)
646
+ (text " Duplicate entry in newly-ready tasks:" <+> pretty newlyReadyKeys) $
638
647
639
648
( map asReadyPackage newlyReady
640
649
, processing' )
641
650
where
642
651
completedSet' = Set. insert pkgid completedSet
643
652
644
653
-- each direct reverse dep where all direct deps are completed
654
+ newlyReadyKeys = map nodeKey newlyReady
645
655
newlyReady = [ dep
646
656
| dep <- revDirectDeps plan pkgid
647
657
, all ((`Set.member` completedSet') . nodeKey)
0 commit comments