[commit: Cabal] master: Ignore self-dependencies (of executables on libraries). (5a61181)
Ian Lynagh
igloo at earth.li
Fri Nov 4 18:06:04 CET 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/5a611815a8f7681918a2b3cd84e5143f45f6caaf
>---------------------------------------------------------------
commit 5a611815a8f7681918a2b3cd84e5143f45f6caaf
Author: Andres Loeh <andres at well-typed.com>
Date: Mon Jun 20 07:31:04 2011 +0000
Ignore self-dependencies (of executables on libraries).
>---------------------------------------------------------------
.../Client/Dependency/Modular/Builder.hs | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Builder.hs b/cabal-install/Distribution/Client/Dependency/Modular/Builder.hs
index fb32339..97605cd 100644
--- a/cabal-install/Distribution/Client/Dependency/Modular/Builder.hs
+++ b/cabal-install/Distribution/Client/Dependency/Modular/Builder.hs
@@ -34,6 +34,8 @@ extendOpen qpn' gs s@(BS { goals = gs', open = o' }) = go gs' o' gs
go g o [] = s { goals = g, open = o }
go g o (ng@(Goal (Flagged _ _ _ _) _gr) : ngs) = go g (cons ng () o) ngs
go g o (ng@(Goal (Simple (Dep qpn _)) _gr) : ngs)
+ | qpn == qpn' = go g o ngs
+ -- we ignore self-dependencies at this point; TODO: more care may be needed
| qpn `M.member` g = go (M.adjust (qpn':) qpn g) o ngs
| otherwise = go (M.insert qpn [qpn'] g) (cons ng () o) ngs
-- code above is correct; insert/adjust have different arg order
More information about the Cvs-libraries
mailing list