Hadrian: introduce userDefaultFlavour, making default flavour overridable
authorAlp Mestanogullari <alp@well-typed.com>
Mon, 17 Dec 2018 06:15:45 +0000 (01:15 -0500)
committerBen Gamari <ben@smart-cactus.org>
Mon, 17 Dec 2018 06:15:46 +0000 (01:15 -0500)
commitc42eb2e67ae7f1e77c7bf365b7a41f808bc606cc
tree332ccf137bd7f67f7c9afc4db41969a46276c900
parent205762bd1b7c7bcd7fb041f19f56c9ec08f1cdcc
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
hadrian/doc/user-settings.md
hadrian/src/Settings.hs
hadrian/src/UserSettings.hs