@@ -528,35 +528,11 @@ fromSolverInstallPlan
528528 -> SolverInstallPlan
529529 -> GenericInstallPlan ipkg srcpkg
530530fromSolverInstallPlan f plan =
531- mkInstallPlan
532- " fromSolverInstallPlan"
533- (Graph. fromDistinctList pkgs'')
534- where
535- (_, _, pkgs'') =
536- foldl'
537- f'
538- (Map. empty, Map. empty, [] )
539- (SolverInstallPlan. reverseTopologicalOrder plan)
540-
541- f' (pidMap, ipiMap, pkgs) pkg = (pidMap', ipiMap', pkgs' ++ pkgs)
542- where
543- pkgs' = f (mapDep pidMap ipiMap) pkg
544-
545- (pidMap', ipiMap') =
546- case nodeKey pkg of
547- PreExistingId _ uid -> (pidMap, Map. insert uid pkgs' ipiMap)
548- PlannedId pid -> (Map. insert pid pkgs' pidMap, ipiMap)
549-
550- mapDep _ ipiMap (PreExistingId _pid uid)
551- | Just pkgs <- Map. lookup uid ipiMap = pkgs
552- | otherwise = error (" fromSolverInstallPlan: PreExistingId " ++ prettyShow uid)
553- mapDep pidMap _ (PlannedId pid)
554- | Just pkgs <- Map. lookup pid pidMap = pkgs
555- | otherwise = error (" fromSolverInstallPlan: PlannedId " ++ prettyShow pid)
556-
557- -- This shouldn't happen, since mapDep should only be called
558- -- on neighbor SolverId, which must have all been done already
559- -- by the reverse top-sort (we assume the graph is not broken).
531+ either (error . show ) id $
532+ runLogProgress' $
533+ fromSolverInstallPlanWithProgress
534+ (\ mapDep planpkg -> return $ f mapDep planpkg)
535+ plan
560536
561537fromSolverInstallPlanWithProgress
562538 :: (IsUnit ipkg , IsUnit srcpkg )
@@ -585,17 +561,18 @@ fromSolverInstallPlanWithProgress f plan = do
585561 PlannedId pid -> (Map. insert pid pkgs' pidMap, ipiMap)
586562 return (pidMap', ipiMap', pkgs' ++ pkgs)
587563
564+ -- The error below shouldn't happen, since mapDep should only
565+ -- be called on neighbor SolverId, which must have all been done
566+ -- already by the reverse top-sort (we assume the graph is not broken).
567+ --
568+ -- FIXME: stage is ignored
588569 mapDep _ ipiMap (PreExistingId _pid uid)
589570 | Just pkgs <- Map. lookup uid ipiMap = pkgs
590571 | otherwise = error (" fromSolverInstallPlan: PreExistingId " ++ prettyShow uid)
591572 mapDep pidMap _ (PlannedId pid)
592573 | Just pkgs <- Map. lookup pid pidMap = pkgs
593574 | otherwise = error (" fromSolverInstallPlan: PlannedId " ++ prettyShow pid)
594575
595- -- This shouldn't happen, since mapDep should only be called
596- -- on neighbor SolverId, which must have all been done already
597- -- by the reverse top-sort (we assume the graph is not broken).
598-
599576-- | Conversion of 'SolverInstallPlan' to 'InstallPlan'.
600577-- Similar to 'elaboratedInstallPlan'
601578configureInstallPlan :: Cabal. ConfigFlags -> SolverInstallPlan -> InstallPlan
0 commit comments