summaryrefslogtreecommitdiff
path: root/hadrian/src/UserSettings.hs
diff options
context:
space:
mode:
authorAlp Mestanogullari <alp@well-typed.com>2018-12-17 01:15:45 -0500
committerBen Gamari <ben@smart-cactus.org>2018-12-17 01:15:46 -0500
commitc42eb2e67ae7f1e77c7bf365b7a41f808bc606cc (patch)
tree332ccf137bd7f67f7c9afc4db41969a46276c900 /hadrian/src/UserSettings.hs
parent205762bd1b7c7bcd7fb041f19f56c9ec08f1cdcc (diff)
downloadhaskell-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/src/UserSettings.hs')
-rw-r--r--hadrian/src/UserSettings.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/hadrian/src/UserSettings.hs b/hadrian/src/UserSettings.hs
index 9246806991..e029dadda7 100644
--- a/hadrian/src/UserSettings.hs
+++ b/hadrian/src/UserSettings.hs
@@ -3,8 +3,8 @@
-- If you don't copy the file your changes will be tracked by git and you can
-- accidentally commit them.
module UserSettings (
- userFlavours, userPackages, verboseCommand, buildProgressColour,
- successColour, stage1Only
+ userFlavours, userPackages, userDefaultFlavour,
+ verboseCommand, buildProgressColour, successColour, stage1Only
) where
import Flavour
@@ -14,6 +14,11 @@ import {-# SOURCE #-} Settings.Default
-- See doc/user-settings.md for instructions.
-- Please update doc/user-settings.md when committing changes to this file.
+-- | Name of the default flavour, i.e the one used when no --flavour=<name>
+-- argument is passed to Hadrian.
+userDefaultFlavour :: String
+userDefaultFlavour = "default"
+
-- | User-defined build flavours. See 'userFlavour' as an example.
userFlavours :: [Flavour]
userFlavours = [userFlavour] -- Add more build flavours if need be.