hadrian: Rebuild with -B[PATTERNS] runs extra rules
Summary
While using the -B[PATTERN]
/--rebuild[=PATTERN]
flag with Hadrian, it's not just rules matching the pattern that are rerun, but seemingly all the rules leading up to it too. The Hadrian documentation says that -B[PATTERN]
will "Rebuild matching files", so I wouldn't expect it to also rebuild these extra files. Most of these rules run GHC commands that just output compilation IS NOT required
.
Steps to reproduce
Build using a particular flavour and flags.
hadrian/build.stack.sh -c -j --flavour=quickest
Rebuild with everything the same, with an added -B [some target]
, eg:
hadrian/build.stack.sh -c -j --flavour=quickest -B _build/stage0/compiler/build/HsInstances.o
Expected behavior
The rebuild will rerun many unnecessary rules, but will likely complete faster since no actual compilation will be done for most of them.
Environment
- GHC version used: 8.6.5 with Stack