Hadrian: Fix untracked dependencies
This commit mostly focuses on getting rid of untracked dependencies,
which prevent Shake's new
--shared feature from appropriately caching
There are three different solutions to untracked dependencies:
Track them! This is the obvious and the best approach, but in some situations we cannot use it, for example, because a build rule creates files whose names are not known statically and hence cannot be specified as the rule's outputs.
producesto record outputs dynamically, within the rule.
historyDisableto disable caching for a particular build rule. We currently use this approach only for
ghc-pkgwhich mutates the package database and the file
These two tickets are fixed as the result:
#16271 (closed): https://ghc.haskell.org/trac/ghc/ticket/16271 #16272 (closed): https://ghc.haskell.org/trac/ghc/ticket/16272 (this one is fixed only partially: we correctly record the dependency, but we still copy files into the RTS build tree).