Hadrian flavours should be more compositional
Currently Hadrian's notion of a flavour is a very rudimentary: flavours have names and fully define a build configuration. As a consequence, we have reproduced an unfortunate characteristic of the make build system: an exponential explosion of flavours.
However, in the Flavour module we have grown a number of "flavour transformers" which modify flavours in various ways:
-
enableDebugInfoenables native debug information in the boot libraries and GHC -
werrorenables-Werrorin the stage2 build -
enableTickyGhcbuilds GHC with Ticky-Ticky support -
splitSectionsenables section splitting -
enableThreadSanitizerenables TSAN in the stage2 build and GHC executable
In principle this is great: you can take a simple base flavour and compositionally add features to it with these combinators. However, we currently provide no way to do so from the command-line. You rather need to edit UserSettings.hs, defining your own flavour in Haskell (using these combinators).
I propose that we extend the syntax accepted by the --flavour command-line flag to allow specification of "transformers", in addition to a base flavour. For instance, one might write:
hadrian/build-cabal --flavour=perf+werror+tickyGhc
which would be equivalent to defining a flavour werror $ enableTickyGhc performance. This would be easy to implement and allow us to eliminate all of the LLVM flavours currently defined in the Hadrian tree (turning them into a single flavour transformer).