Add -haddock to dynflags fingerprint
This MR adds -haddock
to the dynflags fingerprint, since -haddock
now causes the resulting .hi
files to include docstrings.
Also, while investigating recompilation avoidance in Haddock, I noticed that recompilation was happening even for immediately successive invocations of cabal haddock
. After investigating, I discovered that Cabal sets -stubdir
to a temporary output directory, which caused GHC to add that directory to the include paths. This results in different module flag signatures and thus recompilation.
For further recompilation avoidance, we could stop -stubdir
from adding a global include path to the IncludeSpec
, since it only did so to support the -fvia-c
flag which is no longer supported (?). This also results in (correct) recompilation avoidance in the scenario described above.