Commit 99db786d authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Deduplicate nodeNeighbors in legacy codepath.

Prevents us from trying to build a package multiple times,
when we should only build it once.

This is basically 15dd8455

 all
over again, but for the legacy codepath.

Fixes #3721.

CC @tuncer

Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent e73a36bc
......@@ -40,6 +40,7 @@ import Distribution.Solver.Types.OptionalStanza
import Distribution.Solver.Types.PackageFixedDeps
import Distribution.Solver.Types.SourcePackage
import Distribution.Compat.Graph (IsNode(..))
import Distribution.Simple.Utils (ordNub)
import Data.Map (Map)
import Network.URI (URI(..), URIAuth(..), nullURI)
......@@ -118,8 +119,9 @@ instance IsNode (ConfiguredPackage loc) where
type Key (ConfiguredPackage loc) = UnitId
nodeKey = SimpleUnitId . confPkgId
-- TODO: if we update ConfiguredPackage to support order-only
-- dependencies, need to include those here
nodeNeighbors = CD.flatDeps . depends
-- dependencies, need to include those here.
-- NB: have to deduplicate, otherwise the planner gets confused
nodeNeighbors = ordNub . CD.flatDeps . depends
instance (Binary loc) => Binary (ConfiguredPackage loc)
......
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