summaryrefslogtreecommitdiff
path: root/hadrian/hadrian.cabal
diff options
context:
space:
mode:
authorAlp Mestanogullari <alpmestan@gmail.com>2019-06-24 20:43:49 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-07-09 22:57:31 -0400
commit18ac9ad404f490bd7ea0639a1b85a88ed4502613 (patch)
treeb623b43f77709e148a83cef6f5b3be192ce15640 /hadrian/hadrian.cabal
parent42ff8653bd5ce7f00af5783f2973393ebfcd7cc7 (diff)
downloadhaskell-18ac9ad404f490bd7ea0639a1b85a88ed4502613.tar.gz
Hadrian: implement key-value settings for builder options
They take the general form `foo.bar.baz [+]= some values`, where `=` completely overrides the arguments for a builder and `+=` extends them. We currenly only support settings for updating the GHC and C compiler options, of the form: ``` {stage0, ..., stage3 or *}.{package name or *} .ghc.{c, hs, link, deps, toolargs or *}.opts {stage0, ..., stage3 or *}.{package name or *} .cc.{c, deps or *}.opts ``` The supported settings and their use is covered in the new section of `hadrian/doc/user-settings.md`, while the implementation is explained in a new Note [Hadrian settings]. Most of the logic is implemented in a new module, `Settings.Parser`, which contains key-value assignment/extension parsers as well as utilities for specifying allowed settings at a high-level, generating a `Predicate` from such a description or generating the list of possible completions for a given string. The additions to the `Settings` module make use of this to describe the settings that Hadrian currently supports, and apply all such key-value settings (from the command line and `<root>/hadrian.settings`) to the flavour that Hadrian is going to proceed with. This new setting system comes with support for generating Bash completions, implemented in `hadrian/completion.sh` and Hadrian's `autocomplete` target: > source hadrian/completion.sh > hadrian/build.sh stage1.base.ghc.<TAB> stage1.base.ghc.c.opts stage1.base.ghc.hs.opts stage1.base.ghc.*.opts stage1.base.ghc.deps.opts stage1.base.ghc.link.opts stage1.base.ghc.toolargs.opts
Diffstat (limited to 'hadrian/hadrian.cabal')
-rw-r--r--hadrian/hadrian.cabal1
1 files changed, 1 insertions, 0 deletions
diff --git a/hadrian/hadrian.cabal b/hadrian/hadrian.cabal
index 1e7287cb92..2c5781f196 100644
--- a/hadrian/hadrian.cabal
+++ b/hadrian/hadrian.cabal
@@ -101,6 +101,7 @@ executable hadrian
, Settings.Flavours.Quickest
, Settings.Flavours.GhcInGhci
, Settings.Packages
+ , Settings.Parser
, Settings.Warnings
, Stage
, Target