Skip to content

Commit a92bfc8

Browse files
authored
Merge pull request #3671 from ezyang/pr/handle-v0
Pass on -v0 to GHC.
2 parents eb5b9b7 + e3fd8c8 commit a92bfc8

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

Cabal/Distribution/Simple/GHC/Internal.hs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,11 @@ componentCcGhcOptions :: Verbosity -> GhcImplInfo -> LocalBuildInfo
241241
-> BuildInfo -> ComponentLocalBuildInfo
242242
-> FilePath -> FilePath
243243
-> GhcOptions
244-
componentCcGhcOptions _verbosity _implInfo lbi bi clbi odir filename =
244+
componentCcGhcOptions verbosity _implInfo lbi bi clbi odir filename =
245245
mempty {
246-
-- Use --ghc-option=-v instead!
247-
ghcOptVerbosity = NoFlag,
246+
-- Respect -v0, but don't crank up verbosity on GHC if
247+
-- Cabal verbosity is requested. For that, use --ghc-option=-v instead!
248+
ghcOptVerbosity = toFlag (min verbosity normal),
248249
ghcOptMode = toFlag GhcModeCompile,
249250
ghcOptInputFiles = toNubListR [filename],
250251

@@ -270,10 +271,11 @@ componentCcGhcOptions _verbosity _implInfo lbi bi clbi odir filename =
270271
componentGhcOptions :: Verbosity -> LocalBuildInfo
271272
-> BuildInfo -> ComponentLocalBuildInfo -> FilePath
272273
-> GhcOptions
273-
componentGhcOptions _verbosity lbi bi clbi odir =
274+
componentGhcOptions verbosity lbi bi clbi odir =
274275
mempty {
275-
-- Use --ghc-option=-v instead!
276-
ghcOptVerbosity = NoFlag,
276+
-- Respect -v0, but don't crank up verbosity on GHC if
277+
-- Cabal verbosity is requested. For that, use --ghc-option=-v instead!
278+
ghcOptVerbosity = toFlag (min verbosity normal),
277279
ghcOptHideAllPackages = toFlag True,
278280
ghcOptCabal = toFlag True,
279281
ghcOptThisUnitId = case clbi of

cabal-install/Distribution/Client/SetupWrapper.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ import Distribution.Text
9191
import Distribution.Utils.NubList
9292
( toNubListR )
9393
import Distribution.Verbosity
94-
( Verbosity )
94+
( Verbosity, normal )
9595
import Distribution.Compat.Exception
9696
( catchIO )
9797

@@ -624,8 +624,9 @@ externalSetupMethod verbosity options pkg bt mkargs = do
624624
addRenaming (ipid, _) = (ipid, defaultRenaming)
625625
cppMacrosFile = setupDir </> "setup_macros.h"
626626
ghcOptions = mempty {
627-
-- Use --ghc-option=-v instead!
628-
ghcOptVerbosity = NoFlag
627+
-- Respect -v0, but don't crank up verbosity on GHC if
628+
-- Cabal verbosity is requested. For that, use --ghc-option=-v instead!
629+
ghcOptVerbosity = Flag (min verbosity normal)
629630
, ghcOptMode = Flag GhcModeMake
630631
, ghcOptInputFiles = toNubListR [setupHs]
631632
, ghcOptOutputFile = Flag setupProgFile

0 commit comments

Comments
 (0)