Make top-down solver more independent
Give the top-down solver it's own copy of `dependencyGraph`. This means that we now have three independent implementations of `dependencyGraph`: - `dependencyGraph` in `Cabal` takes a package index indexed by installed package IDs and only has access to library dependencies. - `dependencyGraph` in `Distribution.Client.PlanIndex` in `cabal-install` takes a package index indexed by installed package IDs and has access to all dependencies. - `dependencyGraph` in the top-down solver in `cabal-install` takes a package index indexed by package _names_, and has access to all dependencies. Ideally we would switch the top-down solver over to use a package indexed by installed package IDs, so that this duplication could be avoided, but that's a bit of work and the top-down solver is legacy code anyway. Can still do that later, of course. Moreover, this makes the top-down solver monomorphic where possible, and introduce its own SourceDeps class so that it is independent of the FixedDeps class (which we will change over to use InstalledPackageIds instead).
Showing
- cabal-install/Distribution/Client/Dependency/TopDown.hs 56 additions, 12 deletionscabal-install/Distribution/Client/Dependency/TopDown.hs
- cabal-install/Distribution/Client/Dependency/TopDown/Constraints.hs 6 additions, 8 deletions...all/Distribution/Client/Dependency/TopDown/Constraints.hs
- cabal-install/Distribution/Client/Dependency/TopDown/Types.hs 42 additions, 6 deletions...l-install/Distribution/Client/Dependency/TopDown/Types.hs
Loading
Please register or sign in to comment