Can stubdir be omitted from the include paths? (Haddock recompilation avoidance)
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 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.