Making compilation results deterministic (#4012)

Malcolm Wallace malcolm.wallace at me.com
Wed Sep 16 09:53:04 UTC 2015


On 16 Sep 2015, at 10:43, Simon Peyton Jones wrote:

> I’ll hypothesise that you mean
> ·         In –make mode, with unchanged source I want to get the same output from compiling M.hs if M’s imported interface files have not changed.
> But even then I’m confused.  Under those circumstances, why are we recompiling at all?

My understanding is that currently, if you build a Haskell project from clean sources with ghc --make, then wipe all the .o/.hi files, and rebuild again from clean, with all the same flags and environment, you are unlikely to end up with identical binaries for either the .o or .hi files.  This lack of binary reproducibility is a performance problem within a larger build system (of which the Haskell components are only a part): if the larger build system sees that the Haskell .hi or .o has apparently changed (even though the sources+flags have not changed at all), then many other components that depend on them may be triggered for an unnecessary rebuild.

Regards,
    Malcolm


More information about the ghc-devs mailing list