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/src/Settings.hs | |
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/src/Settings.hs')
-rwxr-xr-x | hadrian/src/Settings.hs | 4 |
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 |