Skip to content

Commit 143218e

Browse files
committed
Fix cabal-install showing up multiple times, thanks @hvr for reporting.
Signed-off-by: Edward Z. Yang <[email protected]>
1 parent 6d0cd9c commit 143218e

File tree

1 file changed

+7
-2
lines changed
  • cabal-install/Distribution/Client/ProjectPlanning

1 file changed

+7
-2
lines changed

cabal-install/Distribution/Client/ProjectPlanning/Types.hs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ import qualified Distribution.Solver.Types.ComponentDeps as CD
6969
import Distribution.Solver.Types.ComponentDeps (ComponentDeps)
7070
import Distribution.Solver.Types.OptionalStanza
7171
import Distribution.Compat.Graph (IsNode(..))
72+
import Distribution.Simple.Utils (ordNub)
7273

7374
import Data.Map (Map)
7475
import Data.Set (Set)
@@ -407,8 +408,12 @@ instance HasConfiguredId ElaboratedPackage where
407408
instance IsNode ElaboratedPackage where
408409
type Key ElaboratedPackage = UnitId
409410
nodeKey = installedUnitId
410-
nodeNeighbors pkg = map (SimpleUnitId . confInstId) (CD.flatDeps (pkgDependencies pkg))
411-
++ map SimpleUnitId (CD.flatDeps (pkgExeDependencies pkg))
411+
nodeNeighbors pkg =
412+
-- Important not to have duplicates: otherwise InstallPlan gets
413+
-- confused
414+
ordNub $
415+
map (SimpleUnitId . confInstId) (CD.flatDeps (pkgDependencies pkg))
416+
++ map SimpleUnitId (CD.flatDeps (pkgExeDependencies pkg))
412417

413418
-- | This is used in the install plan to indicate how the package will be
414419
-- built.

0 commit comments

Comments
 (0)