Will attempt to load all the parsed .cabal files for every package ever uploaded to hackage into RAM at once -- which requires an absurd about of RAM (multiple gigabytes). We should certainly be able to do much better than that. Keep in mind that cabal-install has to have access to the entire set of packages on hackage in order to do the dependency solving it does -- and it runs just fine! cabal-install works by never loading all the package database into RAM at once. It first creates a file ~/.cabal/packages/hackage.haskell.org/00-index.cache which contains a bunch of lines like:
pkg: detrospector 0.1 b# 2
pkg: detrospector 0.2 b# 7
pkg: helisp 0.1 b# 13
pkg: hscurses-fish-ex 1.3.0 b# 17
pkg: hscurses-fish-ex 1.3.1 b# 20
pkg: unpack-funcs 0.1.2 b# 23
pkg: unpack-funcs 0.1.0 b# 27
pkg: unpack-funcs 0.2.0 b# 31
pkg: unpack-funcs 0.1.1 b# 35
pkg: unpack-funcs 0.3.0 b# 39
pkg: MemoTrie 0.4.8 b# 43
This is basically a list of available package names, versions, and the offset into the 00-index.tar where the rest of the package information can be found. I assume that when solving dependencies it then loads the .cabal files it needs on demand -- and probably only the relevant information from those .cabal files (aka, not the package descriptions, which are large and of type String).
I think we can use a similar trick for scoutess. VersionInfo should only contain the essential information that we need such as the package name, the version number, its SourceLocation, and instead of a parsed package description, it should just contain the path to the .cabal file on the disk. (Unlike cabal-install, we currently unpack the .tar file, making it easier to access the individual files).
This seems like an easy modification for someone to make, and should make scoutess far faster and more useable.
- jeremy