Compilation results [interface files] are not deterministic
[Editor's note: this ticket focused primarily on interface files. For deterministic object files, see #12935.]
There are some issues with non-determinism in the output of GHC, which means that compilations are not repeatable. This affects some users (e.g. Debian packagers) who need to be able to get repeatable hashes for the packages of a GHC build.
The cases we know about that lead to non-deterministic results are:
spec_ids(specialised Ids) attached to an Id have a non-deterministic ordering
- CSE can give different results depending on the order in which the bindings are considered, and since the ordering is non-deterministic, the result of CSE is also non-deterministic. e.g. in
x = z; y = z; z = 3, where
xare exported, we can end up with either
x = y; y = 3or
y = x; x = 3.
- There seems to be something unpredictable about the order of arguments to SpecConstr-generated specialisations, see http://www.haskell.org/pipermail/glasgow-haskell-users/2011-April/020287.html
- The wrappers generated by the
CApiFFIextension have non-deterministic names. (see ticket:4012#comment:59594 below).
- See ticket:4012#comment:98753 for another, different, example
Old ticket description follows
Short story: if you use ghc-220.127.116.1100318 (or similar, probably ghc-6.12.1 release will produce the same results) to bootstrap ghc-6.12, and then use that ghc-6.12 to bootstrap another ghc-6.12, those two instances of ghc-6.12 will have different ABI hashes and interfaces in the ghc package. If you use ghc-6.10 for the bootstrapping, you'll even get differences in the ghc, base and Cabal packages.
Long story: see logfiles and descriptions at http://darcs.volkswurst.de/boot-tests/ (note that the logfiles are quite large, I really don't want to attach 150 MB of logs to this ticket).