Configure per package
I'm getting pretty close to being done making GHC multi-target. One consequence of this is that GHC itself won't depend on the vast majority of the
@vars@ from configure. Only src-determined things like
@LlvmVersion@, etc. are still needed project wide.
What I propose then is we strip down the "meta configure" to just substitute those src-determined variables with no dynamic checks, and push the vast majority of the configure checks into package-specific configure scripts rts, inter-gmp, and base. The
settings file does depend on a number of configure checks, but it can be an extra file installed by the
rts, which makes sense is it basically is saying how to produce Haskell which works with a given RTS.
This has a number of benefits:
Prevents regressions with multi-target: Compiler doesn't know about the target platform by construction, so it cannot be biased towards one or another.
Slightly more parallelism: we can immediately start building the compiler.
Better incremental builds: Changing configure results will no longer invalidate the stage 0 compiler build via
ghcautoconf.h. More broadly each package only sees the options it cares about, so smaller incremental benefits for the other libs.
One step closer to
cabal build ghcfor a stage 0 compiler. Running the meta-configure is trivial preprocessor step that also could be done in
./bootinstead of autoconf as follow up work. Then the only thing blocking the cabal-built compilers is code gen executables
genprimmops. But we have
build-tool-dependsalready to hack something up, and longer term I hope https://github.com/ghc-proposals/ghc-proposals/pull/243 means it can all become TH.
I'll try to avoid controversy by not including getting rid of autoconf in the above list :). My view is this split delivers most of the benefit of that, and right now
configure.ac is too big and monolithic to assess how much we depend on autoconf and where. With this change any renewed talk on purging autoconf will be a better evidence-based discussion.