[commit: ghc] wip/nfs-locking: Add development flavours (d6e7919)
git at git.haskell.org
git at git.haskell.org
Fri Oct 27 00:48:06 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/d6e7919a7d67462ee29a3019f46d6e7899bb4c50/ghc
>---------------------------------------------------------------
commit d6e7919a7d67462ee29a3019f46d6e7899bb4c50
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Mon Jan 9 01:24:57 2017 +0000
Add development flavours
See #188, #268
>---------------------------------------------------------------
d6e7919a7d67462ee29a3019f46d6e7899bb4c50
hadrian.cabal | 1 +
src/CmdLineFlag.hs | 4 ++--
src/Settings.hs | 6 ++++--
src/Settings/Builders/Ghc.hs | 3 ---
src/Settings/Default.hs | 5 ++++-
src/Settings/Flavours/Development.hs | 26 ++++++++++++++++++++++++++
6 files changed, 37 insertions(+), 8 deletions(-)
diff --git a/hadrian.cabal b/hadrian.cabal
index 712d4c6..598bd27 100644
--- a/hadrian.cabal
+++ b/hadrian.cabal
@@ -85,6 +85,7 @@ executable hadrian
, Settings.Builders.Make
, Settings.Builders.Tar
, Settings.Default
+ , Settings.Flavours.Development
, Settings.Flavours.Perf
, Settings.Flavours.Prof
, Settings.Flavours.Quick
diff --git a/src/CmdLineFlag.hs b/src/CmdLineFlag.hs
index b58df7b..ebe907a 100644
--- a/src/CmdLineFlag.hs
+++ b/src/CmdLineFlag.hs
@@ -38,7 +38,7 @@ readBuildHaddock :: Either String (Untracked -> Untracked)
readBuildHaddock = Right $ \flags -> flags { buildHaddock = True }
readFlavour :: Maybe String -> Either String (Untracked -> Untracked)
-readFlavour ms = Right $ \flags -> flags { flavour = ms }
+readFlavour ms = Right $ \flags -> flags { flavour = lower <$> ms }
readProgressColour :: Maybe String -> Either String (Untracked -> Untracked)
readProgressColour ms =
@@ -74,7 +74,7 @@ readSplitObjects = Right $ \flags -> flags { splitObjects = True }
cmdFlags :: [OptDescr (Either String (Untracked -> Untracked))]
cmdFlags =
[ Option [] ["flavour"] (OptArg readFlavour "FLAVOUR")
- "Build flavour (default, quick or quickest)."
+ "Build flavour (Default, Devel1, Devel2, Perf, Prof, Quick or Quickest)."
, Option [] ["haddock"] (NoArg readBuildHaddock)
"Generate Haddock documentation."
, Option [] ["progress-colour"] (OptArg readProgressColour "MODE")
diff --git a/src/Settings.hs b/src/Settings.hs
index 09b58f8..01ee122 100644
--- a/src/Settings.hs
+++ b/src/Settings.hs
@@ -15,6 +15,7 @@ import GHC
import Oracles.PackageData
import Oracles.Path
import {-# SOURCE #-} Settings.Default
+import Settings.Flavours.Development
import Settings.Flavours.Perf
import Settings.Flavours.Prof
import Settings.Flavours.Quick
@@ -53,8 +54,9 @@ getPkgDataList :: (FilePath -> PackageDataList) -> Expr [String]
getPkgDataList key = lift . pkgDataList . key =<< getBuildPath
hadrianFlavours :: [Flavour]
-hadrianFlavours = [ defaultFlavour, perfFlavour, profFlavour, quickFlavour
- , quickestFlavour ]
+hadrianFlavours =
+ [ defaultFlavour, developmentFlavour Stage1, developmentFlavour Stage2
+ , perfFlavour, profFlavour, quickFlavour, quickestFlavour ]
flavour :: Flavour
flavour = fromMaybe unknownFlavour $ find ((== flavourName) . name) flavours
diff --git a/src/Settings/Builders/Ghc.hs b/src/Settings/Builders/Ghc.hs
index 98e5e39..669900f 100644
--- a/src/Settings/Builders/Ghc.hs
+++ b/src/Settings/Builders/Ghc.hs
@@ -9,9 +9,6 @@ ghcBuilderArgs = (builder (Ghc CompileHs) ||^ builder (Ghc LinkHs)) ? do
needTouchy
mconcat [ arg "-Wall"
, commonGhcArgs
- , arg "-H32m"
- , stage0 ? arg "-O"
- , notStage0 ? arg "-O2"
, splitObjectsArgs
, ghcLinkArgs
, builder (Ghc CompileHs) ? arg "-c"
diff --git a/src/Settings/Default.hs b/src/Settings/Default.hs
index 103c432..6db669e 100644
--- a/src/Settings/Default.hs
+++ b/src/Settings/Default.hs
@@ -40,7 +40,10 @@ import Settings.Packages.RunGhc
-- | All default command line arguments.
defaultArgs :: Args
-defaultArgs = defaultBuilderArgs <> defaultPackageArgs
+defaultArgs = mconcat
+ [ defaultBuilderArgs
+ , builder Ghc ? mconcat [stage0 ? arg "-O", notStage0 ? arg "-O2", arg "-H32m"]
+ , defaultPackageArgs ]
-- | Packages that are built by default. You can change this by editing
-- 'userPackages' in "UserSettings".
diff --git a/src/Settings/Flavours/Development.hs b/src/Settings/Flavours/Development.hs
new file mode 100644
index 0000000..afe42d5
--- /dev/null
+++ b/src/Settings/Flavours/Development.hs
@@ -0,0 +1,26 @@
+module Settings.Flavours.Development (developmentFlavour) where
+
+import Flavour
+import GHC
+import Predicate
+import {-# SOURCE #-} Settings.Default
+
+-- TODO: Implement an equivalent of LAX_DEPENDENCIES = YES setting, see #250.
+developmentFlavour :: Stage -> Flavour
+developmentFlavour ghcStage = defaultFlavour
+ { name = "devel" ++ show (fromEnum ghcStage)
+ , args = developmentArgs ghcStage
+ , libraryWays = append [vanilla] }
+
+developmentArgs :: Stage -> Args
+developmentArgs ghcStage = do
+ stage <- getStage
+ pkg <- getPackage
+ let now = succ stage == ghcStage
+ mconcat [ defaultBuilderArgs
+ , builder Ghc ? mconcat
+ [ append ["-O", "-H64m"]
+ , now ? pkg == compiler ? append ["-O0", "-DDEBUG", "-dcore-lint"]
+ , now ? pkg == ghc ? append ["-O0", "-DDEBUG"]
+ , notStage0 ? isLibrary pkg ? arg "-dcore-lint" ]
+ , defaultPackageArgs ]
More information about the ghc-commits
mailing list