Commit 15dd8455 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Prevent nodeNeighbors from returning a node multiple times

This causes strange output when we output the install plan.
Thanks @hvr

 for reporting.
Signed-off-by: default avatarEdward Z. Yang <>
parent 56bb80b3
......@@ -67,6 +67,7 @@ import qualified Distribution.Solver.Types.ComponentDeps as CD
import Distribution.Solver.Types.ComponentDeps (ComponentDeps)
import Distribution.Solver.Types.OptionalStanza
import Distribution.Compat.Graph (IsNode(..))
import Distribution.Simple.Utils (ordNub)
import Data.Map (Map)
import Data.Set (Set)
......@@ -401,8 +402,12 @@ instance HasConfiguredId ElaboratedPackage where
instance IsNode ElaboratedPackage where
type Key ElaboratedPackage = UnitId
nodeKey = installedUnitId
nodeNeighbors pkg = map (SimpleUnitId . confInstId) (CD.flatDeps (pkgDependencies pkg))
++ map SimpleUnitId (CD.flatDeps (pkgExeDependencies pkg))
nodeNeighbors pkg =
-- Important not to have duplicates: otherwise InstallPlan gets
-- confused
ordNub $
map (SimpleUnitId . confInstId) (CD.flatDeps (pkgDependencies pkg))
++ map SimpleUnitId (CD.flatDeps (pkgExeDependencies pkg))
-- | This is used in the install plan to indicate how the package will be
-- built.
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