diff options
author | Alp Mestanogullari <alp@well-typed.com> | 2018-12-17 01:15:45 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-12-17 01:15:46 -0500 |
commit | c42eb2e67ae7f1e77c7bf365b7a41f808bc606cc (patch) | |
tree | 332ccf137bd7f67f7c9afc4db41969a46276c900 /hadrian/doc | |
parent | 205762bd1b7c7bcd7fb041f19f56c9ec08f1cdcc (diff) | |
download | haskell-c42eb2e67ae7f1e77c7bf365b7a41f808bc606cc.tar.gz |
Hadrian: introduce userDefaultFlavour, making default flavour overridable
This patch introduces the `userDefaultFlavour` user setting. It should
be the name of the default flavour to use when no --flavour argument is
passed. Before this patch, we would just always default to... the
`default` flavour. With this patch, we default to whatever Flavour whose
name is `userDefaultFlavour`, therefore providing a way for users to
"persist" their choice of flavour, not having to repeat --flavour=[...]
in every hadrian command.
Test Plan:
Set `userDefaultFlavour = "quickest"`, run `hadrian/build.sh`, check
that the quickest flavour is indeed picked.
Reviewers: snowleopard, bgamari
Reviewed By: snowleopard
Subscribers: mpickering, rwbarton, carter
GHC Trac Issues: #15890
Differential Revision: https://phabricator.haskell.org/D5454
Diffstat (limited to 'hadrian/doc')
-rw-r--r-- | hadrian/doc/user-settings.md | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/hadrian/doc/user-settings.md b/hadrian/doc/user-settings.md index b81c0dc582..0c6d4ba3cd 100644 --- a/hadrian/doc/user-settings.md +++ b/hadrian/doc/user-settings.md @@ -34,7 +34,7 @@ data Flavour = Flavour { -- | Build GHC with debug information. ghcDebugged :: Bool } ``` -Hadrian provides several built-in flavours (`defaultFlavour`, `quickFlavour`, and a few +Hadrian provides several built-in flavours (`default`, `quick`, and a few others; see `hadrian/doc/flavours.md`), which can be activated from the command line, e.g. by passing `--flavour=quick`. Users can define new build flavours by adding them to `userFlavours` list: @@ -48,7 +48,24 @@ userFlavours = [userFlavour] -- Add more build flavours if need be. userFlavour :: Flavour userFlavour = defaultFlavour { name = "user" } -- Modify other settings here. ``` -Now `--flavour=user` will run Hadrian with `userFlavour` settings. In the +Now `--flavour=user` will run Hadrian with `userFlavour` settings. + +When no `--flavour` argument is passed to hadrian, it will use the +`default` one. You can however change this, and for example make +the "fallback" flavour be `user`, by changing `userDefaultFlavour`: + +``` haskell +userDefaultFlavour :: String +-- before: +-- userDefaultFlavour = "default" +-- now: +userDefaultFlavour = "user" +``` + +This saves you from having to type `build --flavour=user [...]` +every time, allowing you to _persist_ the choice of flavour. + +In the following sections we look at specific fields of the `Flavour` record in more detail. Note: `defaultFlavour`, as well as its individual fields such as `defaultArgs`, `defaultPackages`, etc. that we use below, are defined in module |