mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-03-11 03:06:35 +01:00
Add --ghc-options arg
This commit is contained in:
parent
0b85b87dc2
commit
796ddbca89
@ -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
|
||||
|
||||
@ -51,6 +51,7 @@ getPerformBuild plan InstallFlags{..} =
|
||||
, pbEnableLibProfiling = ifEnableLibProfiling
|
||||
, pbVerbose = ifVerbose
|
||||
, pbAllowNewer = ifSkipCheck
|
||||
, pbGhcOptions = []
|
||||
}
|
||||
|
||||
-- | Install stackage from an existing build plan.
|
||||
|
||||
@ -69,6 +69,7 @@ data PerformBuild = PerformBuild
|
||||
, pbVerbose :: Bool
|
||||
, pbAllowNewer :: Bool
|
||||
-- ^ Pass --allow-newer to cabal configure
|
||||
, pbGhcOptions :: String
|
||||
}
|
||||
|
||||
data PackageInfo = PackageInfo
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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" <>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user