Commit e37a5f77 authored by Andrey Mokhov's avatar Andrey Mokhov

Drop append, simplify

parent 65c5d7c6
......@@ -3,7 +3,7 @@ module Expression (
Expr, Predicate, Args, Ways, Packages,
-- ** Construction and modification
expr, exprIO, append, arg, remove,
expr, exprIO, arg, remove,
-- ** Predicates
(?), stage, stage0, stage1, stage2, notStage0, package, notPackage,
......@@ -17,7 +17,7 @@ module Expression (
-- * Convenient accessors
getContext, getStage, getPackage, getBuilder, getOutputs, getInputs, getWay,
getInput, getOutput, getSetting, getSettingList, getFlag,
getInput, getOutput, getSetting, getSettingList, getStagedSettingList, getFlag,
-- * Re-exports
module Data.Semigroup,
......@@ -57,16 +57,15 @@ type Ways = Expr [Way]
-- Basic operations on expressions:
-- | Append something to an expression.
append :: a -> Expr a
append = pure
getSetting :: Setting -> Expr String
getSetting = expr . setting
getSettingList :: SettingList -> Expr [String]
getSettingList = expr . settingList
getStagedSettingList :: (Stage -> SettingList) -> Expr [String]
getStagedSettingList f = getSettingList . f =<< getStage
getFlag :: Flag -> Predicate
getFlag = expr . flag
......@@ -105,4 +104,3 @@ notPackage = notM . package
-- | Is a library package currently being built?
libraryPackage :: Predicate
libraryPackage = isLibrary <$> getPackage
......@@ -28,7 +28,7 @@ configureEnvironment :: Action [CmdOption]
configureEnvironment = do
cFlags <- interpretInContext libffiContext $ mconcat
[ cArgs
, argStagedSettingList ConfCcArgs ]
, getStagedSettingList ConfCcArgs ]
ldFlags <- interpretInContext libffiContext ldArgs
sequence [ builderEnvironment "CC" $ Cc CompileC Stage1
, builderEnvironment "CXX" $ Cc CompileC Stage1
......
......@@ -5,7 +5,7 @@ import Settings.Builders.Common
arBuilderArgs :: Args
arBuilderArgs = builder Ar ? mconcat [ arg "q"
, arg =<< getOutput
, append =<< getInputs ]
, getInputs ]
-- This count includes arg "q" and arg file parameters in arBuilderArgs.
-- Update this value appropriately when changing arBuilderArgs.
......
......@@ -6,13 +6,13 @@ ccBuilderArgs :: Args
ccBuilderArgs = do
way <- getWay
builder Cc ? mconcat
[ append =<< getPkgDataList CcArgs
, getSettingList . ConfCcArgs =<< getStage
[ getPkgDataList CcArgs
, getStagedSettingList ConfCcArgs
, cIncludeArgs
, builder (Cc CompileC) ? mconcat
[ arg "-Werror"
, Dynamic `wayUnit` way ? append [ "-fPIC", "-DDYNAMIC" ]
, Dynamic `wayUnit` way ? pure [ "-fPIC", "-DDYNAMIC" ]
-- ref: mk/warning.mk:
-- SRC_CC_OPTS += -Wall $(WERROR)
, arg "-c", arg =<< getInput
......
......@@ -8,8 +8,7 @@ module Settings.Builders.Common (
module Settings,
module Settings.Path,
module UserSettings,
cIncludeArgs, ldArgs, cArgs, cWarnings, argStagedBuilderPath,
argStagedSettingList, bootPackageDatabaseArgs
cIncludeArgs, ldArgs, cArgs, cWarnings, bootPackageDatabaseArgs
) where
import Base
......@@ -31,8 +30,8 @@ cIncludeArgs = do
mconcat [ arg "-Iincludes"
, arg $ "-I" ++ generatedPath
, arg $ "-I" ++ path
, append [ "-I" ++ pkgPath pkg -/- dir | dir <- incDirs ]
, append [ "-I" ++ unifyPath dir | dir <- depDirs ] ]
, pure [ "-I" ++ pkgPath pkg -/- dir | dir <- incDirs ]
, pure [ "-I" ++ unifyPath dir | dir <- depDirs ] ]
ldArgs :: Args
ldArgs = mempty
......@@ -49,18 +48,6 @@ cWarnings = do
, gccGe46 ? notM windowsHost ? arg "-Werror=unused-but-set-variable"
, gccGe46 ? arg "-Wno-error=inline" ]
argSettingList :: SettingList -> Args
argSettingList = (append =<<) . getSettingList
argStagedSettingList :: (Stage -> SettingList) -> Args
argStagedSettingList ss = argSettingList . ss =<< getStage
argStagedBuilderPath :: (Stage -> Builder) -> Args
argStagedBuilderPath sb = do
stage <- getStage
path <- expr $ builderPath (sb stage)
arg path
bootPackageDatabaseArgs :: Args
bootPackageDatabaseArgs = do
stage <- getStage
......
......@@ -7,14 +7,14 @@ configureBuilderArgs = mconcat
[ builder (Configure gmpBuildPath) ? do
hostPlatform <- getSetting HostPlatform
buildPlatform <- getSetting BuildPlatform
append [ "--enable-shared=no"
pure [ "--enable-shared=no"
, "--host=" ++ hostPlatform
, "--build=" ++ buildPlatform ]
, builder (Configure libffiBuildPath) ? do
top <- expr topDirectory
targetPlatform <- getSetting TargetPlatform
append [ "--prefix=" ++ top -/- libffiBuildPath -/- "inst"
pure [ "--prefix=" ++ top -/- libffiBuildPath -/- "inst"
, "--libdir=" ++ top -/- libffiBuildPath -/- "inst/lib"
, "--enable-static=yes"
, "--enable-shared=no" -- TODO: add support for yes
......
......@@ -16,11 +16,11 @@ deriveConstantsBuilderArgs = builder DeriveConstants ? do
, arg "-o", arg outputFile
, arg "--tmpdir", arg tempDir
, arg "--gcc-program", arg =<< getBuilderPath (Cc CompileC Stage1)
, append $ concatMap (\a -> ["--gcc-flag", a]) cFlags
, pure $ concatMap (\a -> ["--gcc-flag", a]) cFlags
, arg "--nm-program", arg =<< getBuilderPath Nm
, isSpecified Objdump ? mconcat [ arg "--objdump-program"
, arg =<< getBuilderPath Objdump ]
, arg "--target-os", return <$> getSetting TargetOs ]
, arg "--target-os", arg =<< getSetting TargetOs ]
includeCcArgs :: Args
includeCcArgs = mconcat
......
......@@ -15,25 +15,25 @@ ghcBuilderArgs = (builder (Ghc CompileHs) ||^ builder (Ghc LinkHs)) ? do
, splitObjectsArgs
, ghcLinkArgs
, builder (Ghc CompileHs) ? arg "-c"
, append =<< getInputs
, getInputs
, arg "-o", arg =<< getOutput ]
ghcCbuilderArgs :: Args
ghcCbuilderArgs =
builder (Ghc CompileCWithGhc) ? do
way <- getWay
let ccArgs = [ append =<< getPkgDataList CcArgs
, getSettingList . ConfCcArgs =<< getStage
let ccArgs = [ getPkgDataList CcArgs
, getStagedSettingList ConfCcArgs
, cIncludeArgs
, arg "-Werror"
, Dynamic `wayUnit` way ? append [ "-fPIC", "-DDYNAMIC" ] ]
, Dynamic `wayUnit` way ? pure [ "-fPIC", "-DDYNAMIC" ] ]
mconcat [ arg "-Wall"
, ghcLinkArgs
, commonGhcArgs
, mconcat (map (map ("-optc" ++) <$>) ccArgs)
, arg "-c"
, append =<< getInputs
, getInputs
, arg "-o"
, arg =<< getOutput ]
......@@ -51,12 +51,12 @@ ghcLinkArgs = builder (Ghc LinkHs) ? do
return $ concatMap (words . strip) buildInfo
else return []
mconcat [ (Dynamic `wayUnit` way) ?
append [ "-shared", "-dynamic", "-dynload", "deploy" ]
pure [ "-shared", "-dynamic", "-dynload", "deploy" ]
, arg "-no-auto-link-packages"
, nonHsMainPackage pkg ? arg "-no-hs-main"
, not (nonHsMainPackage pkg) ? arg "-rtsopts"
, append [ "-optl-l" ++ lib | lib <- libs ++ gmpLibs ]
, append [ "-optl-L" ++ unifyPath dir | dir <- libDirs ] ]
, pure [ "-optl-l" ++ lib | lib <- libs ++ gmpLibs ]
, pure [ "-optl-L" ++ unifyPath dir | dir <- libDirs ] ]
needTouchy :: Expr ()
needTouchy = notStage0 ? do
......@@ -75,29 +75,26 @@ ghcMBuilderArgs = builder (Ghc FindHsDependencies) ? do
, commonGhcArgs
, arg "-include-pkg-deps"
, arg "-dep-makefile", arg =<< getOutput
, append $ concat [ ["-dep-suffix", wayPrefix w] | w <- ways ]
, append =<< getInputs ]
, pure $ concat [ ["-dep-suffix", wayPrefix w] | w <- ways ]
, getInputs ]
haddockGhcArgs :: Args
haddockGhcArgs = mconcat [ commonGhcArgs, append =<< getPkgDataList HsArgs ]
haddockGhcArgs = mconcat [ commonGhcArgs, getPkgDataList HsArgs ]
-- This is included into ghcBuilderArgs, ghcMBuilderArgs and haddockGhcArgs.
commonGhcArgs :: Args
commonGhcArgs = do
way <- getWay
path <- getBuildPath
confCc <- getSettingList . ConfCcArgs =<< getStage
confCpp <- getSettingList . ConfCppArgs =<< getStage
cppArgs <- getPkgDataList CppArgs
mconcat [ arg "-hisuf", arg $ hisuf way
, arg "-osuf" , arg $ osuf way
, arg "-hcsuf", arg $ hcsuf way
, wayGhcArgs
, packageGhcArgs
, includeGhcArgs
, append $ map ("-optc" ++) confCc
, append $ map ("-optP" ++) confCpp
, append $ map ("-optP" ++) cppArgs
, map ("-optc" ++) <$> getStagedSettingList ConfCcArgs
, map ("-optP" ++) <$> getStagedSettingList ConfCppArgs
, map ("-optP" ++) <$> getPkgDataList CppArgs
, arg "-odir" , arg path
, arg "-hidir" , arg path
, arg "-stubdir" , arg path ]
......@@ -107,20 +104,19 @@ wayGhcArgs :: Args
wayGhcArgs = do
way <- getWay
mconcat [ if (Dynamic `wayUnit` way)
then append ["-fPIC", "-dynamic"]
then pure ["-fPIC", "-dynamic"]
else arg "-static"
, (Threaded `wayUnit` way) ? arg "-optc-DTHREADED_RTS"
, (Debug `wayUnit` way) ? arg "-optc-DDEBUG"
, (Profiling `wayUnit` way) ? arg "-prof"
, (Logging `wayUnit` way) ? arg "-eventlog"
, (way == debug || way == debugDynamic) ?
append ["-ticky", "-DTICKY_TICKY"] ]
pure ["-ticky", "-DTICKY_TICKY"] ]
-- FIXME: Get rid of to-be-deprecated -this-package-key.
packageGhcArgs :: Args
packageGhcArgs = do
compId <- getPkgData ComponentId
pkgDepIds <- getPkgDataList DepIds
-- FIXME: Get rid of to-be-deprecated -this-package-key.
thisArg <- do
not0 <- notStage0
unit <- getFlag SupportsThisUnitId
......@@ -129,7 +125,7 @@ packageGhcArgs = do
, arg "-no-user-package-db"
, bootPackageDatabaseArgs
, libraryPackage ? arg (thisArg ++ compId)
, append $ map ("-package-id " ++) pkgDepIds ]
, map ("-package-id " ++) <$> getPkgDataList DepIds ]
includeGhcArgs :: Args
includeGhcArgs = do
......@@ -140,10 +136,10 @@ includeGhcArgs = do
mconcat [ arg "-i"
, arg $ "-i" ++ path
, arg $ "-i" ++ autogenPath context
, append [ "-i" ++ pkgPath pkg -/- dir | dir <- srcDirs ]
, pure [ "-i" ++ pkgPath pkg -/- dir | dir <- srcDirs ]
, cIncludeArgs
, arg $ "-I" ++ generatedPath
, arg $ "-optc-I" ++ generatedPath
, (not $ nonCabalContext context) ?
append [ "-optP-include"
pure [ "-optP-include"
, "-optP" ++ autogenPath context -/- "cabal_macros.h" ] ]
......@@ -29,7 +29,7 @@ ghcCabalBuilderArgs = builder GhcCabal ? do
, withStaged Ar
, with Alex
, with Happy
, verbosity < Chatty ? append [ "-v0", "--configure-option=--quiet"
, verbosity < Chatty ? pure [ "-v0", "--configure-option=--quiet"
, "--configure-option=--disable-option-checking" ] ]
ghcCabalHsColourBuilderArgs :: Args
......@@ -37,7 +37,7 @@ ghcCabalHsColourBuilderArgs = builder GhcCabalHsColour ? do
path <- getPackagePath
top <- expr topDirectory
context <- getContext
append [ "hscolour", path, top -/- buildPath context ]
pure [ "hscolour", path, top -/- buildPath context ]
-- TODO: Isn't vanilla always built? If yes, some conditions are redundant.
-- TODO: Need compiler_stage1_CONFIGURE_OPTS += --disable-library-for-ghci?
......@@ -45,7 +45,7 @@ libraryArgs :: Args
libraryArgs = do
ways <- getLibraryWays
withGhci <- expr ghcWithInterpreter
append [ if vanilla `elem` ways
pure [ if vanilla `elem` ways
then "--enable-library-vanilla"
else "--disable-library-vanilla"
, if vanilla `elem` ways && withGhci && not (dynamicGhcPrograms flavour)
......@@ -67,28 +67,28 @@ configureArgs = do
not (null values) ?
arg ("--configure-option=" ++ key ++ "=" ++ values)
cFlags = mconcat [ remove ["-Werror"] cArgs
, argStagedSettingList ConfCcArgs
, getStagedSettingList ConfCcArgs
, arg $ "-I" ++ top -/- generatedPath ]
ldFlags = ldArgs <> (argStagedSettingList ConfGccLinkerArgs)
cppFlags = cppArgs <> (argStagedSettingList ConfCppArgs)
ldFlags = ldArgs <> (getStagedSettingList ConfGccLinkerArgs)
cppFlags = cppArgs <> (getStagedSettingList ConfCppArgs)
cldFlags <- unwords <$> (cFlags <> ldFlags)
mconcat
[ conf "CFLAGS" cFlags
, conf "LDFLAGS" ldFlags
, conf "CPPFLAGS" cppFlags
, not (null cldFlags) ? arg ("--gcc-options=" ++ cldFlags)
, conf "--with-iconv-includes" $ return <$> getSetting IconvIncludeDir
, conf "--with-iconv-libraries" $ return <$> getSetting IconvLibDir
, conf "--with-gmp-includes" $ return <$> getSetting GmpIncludeDir
, conf "--with-gmp-libraries" $ return <$> getSetting GmpLibDir
, conf "--with-curses-libraries" $ return <$> getSetting CursesLibDir
, crossCompiling ? (conf "--host" $ return <$> getSetting TargetPlatformFull)
, conf "--with-cc" $ argStagedBuilderPath (Cc CompileC) ]
, conf "--with-iconv-includes" $ arg =<< getSetting IconvIncludeDir
, conf "--with-iconv-libraries" $ arg =<< getSetting IconvLibDir
, conf "--with-gmp-includes" $ arg =<< getSetting GmpIncludeDir
, conf "--with-gmp-libraries" $ arg =<< getSetting GmpLibDir
, conf "--with-curses-libraries" $ arg =<< getSetting CursesLibDir
, crossCompiling ? (conf "--host" $ arg =<< getSetting TargetPlatformFull)
, conf "--with-cc" $ arg =<< getBuilderPath . (Cc CompileC) =<< getStage ]
packageConstraints :: Args
packageConstraints = stage0 ? do
constraints <- expr . readFileLines $ bootPackageConstraints
append $ concat [ ["--constraint", c] | c <- constraints ]
pure $ concat [ ["--constraint", c] | c <- constraints ]
cppArgs :: Args
cppArgs = arg $ "-I" ++ generatedPath
......
......@@ -32,18 +32,18 @@ haddockBuilderArgs = builder Haddock ? do
, arg $ "--title=" ++ pkgNameString pkg ++ "-" ++ version ++ ": " ++ synopsis
, arg $ "--prologue=" ++ path -/- "haddock-prologue.txt"
, arg $ "--optghc=-D__HADDOCK_VERSION__=" ++ show (versionToInt hVersion)
, append . map ("--hide=" ++) =<< getPkgDataList HiddenModules
, append $ [ "--read-interface=../" ++ dep
, map ("--hide=" ++) <$> getPkgDataList HiddenModules
, pure [ "--read-interface=../" ++ dep
++ ",../" ++ dep ++ "/src/%{MODULE/./-}.html\\#%{NAME},"
++ pkgHaddockFile (vanillaContext Stage1 depPkg)
| (dep, depName) <- zip deps depNames
, Just depPkg <- [findKnownPackage $ PackageName depName]
, depPkg /= rts ]
, append [ "--optghc=" ++ opt | opt <- ghcOpts ]
, pure [ "--optghc=" ++ opt | opt <- ghcOpts ]
, isSpecified HsColour ?
append [ "--source-module=src/%{MODULE/./-}.html"
pure [ "--source-module=src/%{MODULE/./-}.html"
, "--source-entity=src/%{MODULE/./-}.html\\#%{NAME}" ]
, append =<< getInputs
, getInputs
, arg "+RTS"
, arg $ "-t" ++ path -/- "haddock.t"
, arg "--machine-readable"
......
......@@ -7,8 +7,6 @@ hsc2hsBuilderArgs = builder Hsc2Hs ? do
stage <- getStage
ccPath <- getBuilderPath $ Cc CompileC stage
gmpDir <- getSetting GmpIncludeDir
cFlags <- getCFlags
lFlags <- getLFlags
top <- expr topDirectory
hArch <- getSetting HostArch
hOs <- getSetting HostOs
......@@ -20,9 +18,9 @@ hsc2hsBuilderArgs = builder Hsc2Hs ? do
mconcat [ arg $ "--cc=" ++ ccPath
, arg $ "--ld=" ++ ccPath
, notM windowsHost ? arg "--cross-safe"
, append . map ("-I" ++) $ words gmpDir
, append $ map ("--cflag=" ++) cFlags
, append $ map ("--lflag=" ++) lFlags
, pure $ map ("-I" ++) (words gmpDir)
, map ("--cflag=" ++) <$> getCFlags
, map ("--lflag=" ++) <$> getLFlags
, notStage0 ? crossCompiling ? arg "--cross-compile"
, stage0 ? arg ("--cflag=-D" ++ hArch ++ "_HOST_ARCH=1")
, stage0 ? arg ("--cflag=-D" ++ hOs ++ "_HOST_OS=1" )
......@@ -37,25 +35,21 @@ hsc2hsBuilderArgs = builder Hsc2Hs ? do
getCFlags :: Expr [String]
getCFlags = do
context <- getContext
cppArgs <- getPkgDataList CppArgs
depCcArgs <- getPkgDataList DepCcArgs
mconcat [ remove ["-O"] (cArgs <> argStagedSettingList ConfCcArgs)
, argStagedSettingList ConfCppArgs
mconcat [ remove ["-O"] (cArgs <> getStagedSettingList ConfCcArgs)
, getStagedSettingList ConfCppArgs
, cIncludeArgs
, append cppArgs
, append depCcArgs
, getPkgDataList CppArgs
, getPkgDataList DepCcArgs
, cWarnings
, arg "-include", arg $ autogenPath context -/- "cabal_macros.h" ]
getLFlags :: Expr [String]
getLFlags = do
pkgLdArgs <- getPkgDataList LdArgs
libDirs <- getPkgDataList DepLibDirs
extraLibs <- getPkgDataList DepExtraLibs
depLdArgs <- getPkgDataList DepLdArgs
mconcat [ argStagedSettingList ConfGccLinkerArgs
mconcat [ getStagedSettingList ConfGccLinkerArgs
, ldArgs
, append pkgLdArgs
, append $ [ "-L" ++ unifyPath dir | dir <- libDirs ]
, append $ [ "-l" ++ unifyPath dir | dir <- extraLibs ]
, append depLdArgs ]
, getPkgDataList LdArgs
, pure [ "-L" ++ unifyPath dir | dir <- libDirs ]
, pure [ "-l" ++ unifyPath dir | dir <- extraLibs ]
, getPkgDataList DepLdArgs ]
......@@ -3,7 +3,7 @@ module Settings.Builders.Ld (ldBuilderArgs) where
import Settings.Builders.Common
ldBuilderArgs :: Args
ldBuilderArgs = builder Ld ? mconcat [ argStagedSettingList ConfLdLinkerArgs
ldBuilderArgs = builder Ld ? mconcat [ getStagedSettingList ConfLdLinkerArgs
, arg "-r"
, arg "-o", arg =<< getOutput
, append =<< getInputs ]
, getInputs ]
......@@ -7,6 +7,6 @@ makeBuilderArgs = do
threads <- shakeThreads <$> (expr getShakeOptions)
let t = show $ max 4 (threads - 2) -- Don't use all Shake's threads
mconcat
[ builder (Make gmpBuildPath ) ? append ["MAKEFLAGS=-j" ++ t]
, builder (Make libffiBuildPath ) ? append ["MAKEFLAGS=-j" ++ t, "install"]
, builder (Make "testsuite/tests") ? append ["THREADS=" ++ t, "fast"] ]
[ builder (Make gmpBuildPath ) ? pure ["MAKEFLAGS=-j" ++ t]
, builder (Make libffiBuildPath ) ? pure ["MAKEFLAGS=-j" ++ t, "install"]
, builder (Make "testsuite/tests") ? pure ["THREADS=" ++ t, "fast"] ]
......@@ -52,7 +52,7 @@ data SourceArgs = SourceArgs
sourceArgs :: SourceArgs -> Args
sourceArgs SourceArgs {..} = builder Ghc ? mconcat
[ hsDefault
, append =<< getPkgDataList HsArgs
, getPkgDataList HsArgs
, libraryPackage ? hsLibrary
, package compiler ? hsCompiler
, package ghc ? hsGhc ]
......@@ -96,7 +96,7 @@ stage0Packages :: Packages
stage0Packages = do
win <- expr windowsHost
ios <- expr iosHost
append $ [ binary
pure $ [ binary
, cabal
, checkApiAnnotations
, compareSizes
......@@ -127,7 +127,7 @@ stage1Packages = do
win <- expr windowsHost
doc <- buildHaddock flavour
mconcat [ (filter isLibrary) <$> stage0Packages -- Build all Stage0 libraries in Stage1
, append $ [ array
, pure $ [ array
, base
, bytestring
, containers
......@@ -153,7 +153,7 @@ stage1Packages = do
[ xhtml | doc ] ]
stage2Packages :: Packages
stage2Packages = buildHaddock flavour ? append [ haddock ]
stage2Packages = buildHaddock flavour ? pure [ haddock ]
-- | Default build ways for library packages:
-- * We always build 'vanilla' way.
......@@ -161,19 +161,19 @@ stage2Packages = buildHaddock flavour ? append [ haddock ]
-- * We build 'dynamic' way when stage > Stage0 and the platform supports it.
defaultLibraryWays :: Ways
defaultLibraryWays = mconcat
[ append [vanilla]
, notStage0 ? append [profiling]
, notStage0 ? platformSupportsSharedLibs ? append [dynamic] ]
[ pure [vanilla]
, notStage0 ? pure [profiling]
, notStage0 ? platformSupportsSharedLibs ? pure [dynamic] ]
-- | Default build ways for the RTS.
defaultRtsWays :: Ways
defaultRtsWays = do
ways <- getLibraryWays
mconcat
[ append [ logging, debug, threaded, threadedDebug, threadedLogging ]
, (profiling `elem` ways) ? append [threadedProfiling]
[ pure [ logging, debug, threaded, threadedDebug, threadedLogging ]
, (profiling `elem` ways) ? pure [threadedProfiling]
, (dynamic `elem` ways) ?
append [ dynamic, debugDynamic, threadedDynamic, threadedDebugDynamic
pure [ dynamic, debugDynamic, threadedDynamic, threadedDebugDynamic
, loggingDynamic, threadedLoggingDynamic ] ]
-- | Default build flavour. Other build flavours are defined in modules
......@@ -232,35 +232,35 @@ defaultBuilderArgs = mconcat
disableWarningArgs :: Args
disableWarningArgs = builder Ghc ? mconcat
[ stage0 ? mconcat
[ package terminfo ? append [ "-fno-warn-unused-imports" ]
, package transformers ? append [ "-fno-warn-unused-matches"
[ package terminfo ? pure [ "-fno-warn-unused-imports" ]
, package transformers ? pure [ "-fno-warn-unused-matches"
, "-fno-warn-unused-imports" ]
, libraryPackage ? append [ "-fno-warn-deprecated-flags" ] ]
, libraryPackage ? pure [ "-fno-warn-deprecated-flags" ] ]
, notStage0 ? mconcat
[ package base ? append [ "-Wno-trustworthy-safe" ]
, package binary ? append [ "-Wno-deprecations" ]
, package bytestring ? append [ "-Wno-inline-rule-shadowing" ]
, package directory ? append [ "-Wno-unused-imports" ]
, package ghcPrim ? append [ "-Wno-trustworthy-safe" ]
, package haddock ? append [ "-Wno-unused-imports"
[ package base ? pure [ "-Wno-trustworthy-safe" ]
, package binary ? pure [ "-Wno-deprecations" ]
, package bytestring ? pure [ "-Wno-inline-rule-shadowing" ]
, package directory ? pure [ "-Wno-unused-imports" ]
, package ghcPrim ? pure [ "-Wno-trustworthy-safe" ]
, package haddock ? pure [ "-Wno-unused-imports"
, "-Wno-deprecations" ]
, package haskeline ? append [ "-Wno-deprecations"
, package haskeline ? pure [ "-Wno-deprecations"
, "-Wno-unused-imports"
, "-Wno-redundant-constraints"
, "-Wno-simplifiable-class-constraints" ]
, package pretty ? append [ "-Wno-unused-imports" ]
, package primitive ? append [ "-Wno-unused-imports"
, package pretty ? pure [ "-Wno-unused-imports" ]
, package primitive ? pure [ "-Wno-unused-imports"
, "-Wno-deprecations" ]
, package terminfo ? append [ "-Wno-unused-imports" ]
, package transformers ? append [ "-Wno-unused-matches"
, package terminfo ? pure [ "-Wno-unused-imports" ]
, package transformers ? pure [ "-Wno-unused-matches"
, "-Wno-unused-imports"
, "-Wno-redundant-constraints"
, "-Wno-orphans" ]
, package win32 ? append [ "-Wno-trustworthy-safe" ]
, package xhtml ? append [ "-Wno-unused-imports"
, package win32 ? pure [ "-Wno-trustworthy-safe" ]
, package xhtml ? pure [ "-Wno-unused-imports"
, "-Wno-tabs" ]
, libraryPackage ? append [ "-Wno-deprecated-flags" ] ] ]
, libraryPackage ? pure [ "-Wno-deprecated-flags" ] ] ]
-- | All 'Package'-dependent command line arguments.
defaultPackageArgs :: Args
......
......@@ -14,7 +14,7 @@ developmentArgs :: Stage -> Args
developmentArgs ghcStage = do
stage <- getStage
sourceArgs $ SourceArgs
{ hsDefault = append ["-O", "-H32m"]
{ hsDefault = pure ["-O", "-H32m"]
, hsLibrary = notStage0 ? arg "-dcore-lint"
, hsCompiler = succ stage == ghcStage ? append ["-O0", "-DDEBUG"]
, hsGhc = succ stage == ghcStage ? append ["-O0", "-DDEBUG"] }
, hsCompiler = succ stage == ghcStage ? pure ["-O0", "-DDEBUG"]
, hsGhc = succ stage == ghcStage ? pure ["-O0", "-DDEBUG"] }
......@@ -11,7 +11,7 @@ performanceFlavour = defaultFlavour
performanceArgs :: Args
performanceArgs = sourceArgs $ SourceArgs
{ hsDefault = append ["-O", "-H32m"]
{ hsDefault = pure ["-O", "-H32m"]
, hsLibrary = notStage0 ? arg "-O2"
, hsCompiler = mconcat [stage0 ? arg "-O", notStage0 ? arg "-O2"]
, hsGhc = mconcat [stage0 ? arg "-O", notStage0 ? arg "-O2"] }
......@@ -12,7 +12,7 @@ profiledFlavour = defaultFlavour
profiledArgs :: Args
profiledArgs = sourceArgs $ SourceArgs
{ hsDefault = append ["-O0", "-H32m"]
{ hsDefault = pure ["-O0", "-H32m"]
, hsLibrary = notStage0 ? arg "-O"
, hsCompiler = arg "-O"