Allow building hadrian without QuickCheck-dependent selftest rules
Motivation
The hadrian executable depends on QuickCheck
for building, meaning this library (and its dependencies) will need to be built for bootstrapping GHC in the future. Building QuickCheck
and its dependencies does requires TemplateHaskell
, however, which can be problematic: E.g. when building a statically linking GHC toolchain, TemplateHaskell
can be tricky to get to work, and cross-compiling TemplateHaskell
doesn't work at all without -fexternal-interpreter
.
While these scenarios are maybe not super common to come up when bootstrapping GHC, it is an element of fragility we may want to avoid from a bootstrapping perspective (e.g. in nixpkgs master
, the bootstrap GHCs are (atm) unable to compile code using TemplateHaskell
). It also further solidifies the status quo that GHC can't be bootstrapped with anything but GHC.
As far as I can tell, hadrian only needs QuickCheck
for its selftest rules which are probably not necessary for just building GHC, so they are only necessary when working on GHC / hadrian itself.
Proposal
Add a Cabal flag to hadrian.cabal
that gates building Rules.Selftest
and the QuickCheck
dependency. It should default to false
and only be active when building hadrian within the GHC repository.