I should use Shake, so I get more features, robust incremental rebuilds etc. Notes:
For the dependencies, I should have a cache of package -> ([String], [Package]) being the packages it depends on, and a list of items (type, instance, etc) that are required for the dependencies. Then I should recreate an in-memory database for each set of dependencies, and do the recursive tying inside each rule.
For downloads, I should have stamp files, and --redownload deletes the stamps forcing fresh downloads.
I now use Shake, which made it trivial to add parallelism and predicted progress. It could still do with using more Shake features, e.g. better dependencies, but it's just refactoring from here onwards.
I should use Shake, so I get more features, robust incremental rebuilds etc. Notes:
--redownload
deletes the stamps forcing fresh downloads.