`-ddump-hi-diffs` should report more useful information with flag changing
Motivation
I am trying to implement a GitHub Actions step that is expensive to build (90 minutes). When I use the standard cache
action, GHC sees the old files but recompiles everything due to [flags changed]
. I am not changing any flags between runs, so something is weird here. I want to understand what flags changed, so I pass -ddump-hi-diffs
. The resulting output is useless:
The code here only checks the hash: https://gitlab.haskell.org/ghc/ghc/-/blob/wip/fromListN/compiler/GHC/Iface/Recomp.hs?ref_type=heads#L356-367
I am completely unable to diagnose what flags actually changed!
Proposal
We should store the actual flags we're fingerprinting in the interface file, and fingerprintDynFlags
should return (Fingerprint, InterfaceDynFlags)
. When this case gets tripped, we should diffInterfaceDynFlags :: InterfaceDynFlags -> InterfaceDynFlags -> [String]
and render out exactly what changed.