Skip to content

Commit

Permalink
PackageDescription warnings for normal verbosity
Browse files Browse the repository at this point in the history
This commit makes it so that cabal-install emits PackageDescription
parser warnings at normal verbosity or above. Previously, we used to
emit warnings at verbosity >= verbose, but now that we are going through
in-library methods this meant we could skip ever emitting some warnings,
which is not desirable.
  • Loading branch information
sheaf committed May 8, 2024
1 parent ed9ef01 commit 0bddf0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cabal-install/src/Distribution/Client/ProjectConfig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1522,8 +1522,8 @@ renderCabalFileParseError :: CabalFileParseError -> String
renderCabalFileParseError (CabalFileParseError filePath contents errors _ warnings) =
renderParseError filePath contents errors warnings

-- | Wrapper for the @.cabal@ file parser. It reports warnings on higher
-- verbosity levels and throws 'CabalFileParseError' on failure.
-- | Wrapper for the @.cabal@ file parser. It reports warnings at normal
-- verbosity level, and throws 'CabalFileParseError' on failure.
readSourcePackageCabalFile
:: Verbosity
-> FilePath
Expand All @@ -1533,7 +1533,7 @@ readSourcePackageCabalFile verbosity pkgfilename content =
case runParseResult (parseGenericPackageDescription content) of
(warnings, Right pkg) -> do
unless (null warnings) $
info verbosity (formatWarnings warnings)
notice verbosity (formatWarnings warnings)
return pkg
(warnings, Left (mspecVersion, errors)) ->
throwIO $ CabalFileParseError pkgfilename content errors mspecVersion warnings
Expand Down

0 comments on commit 0bddf0e

Please sign in to comment.