Hadrian: Add support for building stage3
authorMatthew Pickering <matthewtpickering@gmail.com>
Sun, 16 Dec 2018 08:58:41 +0000 (08:58 +0000)
committerMatthew Pickering <matthewtpickering@gmail.com>
Wed, 9 Jan 2019 14:32:21 +0000 (14:32 +0000)
commit6486c6e49c53e75f37ed732b38c5be7ae64785e8
tree187785dd532474cd34aa4e66846b12f28f09f8b9
parent6b70cf611e5ddc475edaa54b893d20990699ddb8
Hadrian: Add support for building stage3

This ticket enables the building of a `stage3` compiler by making the
build logic more consistent and predictable in Hadrian.

Two of the main changes are:

1. In order to build anything at stageN we use the package database
present at stageN. Fixing #16069
2. `haddock` and `ghc-tags` are built
as stage1 executables (with the stage1 compiler) rather than as
stage2 compiler. Fixing
[hadrian#661](https://github.com/snowleopard/hadrian/issues/661)

In order to build a stage3 compiler, you have to set the new `finalStage` hadrian option to `Stage3`.
19 files changed:
hadrian/README.md
hadrian/cfg/system.config.in
hadrian/doc/cross-compile.md
hadrian/doc/user-settings.md
hadrian/src/Base.hs
hadrian/src/Builder.hs
hadrian/src/Context.hs
hadrian/src/Packages.hs
hadrian/src/Rules.hs
hadrian/src/Rules/BinaryDist.hs
hadrian/src/Rules/Generate.hs
hadrian/src/Rules/Libffi.hs
hadrian/src/Rules/Program.hs
hadrian/src/Settings/Builders/Common.hs
hadrian/src/Settings/Builders/Configure.hs
hadrian/src/Settings/Builders/Make.hs
hadrian/src/Settings/Default.hs
hadrian/src/UserSettings.hs
hadrian/src/Utilities.hs