summaryrefslogtreecommitdiff
path: root/hadrian/src/Settings.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/Settings.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/Settings.hs')
-rwxr-xr-xhadrian/src/Settings.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/hadrian/src/Settings.hs b/hadrian/src/Settings.hs
index 3497f43a1e..99a58db71f 100755
--- a/hadrian/src/Settings.hs
+++ b/hadrian/src/Settings.hs
@@ -8,7 +8,7 @@ import CommandLine
import Expression
import Flavour
import Packages
-import UserSettings
+import UserSettings (userFlavours, userPackages, userDefaultFlavour)
import {-# SOURCE #-} Settings.Default
import Settings.Flavours.Development
@@ -40,7 +40,7 @@ hadrianFlavours =
flavour :: Action Flavour
flavour = do
- flavourName <- fromMaybe "default" <$> cmdFlavour
+ flavourName <- fromMaybe userDefaultFlavour <$> cmdFlavour
let unknownFlavour = error $ "Unknown build flavour: " ++ flavourName
flavours = hadrianFlavours ++ userFlavours
return $ fromMaybe unknownFlavour $ find ((== flavourName) . name) flavours