Skip to content

Commit

Permalink
Knock the pre-distribution checks down to just warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
quasicomputational authored and typedrat committed Jul 9, 2018
1 parent bb87599 commit 7d39aa0
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
7 changes: 5 additions & 2 deletions Cabal/Distribution/PackageDescription/Check.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2157,6 +2157,9 @@ checkTarPath path
-- and package-creation environment. Hence we can use IO, rather than needing
-- to pass a 'CheckPackageContentOps' dictionary around.
checkPackageFilesPreDistribution :: Verbosity -> PackageDescription -> FilePath -> NoCallStackIO [PackageCheck]
-- Note: this really shouldn't return any 'Inexcusable' warnings,
-- because that will make us say that Hackage would reject the package.
-- But, because Hackage doesn't run these tests, that will be a lie!
checkPackageFilesPreDistribution = checkGlobFiles

-- | Discover problems with the package's wildcards.
Expand All @@ -2169,7 +2172,7 @@ checkGlobFiles verbosity pkg root =
results <- matchDirFileGlob' verbosity (specVersion pkg) (root </> dir) glob
let individualWarnings = results >>= getWarning field glob
noMatchesWarning =
[ PackageDistInexcusable $
[ PackageDistSuspiciousWarn $
"In '" ++ field ++ "': the pattern '" ++ glob ++ "' does not"
++ " match any files."
| all (not . suppressesNoMatchesWarning) results
Expand Down Expand Up @@ -2206,7 +2209,7 @@ checkGlobFiles verbosity pkg root =
++ " To enable looser suffix-only matching, set 'cabal-version: 2.4' or higher."
]
getWarning field glob (GlobMissingDirectory dir) =
[ PackageDistInexcusable $
[ PackageDistSuspiciousWarn $
"In '" ++ field ++ "': the pattern '" ++ glob ++ "' attempts to"
++ " match files in the directory '" ++ dir ++ "', but there is no"
++ " directory by that name."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# cabal check
Warning: The package will not build sanely due to these errors:
Warning: This package description follows version 2.4 of the Cabal specification. This tool only supports up to version 2.3.0.0.
Warning: The following errors will cause portability problems on other environments:
Warning: These warnings may cause trouble when distributing the package:
Warning: In 'data-files': the pattern 'another-non-existent-directory/**/*.dat' attempts to match files in the directory 'another-non-existent-directory', but there is no directory by that name.
Warning: In 'extra-doc-files': the pattern 'non-existent-directory/*.html' attempts to match files in the directory 'non-existent-directory', but there is no directory by that name.
Warning: In 'extra-doc-files': the pattern 'present/present/missing/*.tex' attempts to match files in the directory 'present/present/missing', but there is no directory by that name.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# cabal check
Warning: The following errors will cause portability problems on other environments:
Warning: These warnings may cause trouble when distributing the package:
Warning: In 'data-files': the pattern 'non-existent-directory/*.dat' attempts to match files in the directory 'non-existent-directory', but there is no directory by that name.
Warning: Hackage would reject this package.
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
import Test.Cabal.Prelude
main = cabalTest $
fails $ cabal "check" []
main = cabalTest $ cabal "check" []
3 changes: 1 addition & 2 deletions cabal-testsuite/PackageTests/Check/NoGlobMatches/cabal.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# cabal check
Warning: The following errors will cause portability problems on other environments:
Warning: These warnings may cause trouble when distributing the package:
Warning: In 'extra-doc-files': the pattern '*.html' does not match any files.
Warning: Hackage would reject this package.
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
import Test.Cabal.Prelude
main = cabalTest $
fails $ cabal "check" []
main = cabalTest $ cabal "check" []

0 comments on commit 7d39aa0

Please sign in to comment.