Skip to content

Commit

Permalink
Drop >= in suggestions to cabal-version (fix haskell#7088)
Browse files Browse the repository at this point in the history
Co-authored-by:    Jeremy Scott <[email protected]>
Co-authored-by:    Artem Pelenitsyn <[email protected]>
  • Loading branch information
Jeremy Scott and ulysses4ever committed Jun 10, 2022
1 parent 87bfc00 commit 1930167
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Cabal/src/Distribution/PackageDescription/Check.hs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ checkExecutable pkg exe =
&& takeExtension (modulePath exe) `notElem` [".hs", ".lhs"]) $
PackageDistInexcusable $
"The package uses a C/C++/obj-C source file for the 'main-is' field. "
++ "To use this feature you must specify 'cabal-version: >= 1.18'."
++ "To use this feature you must specify 'cabal-version: 1.18'."

-- check that all autogen-modules appear on other-modules
, check
Expand Down Expand Up @@ -343,7 +343,7 @@ checkTestSuite pkg test =
, checkSpecVersion pkg CabalSpecV1_18 (mainIsNotHsExt && not mainIsWrongExt) $
PackageDistInexcusable $
"The package uses a C/C++/obj-C source file for the 'main-is' field. "
++ "To use this feature you must specify 'cabal-version: >= 1.18'."
++ "To use this feature you must specify 'cabal-version: 1.18'."

-- check that all autogen-modules appear on other-modules
, check
Expand Down Expand Up @@ -654,7 +654,7 @@ checkOldLicense pkg lic = catMaybes
PackageDistInexcusable $
"Unfortunately the license " ++ quote (prettyShow (license pkg))
++ " messes up the parser in earlier Cabal versions so you need to "
++ "specify 'cabal-version: >= 1.4'. Alternatively if you require "
++ "specify 'cabal-version: 1.4'. Alternatively if you require "
++ "compatibility with earlier Cabal versions then use 'OtherLicense'."

, case lic of
Expand Down Expand Up @@ -1168,7 +1168,7 @@ checkCabalVersion pkg =
PackageDistInexcusable $
"The 'test-suite' section is new in Cabal 1.10. "
++ "Unfortunately it messes up the parser in older Cabal versions "
++ "so you must specify at least 'cabal-version: >= 1.8', but note "
++ "so you must specify at least 'cabal-version: 1.8', but note "
++ "that only Cabal 1.10 and later can actually run such test suites."

-- check use of default-language field
Expand All @@ -1192,7 +1192,7 @@ checkCabalVersion pkg =
(not . null $ extraDocFiles pkg) $
PackageDistInexcusable $
"To use the 'extra-doc-files' field the package needs to specify "
++ "at least 'cabal-version: >= 1.18'."
++ "at least 'cabal-version: 1.18'."

, checkVersion CabalSpecV2_0
(not (null (subLibraries pkg))) $
Expand All @@ -1205,7 +1205,7 @@ checkCabalVersion pkg =
(any (not.null.reexportedModules) (allLibraries pkg)) $
PackageDistInexcusable $
"To use the 'reexported-module' field the package needs to specify "
++ "at least 'cabal-version: >= 1.22'."
++ "at least 'cabal-version: 1.22'."

-- check use of thinning and renaming
, checkVersion CabalSpecV2_0 usesBackpackIncludes $
Expand All @@ -1218,7 +1218,7 @@ checkCabalVersion pkg =
-- Just a warning, because this won't break on old Cabal versions.
PackageDistSuspiciousWarn $
"To use the 'extra-framework-dirs' field the package needs to specify"
++ " at least 'cabal-version: >= 1.24'."
++ " at least 'cabal-version: 1.24'."

-- check use of default-extensions field
-- don't need to do the equivalent check for other-extensions
Expand Down Expand Up @@ -1267,15 +1267,15 @@ checkCabalVersion pkg =
PackageDistInexcusable $
"The 'source-repository' section is new in Cabal 1.6. "
++ "Unfortunately it messes up the parser in earlier Cabal versions "
++ "so you need to specify 'cabal-version: >= 1.6'."
++ "so you need to specify 'cabal-version: 1.6'."

-- check for new language extensions
, checkVersion CabalSpecV1_2 (not (null mentionedExtensionsThatNeedCabal12)) $
PackageDistInexcusable $
"Unfortunately the language extensions "
++ commaSep (map (quote . prettyShow) mentionedExtensionsThatNeedCabal12)
++ " break the parser in earlier Cabal versions so you need to "
++ "specify 'cabal-version: >= 1.2'. Alternatively if you require "
++ "specify 'cabal-version: 1.2'. Alternatively if you require "
++ "compatibility with earlier Cabal versions then you may be able to "
++ "use an equivalent compiler-specific flag."

Expand All @@ -1284,15 +1284,15 @@ checkCabalVersion pkg =
"Unfortunately the language extensions "
++ commaSep (map (quote . prettyShow) mentionedExtensionsThatNeedCabal14)
++ " break the parser in earlier Cabal versions so you need to "
++ "specify 'cabal-version: >= 1.4'. Alternatively if you require "
++ "specify 'cabal-version: 1.4'. Alternatively if you require "
++ "compatibility with earlier Cabal versions then you may be able to "
++ "use an equivalent compiler-specific flag."

, check (specVersion pkg >= CabalSpecV1_24
&& isNothing (setupBuildInfo pkg)
&& buildType pkg == Custom) $
PackageBuildWarning $
"Packages using 'cabal-version: >= 1.24' with 'build-type: Custom' "
"Packages using 'cabal-version: 1.24' with 'build-type: Custom' "
++ "must use a 'custom-setup' section with a 'setup-depends' field "
++ "that specifies the dependencies of the Setup.hs script itself. "
++ "The 'setup-depends' field uses the same syntax as 'build-depends', "
Expand All @@ -1303,7 +1303,7 @@ checkCabalVersion pkg =
&& buildType pkg == Custom) $
PackageDistSuspiciousWarn $
"From version 1.24 cabal supports specifying explicit dependencies "
++ "for Custom setup scripts. Consider using cabal-version >= 1.24 and "
++ "for Custom setup scripts. Consider using 'cabal-version: 1.24' and "
++ "adding a 'custom-setup' section with a 'setup-depends' field "
++ "that specifies the dependencies of the Setup.hs script itself. "
++ "The 'setup-depends' field uses the same syntax as 'build-depends', "
Expand Down

0 comments on commit 1930167

Please sign in to comment.