Add --ghc-options arg

This commit is contained in:
Chris Done 2015-02-17 18:05:10 +01:00
parent 0b85b87dc2
commit 796ddbca89
5 changed files with 13 additions and 2 deletions

View File

@ -1,6 +1,7 @@
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
module Stackage.CompleteBuild
( BuildType (..)
, BumpType (..)
@ -41,6 +42,7 @@ data BuildFlags = BuildFlags
, bfEnableLibProfile :: !Bool
, bfVerbose :: !Bool
, bfSkipCheck :: !Bool
, bfGhcOptions :: !String
} deriving (Show)
data BuildType = Nightly | LTS BumpType
@ -210,6 +212,7 @@ getPerformBuild buildFlags Settings {..} = PerformBuild
, pbEnableLibProfiling = bfEnableLibProfile buildFlags
, pbVerbose = bfVerbose buildFlags
, pbAllowNewer = bfSkipCheck buildFlags
, pbGhcOptions = bfGhcOptions buildFlags
}
-- | Make a complete plan, build, test and upload bundle, docs and

View File

@ -51,6 +51,7 @@ getPerformBuild plan InstallFlags{..} =
, pbEnableLibProfiling = ifEnableLibProfiling
, pbVerbose = ifVerbose
, pbAllowNewer = ifSkipCheck
, pbGhcOptions = []
}
-- | Install stackage from an existing build plan.

View File

@ -69,6 +69,7 @@ data PerformBuild = PerformBuild
, pbVerbose :: Bool
, pbAllowNewer :: Bool
-- ^ Pass --allow-newer to cabal configure
, pbGhcOptions :: String
}
data PackageInfo = PackageInfo

View File

@ -323,7 +323,7 @@ packageTarget env@Env{..} name plan = do
envmap <- liftIO (fmap (Shake.Env . (++ defaultEnv envPB pwd)) getEnvironment)
unpack env name version
configure env dir envmap plan
() <- cmd cwd envmap "cabal" "build" "--ghc-options=-O0"
() <- cmd cwd envmap "cabal" "build" ("--ghc-options=" <> pbGhcOptions envPB)
register dir envmap envRegLock
makeTargetFile (targetForPackage envShake name version)
where dir = pkgDir env name version

View File

@ -90,7 +90,13 @@ main =
help "Output verbose detail about the build steps") <*>
switch
(long "skip-check" <>
help "Skip the check phase, and pass --allow-newer to cabal configure")
help "Skip the check phase, and pass --allow-newer to cabal configure") <*>
option
auto
(long "ghc-options" <>
metavar "OPTIONS" <>
showDefault <>
help "GHC options")
nightlyUploadFlags = fromString <$> strArgument
(metavar "DATE" <>