Skip to content

Commit fe3ca79

Browse files
committed
--cabal-verbose flag
1 parent 59954c2 commit fe3ca79

4 files changed

Lines changed: 11 additions & 2 deletions

File tree

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Other enhancements:
1313
* `--reconfigure` flag [#914](https://github.com/commercialhaskell/stack/issues/914) [#946](https://github.com/commercialhaskell/stack/issues/946)
1414
* Cached data is written with a checksum of its structure [#889](https://github.com/commercialhaskell/stack/issues/889)
1515
* Fully removed `--optimizations` flag
16+
* Added `--cabal-verbose` flag
1617

1718
Bug fixes:
1819

src/Stack/Build/Execute.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ withSingleContext runInBase ActionContext {..} ExecuteEnv {..} task@Task {..} md
813813
, "-build-runner"
814814
]
815815
return (outputFile, setupArgs)
816-
runExe exeName fullArgs
816+
runExe exeName $ (if boptsCabalVerbose eeBuildOpts then ("--verbose":) else id) fullArgs
817817

818818
maybePrintBuildOutput stripTHLoading makeAbsolute level mlogFile mh =
819819
case mh of

src/Stack/Options.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ buildOptsParser cmd =
8383
fileWatch' <*> keepGoing <*> forceDirty <*>
8484
tests <*> testOptsParser <*>
8585
benches <*> benchOptsParser <*>
86-
many exec <*> onlyConfigure <*> reconfigure
86+
many exec <*> onlyConfigure <*> reconfigure <*>
87+
cabalVerbose
8788
where target =
8889
many (textArgument
8990
(metavar "TARGET" <>
@@ -184,6 +185,10 @@ buildOptsParser cmd =
184185
(long "reconfigure" <>
185186
help "Perform the configure step even if unnecessary. Useful in some corner cases with custom Setup.hs files")
186187

188+
cabalVerbose = flag False True
189+
(long "cabal-verbose" <>
190+
help "Ask Cabal to be verbose in its output")
191+
187192
-- | Parser for package:[-]flag
188193
readFlag :: ReadM (Map (Maybe PackageName) (Map FlagName Bool))
189194
readFlag = do

src/Stack/Types/Build.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,8 @@ data BuildOpts =
429429
-- ^ Only perform the configure step when building
430430
,boptsReconfigure :: !Bool
431431
-- ^ Perform the configure step even if already configured
432+
,boptsCabalVerbose :: !Bool
433+
-- ^ Ask Cabal to be verbose in its builds
432434
}
433435
deriving (Show)
434436

@@ -455,6 +457,7 @@ defaultBuildOpts = BuildOpts
455457
, boptsExec = []
456458
, boptsOnlyConfigure = False
457459
, boptsReconfigure = False
460+
, boptsCabalVerbose = False
458461
}
459462

460463
-- | Options for the 'FinalAction' 'DoTests'

0 commit comments

Comments
 (0)