@@ -22,7 +22,7 @@ import Distribution.Compat.Graph
2222import Distribution.Compiler
2323 ( CompilerInfo )
2424import Distribution.Solver.Modular.Assignment
25- ( Assignment , toCPs )
25+ ( Assignment ( .. ) , toCPs )
2626import Distribution.Solver.Modular.ConfiguredConversion
2727 ( convCP )
2828import qualified Distribution.Solver.Modular.ConflictSet as CS
@@ -81,7 +81,12 @@ import Distribution.Verbosity ( normal, verbose )
8181-- solver. Performs the necessary translations before and after.
8282modularResolver :: SolverConfig -> DependencyResolver loc
8383modularResolver sc toolchains pkgConfigDbs iidx sidx pprefs pcs pns = do
84- uncurry postprocess <$> solve' sc cinfo pkgConfigDbs idx pprefs gcs pns
84+ (assignment, revdepmap) <- solve' sc cinfo pkgConfigDbs idx pprefs gcs pns
85+
86+ -- Results have to be converted into an install plan. 'convCP' removes
87+ -- package qualifiers, which means that linked packages become duplicates
88+ -- and can be removed.
89+ return $ ordNubBy nodeKey $ map (convCP iidx sidx) (toCPs assignment revdepmap)
8590 where
8691 cinfo = fst <$> toolchains
8792
@@ -92,12 +97,6 @@ modularResolver sc toolchains pkgConfigDbs iidx sidx pprefs pcs pns = do
9297 where
9398 pair lpc = (pcName $ unlabelPackageConstraint lpc, [lpc])
9499
95- -- Results have to be converted into an install plan. 'convCP' removes
96- -- package qualifiers, which means that linked packages become duplicates
97- -- and can be removed.
98- postprocess a rdm = ordNubBy nodeKey $
99- map (convCP iidx sidx) (toCPs a rdm)
100-
101100 -- Helper function to extract the PN from a constraint.
102101 pcName :: PackageConstraint -> PN
103102 pcName (PackageConstraint scope _) = scopeToPackageName scope
0 commit comments