diff --git a/Cabal/Distribution/PackageDescription/Check.hs b/Cabal/Distribution/PackageDescription/Check.hs index 8711107a61c947fb21c08c02d013ad042075ad55..314ed14c28af88099b01814400ad33fa78cc70aa 100644 --- a/Cabal/Distribution/PackageDescription/Check.hs +++ b/Cabal/Distribution/PackageDescription/Check.hs @@ -261,7 +261,7 @@ checkLibrary pkg lib = , checkVersion [1,25] (not (null (signatures lib))) $ PackageDistInexcusable $ "To use the 'signatures' field the package needs to specify " - ++ "at least 'cabal-version: >= 1.25'." + ++ "at least 'cabal-version: 2.0'." -- check that all autogen-modules appear on other-modules or exposed-modules , check @@ -1164,20 +1164,20 @@ 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.21'." + ++ "at least 'cabal-version: >= 1.22'." -- check use of thinning and renaming , checkVersion [1,25] usesBackpackIncludes $ PackageDistInexcusable $ "To use the 'mixins' field the package needs to specify " - ++ "at least 'cabal-version: >= 1.25'." + ++ "at least 'cabal-version: 2.0'." -- check use of 'extra-framework-dirs' field , checkVersion [1,23] (any (not . null) (buildInfoField extraFrameworkDirs)) $ -- 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.23'." + ++ " at least 'cabal-version: >= 1.24'." -- check use of default-extensions field -- don't need to do the equivalent check for other-extensions @@ -1225,7 +1225,7 @@ checkCabalVersion pkg = ++ "'build-depends' field: " ++ commaSep (map display depsUsingMajorBoundSyntax) ++ ". To use this new syntax the package need to specify at least " - ++ "'cabal-version: >= 2.0'. Alternatively, if broader compatibility " + ++ "'cabal-version: 2.0'. Alternatively, if broader compatibility " ++ "is important then use: " ++ commaSep [ display (Dependency name (eliminateMajorBoundSyntax versionRange)) | Dependency name versionRange <- depsUsingMajorBoundSyntax ] @@ -1316,7 +1316,7 @@ checkCabalVersion pkg = && isNothing (setupBuildInfo pkg) && buildType pkg == Custom) $ PackageBuildWarning $ - "Packages using 'cabal-version: >= 1.23' 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', " @@ -1326,8 +1326,8 @@ checkCabalVersion pkg = && isNothing (setupBuildInfo pkg) && buildType pkg == Custom) $ PackageDistSuspiciousWarn $ - "From version 1.23 cabal supports specifiying explicit dependencies " - ++ "for Custom setup scripts. Consider using cabal-version >= 1.23 and " + "From version 1.24 cabal supports specifiying explicit dependencies " + ++ "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', " @@ -1337,7 +1337,7 @@ checkCabalVersion pkg = && elem (autogenPathsModuleName pkg) allModuleNames && not (elem (autogenPathsModuleName pkg) allModuleNamesAutogen) ) $ PackageDistInexcusable $ - "Packages using 'cabal-version: >= 1.25' and the autogenerated " + "Packages using 'cabal-version: 2.0' and the autogenerated " ++ "module Paths_* must include it also on the 'autogen-modules' field " ++ "besides 'exposed-modules' and 'other-modules'. This specifies that " ++ "the module does not come with the package and is generated on " diff --git a/Cabal/doc/developing-packages.rst b/Cabal/doc/developing-packages.rst index 59c1133d2a0e29ca8e27c7a9eb68617469d1f01a..29a9dc15baba7c34104ad6e5733390d8b4924db0 100644 --- a/Cabal/doc/developing-packages.rst +++ b/Cabal/doc/developing-packages.rst @@ -830,7 +830,7 @@ describe the package as a whole: type. This field is optional and when missing, its default value is inferred according to the following rules: - - When :pkg-field:`cabal-version` is set to ``2.1`` or higher, + - When :pkg-field:`cabal-version` is set to ``2.2`` or higher, the default is ``Simple`` unless a :pkg-section:`custom-setup` exists, in which case the inferred default is ``Custom``. @@ -1102,7 +1102,7 @@ look something like this: name: foo version: 1.0 license: BSD3 - cabal-version: >= 1.23 + cabal-version: >= 1.24 build-type: Simple library foo-internal diff --git a/cabal-testsuite/PackageTests/AutogenModules/Package/setup.cabal.out b/cabal-testsuite/PackageTests/AutogenModules/Package/setup.cabal.out index 8c4b6b8d155a4a57cca99b27887c8ee946fb9c81..969342196a30df6ae1cdb8a34052076adfe513e4 100644 --- a/cabal-testsuite/PackageTests/AutogenModules/Package/setup.cabal.out +++ b/cabal-testsuite/PackageTests/AutogenModules/Package/setup.cabal.out @@ -14,7 +14,7 @@ An 'autogen-module' is neither on 'exposed-modules' or 'other-modules'. On executable 'Exe' an 'autogen-module' is not on 'other-modules' On test suite 'Test' an 'autogen-module' is not on 'other-modules' On benchmark 'Bench' an 'autogen-module' is not on 'other-modules' -Packages using 'cabal-version: >= 1.25' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. +Packages using 'cabal-version: 2.0' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. The filename ./my.cabal does not match package name (expected: AutogenModules.cabal) Note: the public hackage server would reject this package. Warning: Cannot run preprocessors. Run 'configure' command first. diff --git a/cabal-testsuite/PackageTests/AutogenModules/Package/setup.out b/cabal-testsuite/PackageTests/AutogenModules/Package/setup.out index 60ff78aa86441912d65f08650aacc7492a77d25e..c218a77fdd4bb1f2c305a463ea9c77edc0ebdd13 100644 --- a/cabal-testsuite/PackageTests/AutogenModules/Package/setup.out +++ b/cabal-testsuite/PackageTests/AutogenModules/Package/setup.out @@ -13,7 +13,7 @@ An 'autogen-module' is neither on 'exposed-modules' or 'other-modules'. On executable 'Exe' an 'autogen-module' is not on 'other-modules' On test suite 'Test' an 'autogen-module' is not on 'other-modules' On benchmark 'Bench' an 'autogen-module' is not on 'other-modules' -Packages using 'cabal-version: >= 1.25' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. +Packages using 'cabal-version: 2.0' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. The filename ./my.cabal does not match package name (expected: AutogenModules.cabal) Note: the public hackage server would reject this package. Warning: Cannot run preprocessors. Run 'configure' command first. diff --git a/cabal-testsuite/PackageTests/AutogenModules/Package/setup.test.hs b/cabal-testsuite/PackageTests/AutogenModules/Package/setup.test.hs index f31a01c11b2553d609d7b01586e1bc7abea3e39d..eaf49da6cbd204279a7cfd7ac093fec547cd072e 100644 --- a/cabal-testsuite/PackageTests/AutogenModules/Package/setup.test.hs +++ b/cabal-testsuite/PackageTests/AutogenModules/Package/setup.test.hs @@ -20,7 +20,7 @@ main = setupAndCabalTest $ do "On benchmark 'Bench' an 'autogen-module' is not on " ++ "'other-modules'" let pathsAutogenMsg = - "Packages using 'cabal-version: >= 1.25' and the autogenerated" + "Packages using 'cabal-version: 2.0' and the autogenerated" -- Asserts for the desired check messages after configure. assertOutputContains libAutogenMsg configureResult diff --git a/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.test.hs b/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.test.hs index 01725065b81d7c6c57ad19d3e7017818ecab2383..c5fbcf26bf8b1aeb8ab4b1b8b6bcbe6e3badfdcf 100644 --- a/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.test.hs +++ b/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.test.hs @@ -51,7 +51,7 @@ main = setupAndCabalTest $ do "On benchmark 'Bench' an 'autogen-module' is not on " ++ "'other-modules'" let pathsAutogenMsg = - "Packages using 'cabal-version: >= 1.25' and the autogenerated" + "Packages using 'cabal-version: 2.0' and the autogenerated" -- Asserts for the undesired check messages after configure. assertOutputDoesNotContain libAutogenMsg configureResult