on master help sign in
Add simple verbose mode (-v) for debugging
commit5712c2172ab9722edd9586f982aff007d282f38a authorChris Done <chrisdone@gmail.com> dateWed 31 Dec 2014, 22:17 (12 years ago) parent335fa91
3 files changed+9−2
Stackage/CompleteBuild.hs+2 Stackage/PerformBuild.hs+3−1 app/stackage.hs+4−1
Stackage/CompleteBuild.hs+2
@@ -30,6 +30,7 @@ data BuildFlags = BuildFlags
3030 { bfEnableTests :: !Bool
3131 , bfDoUpload :: !Bool
3232 , bfEnableLibProfile :: !Bool
33+ , bfVerbose :: !Bool
3334 } deriving (Show)
3435
3536data BuildType = Nightly | LTS BumpType
@@ -182,6 +183,7 @@ completeBuild buildType buildFlags = withManager tlsManagerSettings $ \man -> do
182183 , pbGlobalInstall = False
183184 , pbEnableTests = bfEnableTests buildFlags
184185 , pbEnableLibProfiling = bfEnableLibProfile buildFlags
186+ , pbVerbose = bfVerbose buildFlags
185187 }
186188 performBuild pb >>= mapM_ putStrLn
187189
Stackage/PerformBuild.hs+3−1
@@ -63,6 +63,7 @@ data PerformBuild = PerformBuild
6363 -- ^ Register packages in the global database
6464 , pbEnableTests :: Bool
6565 , pbEnableLibProfiling :: Bool
66+ , pbVerbose :: Bool
6667 }
6768
6869data PackageInfo = PackageInfo
@@ -316,7 +317,8 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} =
316317 PackageConstraints {..} = ppConstraints $ piPlan sbPackageInfo
317318
318319 buildLibrary = wf libOut $ \outH -> do
319− let run = runChild outH
320+ let run a b = do when pbVerbose $ log' (unwords (a : b))
321+ runChild outH a b
320322 log' $ "Unpacking " ++ namever
321323 runParent outH "cabal" ["unpack", namever]
322324
app/stackage.hs+4−1
@@ -69,4 +69,7 @@ main =
6969 help "Skip uploading bundle, docs, etc.")) <*>
7070 switch
7171 (long "enable-library-profiling" <>
72− help "Enable profiling when building")
72+ help "Enable profiling when building") <*>
73+ switch
74+ (long "verbose" <> short 'v' <>
75+ help "Output verbose detail about the build steps")