[commit: ghc] wip/nfs-locking: Add userWays and make sure all user-specific settings are used. (a1dd39f)
git at git.haskell.org
git at git.haskell.org
Thu Oct 26 23:57:25 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/a1dd39f2b8f32948de4c219a866712dc2eb7884b/ghc
>---------------------------------------------------------------
commit a1dd39f2b8f32948de4c219a866712dc2eb7884b
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Sun Jun 14 15:17:20 2015 +0100
Add userWays and make sure all user-specific settings are used.
>---------------------------------------------------------------
a1dd39f2b8f32948de4c219a866712dc2eb7884b
src/Rules.hs | 2 +-
src/Settings.hs | 6 +++---
src/UserSettings.hs | 23 +++++++++++++++++++----
3 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/src/Rules.hs b/src/Rules.hs
index 227eef1..bb68b47 100644
--- a/src/Rules.hs
+++ b/src/Rules.hs
@@ -31,4 +31,4 @@ packageRules =
forM_ [Stage0, Stage1] $ \stage -> do
forM_ allPackages $ \pkg -> do
let env = defaultEnvironment { getStage = stage, getPackage = pkg }
- buildPackage env targetWays buildSettings
+ buildPackage env (targetWays <> userWays) (settings <> userSettings)
diff --git a/src/Settings.hs b/src/Settings.hs
index 539ed48..41b31ba 100644
--- a/src/Settings.hs
+++ b/src/Settings.hs
@@ -1,7 +1,7 @@
{-# LANGUAGE NoImplicitPrelude, FlexibleInstances #-}
module Settings (
- buildSettings
+ settings
) where
import Base hiding (arg, args, Args)
@@ -10,8 +10,8 @@ import Oracles.Builder
import Expression
import Expression.Settings
-buildSettings :: Settings
-buildSettings = do
+settings :: Settings
+settings = do
stage <- asks getStage
mconcat [ builder GhcCabal ? cabalSettings
, builder (GhcPkg stage) ? ghcPkgSettings ]
diff --git a/src/UserSettings.hs b/src/UserSettings.hs
index b785c7f..ccc03f5 100644
--- a/src/UserSettings.hs
+++ b/src/UserSettings.hs
@@ -1,20 +1,35 @@
module UserSettings (
- userSettings, userPackages
+ userSettings, userPackages, userWays
) where
import Base hiding (arg, args, Args)
import Oracles.Builder
+import Ways
import Targets
import Expression
import Expression.Settings
+-- No user-specific settings by default
userSettings :: Settings
-userSettings = mconcat
+userSettings = mempty
+
+userPackages :: Packages
+userPackages = mempty
+
+userWays :: Ways
+userWays = mempty
+
+-- Examples:
+userSettings' :: Settings
+userSettings' = mconcat
[ package compiler ? stage Stage0 ? append ["foo", "bar"]
, builder (Ghc Stage0) ? remove ["-O2"]
, builder GhcCabal ? removeSub "--configure-option=CFLAGS" ["-Werror"] ]
-userPackages :: Packages
-userPackages = mconcat
+userPackages' :: Packages
+userPackages' = mconcat
[ stage Stage1 ? remove [cabal]
, remove [compiler] ]
+
+userWays' :: Ways
+userWays' = remove [profiling]
More information about the ghc-commits
mailing list