Skip to content

Commit eb82769

Browse files
committed
fixup! Add PackageInfos_ (haskell#3909)
1 parent d0a92f9 commit eb82769

File tree

2 files changed

+19
-7
lines changed
  • Cabal/src/Distribution/PackageDescription
  • cabal-testsuite/PackageTests/Check/NonConfCheck/PathsExtensions

2 files changed

+19
-7
lines changed

Cabal/src/Distribution/PackageDescription/Check.hs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ data CheckExplanation =
231231
| SuspiciousFlagName [String]
232232
| DeclaredUsedFlags (Set FlagName) (Set FlagName)
233233
| NonASCIICustomField [String]
234-
| RebindableClash
234+
| RebindableClashPaths
235+
| RebindableClashPackageInfos
235236
| WErrorUnneeded String
236237
| JUnneeded String
237238
| FDeferTypeErrorsUnneeded String
@@ -699,12 +700,18 @@ ppExplanation (NonASCIICustomField nonAsciiXFields) =
699700
"Non ascii custom fields: " ++ unwords nonAsciiXFields ++ ". "
700701
++ "For better compatibility, custom field names "
701702
++ "shouldn't contain non-ascii characters."
702-
ppExplanation RebindableClash =
703+
ppExplanation RebindableClashPaths =
703704
"Packages using RebindableSyntax with OverloadedStrings or"
704705
++ " OverloadedLists in default-extensions, in conjunction with the"
705706
++ " autogenerated module Paths_*, are known to cause compile failures"
706707
++ " with Cabal < 2.2. To use these default-extensions with a Paths_*"
707708
++ " autogen module, specify at least 'cabal-version: 2.2'."
709+
ppExplanation RebindableClashPackageInfos =
710+
"Packages using RebindableSyntax with OverloadedStrings or"
711+
++ " OverloadedLists in default-extensions, in conjunction with the"
712+
++ " autogenerated module PackageInfos_*, are known to cause compile failures"
713+
++ " with Cabal < 2.2. To use these default-extensions with a Paths_*"
714+
++ " autogen module, specify at least 'cabal-version: 2.2'."
708715
ppExplanation (WErrorUnneeded fieldName) = addConditionalExp $
709716
"'" ++ fieldName ++ ": -Werror' makes the package easy to "
710717
++ "break with future GHC versions because new GHC versions often "
@@ -1936,18 +1943,22 @@ checkUnicodeXFields gpd
19361943

19371944
-- | cabal-version <2.2 + Paths_module + default-extensions: doesn't build.
19381945
checkPathsModuleExtensions :: PackageDescription -> [PackageCheck]
1939-
checkPathsModuleExtensions = checkAutogenModuleExtensions autogenPathsModuleName
1946+
checkPathsModuleExtensions = checkAutogenModuleExtensions autogenPathsModuleName RebindableClashPaths
19401947

19411948
-- | cabal-version <2.2 + PackageInfos_module + default-extensions: doesn't build.
19421949
checkPackageInfosModuleExtensions :: PackageDescription -> [PackageCheck]
1943-
checkPackageInfosModuleExtensions = checkAutogenModuleExtensions autogenPackageInfosModuleName
1950+
checkPackageInfosModuleExtensions = checkAutogenModuleExtensions autogenPackageInfosModuleName RebindableClashPackageInfos
19441951

19451952
-- | cabal-version <2.2 + *_module + default-extensions: doesn't build.
1946-
checkAutogenModuleExtensions :: (PackageDescription -> ModuleName) -> PackageDescription -> [PackageCheck]
1947-
checkAutogenModuleExtensions autogenModuleName pd
1953+
checkAutogenModuleExtensions ::
1954+
(PackageDescription -> ModuleName) ->
1955+
CheckExplanation ->
1956+
PackageDescription ->
1957+
[PackageCheck]
1958+
checkAutogenModuleExtensions autogenModuleName explanation pd
19481959
| specVersion pd >= CabalSpecV2_2 = []
19491960
| any checkBI (allBuildInfo pd) || any checkLib (allLibraries pd)
1950-
= return (PackageBuildImpossible RebindableClash)
1961+
= return (PackageBuildImpossible explanation)
19511962
| otherwise = []
19521963
where
19531964
mn = autogenModuleName pd
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# cabal check
22
Warning: The package will not build sanely due to these errors:
33
Warning: Packages using RebindableSyntax with OverloadedStrings or OverloadedLists in default-extensions, in conjunction with the autogenerated module Paths_*, are known to cause compile failures with Cabal < 2.2. To use these default-extensions with a Paths_* autogen module, specify at least 'cabal-version: 2.2'.
4+
Warning: Packages using RebindableSyntax with OverloadedStrings or OverloadedLists in default-extensions, in conjunction with the autogenerated module Paths_*, are known to cause compile failures with Cabal < 2.2. To use these default-extensions with a PackageInfos_* autogen module, specify at least 'cabal-version: 2.2'.
45
Warning: Hackage would reject this package.

0 commit comments

Comments
 (0)