Given a set of cabal packages, is there a way to automatically calculate subset of independent packages? In other words, subset of packages that will be sufficient to install them all.
For [network,parsec]
the answer is [network]
because it network
depends on parsec
.
For [network,containers]
the answer is [network,containers]
because:
network
does not depend oncontainers
- all
network
s dependencies not depends oncontainers
containers
does not depend onnetwork
- all
containers
s dependencies not depends onnetwork
It's not hard to find the answer for 2 packages. What is really interesting is to find out independent set for [containers, directory, filepath, lens, xml, http-conduit, regex-posix, monad-control, unordered-containers, glib, hashable, hspec, split, aeson, attoparsec, stm, QuickCheck]
.
From answer I expect some function based on cabal library like ∷ [Packages] → IO [Packages]
.
Distribution.Client.PackageIndex.dependencyClosure
is what you need. – Mikhail GlushenkovDistribution.Simple.PackageIndex.dependencyClosure
? – ДМИТРИЙ МАЛИКОВDistribution.Client.*
) is also a library now. – Mikhail Glushenkovcabal-sort --parallel
will display independently buildable groups of packages (which isn't quite what you want, but related ;) – Conrad Parker