diff --git a/Cabal/Cabal.cabal b/Cabal/Cabal.cabal index 1407e0602db..3fcf2a78b83 100644 --- a/Cabal/Cabal.cabal +++ b/Cabal/Cabal.cabal @@ -246,6 +246,7 @@ extra-source-files: tests/ParserTests/warnings/nbsp.cabal tests/ParserTests/warnings/newsyntax.cabal tests/ParserTests/warnings/oldsyntax.cabal + tests/ParserTests/warnings/operator.cabal tests/ParserTests/warnings/subsection.cabal tests/ParserTests/warnings/tab.cabal tests/ParserTests/warnings/trailingfield.cabal @@ -253,6 +254,7 @@ extra-source-files: tests/ParserTests/warnings/unknownsection.cabal tests/ParserTests/warnings/utf8.cabal tests/ParserTests/warnings/versiontag.cabal + tests/ParserTests/warnings/wildcard.cabal tests/cbits/rpmvercmp.c tests/hackage/check.sh tests/hackage/download.sh diff --git a/Cabal/Distribution/PackageDescription/Check.hs b/Cabal/Distribution/PackageDescription/Check.hs index ea87359b392..63a83f23214 100644 --- a/Cabal/Distribution/PackageDescription/Check.hs +++ b/Cabal/Distribution/PackageDescription/Check.hs @@ -1253,40 +1253,6 @@ checkCabalVersion pkg = ++ "the 'other-extensions' field lists extensions that are used in " ++ "some modules, e.g. via the {-# LANGUAGE #-} pragma." - -- check use of "foo (>= 1.0 && < 1.4) || >=1.8 " version-range syntax - , checkVersion [1,8] (not (null versionRangeExpressions)) $ - PackageDistInexcusable $ - "The package uses full version-range expressions " - ++ "in a 'build-depends' field: " - ++ commaSep (map displayRawDependency versionRangeExpressions) - ++ ". To use this new syntax the package needs to specify at least " - ++ "'cabal-version: >= 1.8'. Alternatively, if broader compatibility " - ++ "is important, then convert to conjunctive normal form, and use " - ++ "multiple 'build-depends:' lines, one conjunct per line." - - -- check use of "build-depends: foo == 1.*" syntax - , checkVersion [1,6] (not (null depsUsingWildcardSyntax)) $ - PackageDistInexcusable $ - "The package uses wildcard syntax in the 'build-depends' field: " - ++ commaSep (map prettyShow depsUsingWildcardSyntax) - ++ ". To use this new syntax the package need to specify at least " - ++ "'cabal-version: >= 1.6'. Alternatively, if broader compatibility " - ++ "is important then use: " ++ commaSep - [ prettyShow (Dependency name (eliminateWildcardSyntax versionRange) Set.empty) - | Dependency name versionRange _ <- depsUsingWildcardSyntax ] - - -- check use of "build-depends: foo ^>= 1.2.3" syntax - , checkVersion [2,0] (not (null depsUsingMajorBoundSyntax)) $ - PackageDistInexcusable $ - "The package uses major bounded version syntax in the " - ++ "'build-depends' field: " - ++ commaSep (map prettyShow depsUsingMajorBoundSyntax) - ++ ". To use this new syntax the package need to specify at least " - ++ "'cabal-version: 2.0'. Alternatively, if broader compatibility " - ++ "is important then use: " ++ commaSep - [ prettyShow (Dependency name (eliminateMajorBoundSyntax versionRange) Set.empty) - | Dependency name versionRange _ <- depsUsingMajorBoundSyntax ] - , checkVersion [3,0] (any (not . null) (concatMap buildInfoField [ asmSources @@ -1312,26 +1278,6 @@ checkCabalVersion pkg = "The use of 'virtual-modules' requires the package " ++ " to specify at least 'cabal-version: >= 2.1'." - -- check use of "tested-with: GHC (>= 1.0 && < 1.4) || >=1.8 " syntax - , checkVersion [1,8] (not (null testedWithVersionRangeExpressions)) $ - PackageDistInexcusable $ - "The package uses full version-range expressions " - ++ "in a 'tested-with' field: " - ++ commaSep (map displayRawDependency testedWithVersionRangeExpressions) - ++ ". To use this new syntax the package needs to specify at least " - ++ "'cabal-version: >= 1.8'." - - -- check use of "tested-with: GHC == 6.12.*" syntax - , checkVersion [1,6] (not (null testedWithUsingWildcardSyntax)) $ - PackageDistInexcusable $ - "The package uses wildcard syntax in the 'tested-with' field: " - ++ commaSep (map prettyShow testedWithUsingWildcardSyntax) - ++ ". To use this new syntax the package need to specify at least " - ++ "'cabal-version: >= 1.6'. Alternatively, if broader compatibility " - ++ "is important then use: " ++ commaSep - [ prettyShow (Dependency name (eliminateWildcardSyntax versionRange) Set.empty) - | Dependency name versionRange _ <- testedWithUsingWildcardSyntax ] - -- check use of "source-repository" section , checkVersion [1,6] (not (null (sourceRepos pkg))) $ PackageDistInexcusable $ @@ -1403,15 +1349,6 @@ checkCabalVersion pkg = buildInfoField field = map field (allBuildInfo pkg) - versionRangeExpressions = - [ dep | dep@(Dependency _ vr _) <- allBuildDepends pkg - , usesNewVersionRangeSyntax vr ] - - testedWithVersionRangeExpressions = - [ Dependency (mkPackageName (prettyShow compiler)) vr Set.empty - | (compiler, vr) <- testedWith pkg - , usesNewVersionRangeSyntax vr ] - simpleSpecVersionRangeSyntax = either (const True) (cataVersionRange alg) (specVersionRaw pkg) where @@ -1422,63 +1359,8 @@ checkCabalVersion pkg = simpleSpecVersionSyntax = either (const True) (const False) (specVersionRaw pkg) - usesNewVersionRangeSyntax :: VersionRange -> Bool - usesNewVersionRangeSyntax - = (> 2) -- uses the new syntax if depth is more than 2 - . cataVersionRange alg - where - alg (UnionVersionRangesF a b) = a + b - alg (IntersectVersionRangesF a b) = a + b - alg (VersionRangeParensF _) = 3 - alg _ = 1 :: Int - - depsUsingWildcardSyntax = [ dep | dep@(Dependency _ vr _) <- allBuildDepends pkg - , usesWildcardSyntax vr ] - - depsUsingMajorBoundSyntax = [ dep | dep@(Dependency _ vr _) <- allBuildDepends pkg - , usesMajorBoundSyntax vr ] - usesBackpackIncludes = any (not . null . mixins) (allBuildInfo pkg) - testedWithUsingWildcardSyntax = - [ Dependency (mkPackageName (prettyShow compiler)) vr Set.empty - | (compiler, vr) <- testedWith pkg - , usesWildcardSyntax vr ] - - usesWildcardSyntax :: VersionRange -> Bool - usesWildcardSyntax = cataVersionRange alg - where - alg (WildcardVersionF _) = True - alg (UnionVersionRangesF a b) = a || b - alg (IntersectVersionRangesF a b) = a || b - alg (VersionRangeParensF a) = a - alg _ = False - - -- NB: this eliminates both, WildcardVersion and MajorBoundVersion - -- because when WildcardVersion is not support, neither is MajorBoundVersion - eliminateWildcardSyntax = hyloVersionRange embed projectVersionRange - where - embed (WildcardVersionF v) = intersectVersionRanges - (orLaterVersion v) (earlierVersion (wildcardUpperBound v)) - embed (MajorBoundVersionF v) = intersectVersionRanges - (orLaterVersion v) (earlierVersion (majorUpperBound v)) - embed vr = embedVersionRange vr - - usesMajorBoundSyntax :: VersionRange -> Bool - usesMajorBoundSyntax = cataVersionRange alg - where - alg (MajorBoundVersionF _) = True - alg (UnionVersionRangesF a b) = a || b - alg (IntersectVersionRangesF a b) = a || b - alg (VersionRangeParensF a) = a - alg _ = False - - eliminateMajorBoundSyntax = hyloVersionRange embed projectVersionRange - where - embed (MajorBoundVersionF v) = intersectVersionRanges - (orLaterVersion v) (earlierVersion (majorUpperBound v)) - embed vr = embedVersionRange vr - mentionedExtensions = [ ext | bi <- allBuildInfo pkg , ext <- allExtensions bi ] mentionedExtensionsThatNeedCabal12 = @@ -1529,11 +1411,6 @@ checkCabalVersion pkg = allModuleNamesAutogen = concatMap autogenModules (allBuildInfo pkg) -displayRawDependency :: Dependency -> String -displayRawDependency (Dependency pkg vr _sublibs) = - prettyShow pkg ++ " " ++ prettyShow vr - - -- ------------------------------------------------------------ -- * Checks on the GenericPackageDescription -- ------------------------------------------------------------ diff --git a/Cabal/Distribution/Parsec.hs b/Cabal/Distribution/Parsec.hs index 28abf8d4d45..3953053d120 100644 --- a/Cabal/Distribution/Parsec.hs +++ b/Cabal/Distribution/Parsec.hs @@ -9,9 +9,12 @@ module Distribution.Parsec ( runParsecParser, runParsecParser', simpleParsec, + simpleParsec', + simpleParsecW', lexemeParsec, eitherParsec, explicitEitherParsec, + explicitEitherParsec', -- * CabalParsing and and diagnostics CabalParsing (..), -- ** Warnings @@ -171,6 +174,25 @@ simpleParsec . runParsecParser lexemeParsec "" . fieldLineStreamFromString +-- | Parse a 'String' with 'lexemeParsec' using specific 'CabalSpecVersion'. +-- +-- @since 3.4.0.0 +simpleParsec' :: Parsec a => CabalSpecVersion -> String -> Maybe a +simpleParsec' spec + = either (const Nothing) Just + . runParsecParser' spec lexemeParsec "" + . fieldLineStreamFromString + +-- | Parse a 'String' with 'lexemeParsec' using specific 'CabalSpecVersion'. +-- Fail if there are any warnings. +-- +-- @since 3.4.0.0 +simpleParsecW' :: Parsec a => CabalSpecVersion -> String -> Maybe a +simpleParsecW' spec + = either (const Nothing) (\(x, ws) -> if null ws then Just x else Nothing) + . runParsecParser' spec ((,) <$> lexemeParsec <*> liftParsec Parsec.getState) "" + . fieldLineStreamFromString + -- | Parse a 'String' with 'lexemeParsec'. eitherParsec :: Parsec a => String -> Either String a eitherParsec = explicitEitherParsec parsec @@ -182,6 +204,17 @@ explicitEitherParsec parser . runParsecParser (parser <* P.spaces) "" . fieldLineStreamFromString +-- | Parse a 'String' with given 'ParsecParser' and 'CabalSpecVersion'. Trailing whitespace is accepted. +-- See 'explicitEitherParsec'. +-- +-- @since 3.4.0.0 +-- +explicitEitherParsec' :: CabalSpecVersion -> ParsecParser a -> String -> Either String a +explicitEitherParsec' spec parser + = either (Left . show) Right + . runParsecParser' spec (parser <* P.spaces) "" + . fieldLineStreamFromString + -- | Run 'ParsecParser' with 'cabalSpecLatest'. runParsecParser :: ParsecParser a -> FilePath -> FieldLineStream -> Either Parsec.ParseError a runParsecParser = runParsecParser' cabalSpecLatest diff --git a/Cabal/Distribution/Parsec/Warning.hs b/Cabal/Distribution/Parsec/Warning.hs index 4db993211c1..8a09f79ec44 100644 --- a/Cabal/Distribution/Parsec/Warning.hs +++ b/Cabal/Distribution/Parsec/Warning.hs @@ -35,6 +35,9 @@ data PWarnType | PWTDoubleDash -- ^ Double dash token, most likely it's a mistake - it's not a comment | PWTMultipleSingularField -- ^ e.g. name or version should be specified only once. | PWTBuildTypeDefault -- ^ Workaround for derive-package having build-type: Default. See . + + | PWTVersionOperator -- ^ Version operators used (without cabal-version: 1.8) + | PWTVersionWildcard -- ^ Version wildcard used (without cabal-version: 1.6) deriving (Eq, Ord, Show, Enum, Bounded, Generic) instance Binary PWarnType diff --git a/Cabal/Distribution/Types/PkgconfigVersionRange.hs b/Cabal/Distribution/Types/PkgconfigVersionRange.hs index faa704f5fb6..177a57c9171 100644 --- a/Cabal/Distribution/Types/PkgconfigVersionRange.hs +++ b/Cabal/Distribution/Types/PkgconfigVersionRange.hs @@ -69,7 +69,7 @@ instance Parsec PkgconfigVersionRange where csv <- askCabalSpecVersion if csv >= CabalSpecV3_0 then pkgconfigParser - else versionRangeToPkgconfigVersionRange <$> versionRangeParser P.integral + else versionRangeToPkgconfigVersionRange <$> versionRangeParser P.integral csv -- "modern" parser of @pkg-config@ package versions. pkgconfigParser :: CabalParsing m => m PkgconfigVersionRange diff --git a/Cabal/Distribution/Types/VersionRange/Internal.hs b/Cabal/Distribution/Types/VersionRange/Internal.hs index 1a7833f1698..98c0d8b0e60 100644 --- a/Cabal/Distribution/Types/VersionRange/Internal.hs +++ b/Cabal/Distribution/Types/VersionRange/Internal.hs @@ -262,8 +262,40 @@ instance Pretty VersionRange where punct p p' | p < p' = Disp.parens | otherwise = id +-- | +-- +-- >>> simpleParsec "^>= 3.4" :: Maybe VersionRange +-- Just (MajorBoundVersion (mkVersion [3,4])) +-- +-- Small history: +-- +-- Set operations are introduced in 3.0 +-- +-- >>> map (`simpleParsec'` "^>= { 1.2 , 1.3 }") [CabalSpecV2_4, CabalSpecV3_0] :: [Maybe VersionRange] +-- [Nothing,Just (UnionVersionRanges (MajorBoundVersion (mkVersion [1,2])) (MajorBoundVersion (mkVersion [1,3])))] +-- +-- @^>=@ is introduced in 2.0 +-- +-- >>> map (`simpleParsec'` "^>=1.2") [CabalSpecV1_24, CabalSpecV2_0] :: [Maybe VersionRange] +-- [Nothing,Just (MajorBoundVersion (mkVersion [1,2]))] +-- +-- @-none@ is introduced in 1.22 +-- +-- >>> map (`simpleParsec'` "-none") [CabalSpecV1_20, CabalSpecV1_22] :: [Maybe VersionRange] +-- [Nothing,Just (IntersectVersionRanges (LaterVersion (mkVersion [1])) (EarlierVersion (mkVersion [1])))] +-- +-- Operators are introduced in 1.8. Issues only a warning. +-- +-- >>> map (`simpleParsecW'` "== 1 || ==2") [CabalSpecV1_6, CabalSpecV1_8] :: [Maybe VersionRange] +-- [Nothing,Just (UnionVersionRanges (ThisVersion (mkVersion [1])) (ThisVersion (mkVersion [2])))] +-- +-- Wild-version ranges are introduced in 1.6. Issues only a warning. +-- +-- >>> map (`simpleParsecW'` "== 1.2.*") [CabalSpecV1_4, CabalSpecV1_6] :: [Maybe VersionRange] +-- [Nothing,Just (WildcardVersion (mkVersion [1,2]))] +-- instance Parsec VersionRange where - parsec = versionRangeParser versionDigitParser + parsec = askCabalSpecVersion >>= versionRangeParser versionDigitParser instance Described VersionRange where describe _ = RERec "version-range" $ REUnion @@ -301,13 +333,14 @@ instance Described VersionRange where -- versions, 'PkgConfigVersionRange'. -- -- @since 3.0 -versionRangeParser :: forall m. CabalParsing m => m Int -> m VersionRange -versionRangeParser digitParser = expr +versionRangeParser :: forall m. CabalParsing m => m Int -> CabalSpecVersion -> m VersionRange +versionRangeParser digitParser csv = expr where expr = do P.spaces t <- term P.spaces (do _ <- P.string "||" + checkOp P.spaces e <- expr return (unionVersionRanges t e) @@ -316,6 +349,7 @@ versionRangeParser digitParser = expr term = do f <- factor P.spaces (do _ <- P.string "&&" + checkOp P.spaces t <- term return (intersectVersionRanges f t) @@ -331,6 +365,7 @@ versionRangeParser digitParser = expr "==" -> do P.spaces (do (wild, v) <- verOrWild + checkWild wild pure $ (if wild then withinVersion else thisVersion) v <|> (verSet' thisVersion =<< verSet)) @@ -356,6 +391,27 @@ versionRangeParser digitParser = expr ">" -> pure $ laterVersion v _ -> fail $ "Unknown version operator " ++ show op + -- Cannot be warning + -- On 2020-03-16 there was around 27400 files on Hackage failing to parse due this + -- For example https://hackage.haskell.org/package/haxr-3000.0.0/haxr.cabal + -- + checkOp = when (csv < CabalSpecV1_8) $ + parsecWarning PWTVersionOperator $ unwords + [ "version operators used." + , "To use version operators the package needs to specify at least 'cabal-version: >= 1.8'." + ] + + -- Cannot be warning + -- On 2020-03-16 there was 46 files on Hackage failing to parse due this + -- For example https://hackage.haskell.org/package/derive-0.1.2/derive.cabal + -- + checkWild False = pure () + checkWild True = when (csv < CabalSpecV1_6) $ + parsecWarning PWTVersionWildcard $ unwords + [ "Wildcard syntax used." + , "To use version wildcards the package needs to specify at least 'cabal-version: >= 1.6'." + ] + -- https://gitlab.haskell.org/ghc/ghc/issues/17752 isOpChar '<' = True isOpChar '=' = True @@ -364,13 +420,8 @@ versionRangeParser digitParser = expr isOpChar '-' = True isOpChar _ = False - -- Note: There are other features: - -- && and || since 1.8 - -- x.y.* (wildcard) since 1.6 - -- -none version range is available since 1.22 - noVersion' = do - csv <- askCabalSpecVersion + noVersion' = if csv >= CabalSpecV1_22 then pure noVersion else fail $ unwords @@ -381,8 +432,7 @@ versionRangeParser digitParser = expr ] -- ^>= is available since 2.0 - majorBoundVersion' v = do - csv <- askCabalSpecVersion + majorBoundVersion' v = if csv >= CabalSpecV2_0 then pure $ majorBoundVersion v else fail $ unwords @@ -398,8 +448,7 @@ versionRangeParser digitParser = expr embed vr = embedVersionRange vr -- version set notation (e.g. "== { 0.0.1.0, 0.0.2.0, 0.1.0.0 }") - verSet' op vs = do - csv <- askCabalSpecVersion + verSet' op vs = if csv >= CabalSpecV3_0 then pure $ foldr1 unionVersionRanges (fmap op vs) else fail $ unwords diff --git a/Cabal/tests/ParserTests.hs b/Cabal/tests/ParserTests.hs index dc7d41a6d34..8301658a057 100644 --- a/Cabal/tests/ParserTests.hs +++ b/Cabal/tests/ParserTests.hs @@ -66,7 +66,8 @@ warningTests = testGroup "warnings triggered" , warningTest PWTTrailingFields "trailingfield.cabal" , warningTest PWTDoubleDash "doubledash.cabal" , warningTest PWTMultipleSingularField "multiplesingular.cabal" - , warningTest PWTMultipleSingularField "multiplesingular.cabal" + , warningTest PWTVersionWildcard "wildcard.cabal" + , warningTest PWTVersionOperator "operator.cabal" -- TODO: not implemented yet -- , warningTest PWTExtraTestModule "extratestmodule.cabal" ] diff --git a/Cabal/tests/ParserTests/warnings/bom.cabal b/Cabal/tests/ParserTests/warnings/bom.cabal index 647fe2de346..43c96c2a8c4 100644 --- a/Cabal/tests/ParserTests/warnings/bom.cabal +++ b/Cabal/tests/ParserTests/warnings/bom.cabal @@ -1,6 +1,6 @@ name: bom version: 1 -cabal-version: >= 1.6 +cabal-version: >= 1.8 library build-depends: base >= 4.9 && <4.10 diff --git a/Cabal/tests/ParserTests/warnings/bool.cabal b/Cabal/tests/ParserTests/warnings/bool.cabal index e38d26ce4fe..34e6e0f8f22 100644 --- a/Cabal/tests/ParserTests/warnings/bool.cabal +++ b/Cabal/tests/ParserTests/warnings/bool.cabal @@ -1,6 +1,6 @@ name: bool version: 1 -cabal-version: >= 1.6 +cabal-version: >= 1.8 flag foo manual: true diff --git a/Cabal/tests/ParserTests/warnings/deprecatedfield.cabal b/Cabal/tests/ParserTests/warnings/deprecatedfield.cabal index 19283567dc3..d60ba1615c4 100644 --- a/Cabal/tests/ParserTests/warnings/deprecatedfield.cabal +++ b/Cabal/tests/ParserTests/warnings/deprecatedfield.cabal @@ -1,6 +1,6 @@ name: deprecatedfield version: 1 -cabal-version: >= 1.6 +cabal-version: >= 1.8 library build-depends: base >= 4.9 && <4.10 diff --git a/Cabal/tests/ParserTests/warnings/doubledash.cabal b/Cabal/tests/ParserTests/warnings/doubledash.cabal index e6347bef9df..a56d44f4f36 100644 --- a/Cabal/tests/ParserTests/warnings/doubledash.cabal +++ b/Cabal/tests/ParserTests/warnings/doubledash.cabal @@ -1,6 +1,6 @@ name: bool version: 1 -cabal-version: >= 1.6 +cabal-version: >= 1.8 extra-source-files: README.md -- we include it diff --git a/Cabal/tests/ParserTests/warnings/multiplesingular.cabal b/Cabal/tests/ParserTests/warnings/multiplesingular.cabal index bb41d951151..0ede1e065b0 100644 --- a/Cabal/tests/ParserTests/warnings/multiplesingular.cabal +++ b/Cabal/tests/ParserTests/warnings/multiplesingular.cabal @@ -1,7 +1,7 @@ name: multiplesingular name: multiplesingular2 version: 1 -cabal-version: >= 1.6 +cabal-version: >= 1.8 library build-depends: base >= 4.9 && <4.10 diff --git a/Cabal/tests/ParserTests/warnings/nbsp.cabal b/Cabal/tests/ParserTests/warnings/nbsp.cabal index 6c1470053d8..0a72072d877 100644 --- a/Cabal/tests/ParserTests/warnings/nbsp.cabal +++ b/Cabal/tests/ParserTests/warnings/nbsp.cabal @@ -1,6 +1,6 @@ name: nbsp version: 1 -cabal-version: >= 1.6 +cabal-version: >= 1.8 library   build-depends: base >= 4.9 && <4.10 diff --git a/Cabal/tests/ParserTests/warnings/newsyntax.cabal b/Cabal/tests/ParserTests/warnings/newsyntax.cabal index 2b37110f56c..c751ee4c92f 100644 --- a/Cabal/tests/ParserTests/warnings/newsyntax.cabal +++ b/Cabal/tests/ParserTests/warnings/newsyntax.cabal @@ -2,5 +2,5 @@ name: newsyntax version: 1 library - build-depends: base >= 4.9 && <4.10 + build-depends: base hs-source-dirs: . diff --git a/Cabal/tests/ParserTests/warnings/oldsyntax.cabal b/Cabal/tests/ParserTests/warnings/oldsyntax.cabal index 6b6aa1c8bf2..01355b67a7b 100644 --- a/Cabal/tests/ParserTests/warnings/oldsyntax.cabal +++ b/Cabal/tests/ParserTests/warnings/oldsyntax.cabal @@ -1,6 +1,6 @@ name: oldsyntax version: 1 -cabal-version: >= 1.6 +cabal-version: >= 1.8 build-depends: base >= 4.9 && <4.10 hs-source-dirs: . diff --git a/Cabal/tests/ParserTests/warnings/operator.cabal b/Cabal/tests/ParserTests/warnings/operator.cabal new file mode 100644 index 00000000000..0c9737d2dd3 --- /dev/null +++ b/Cabal/tests/ParserTests/warnings/operator.cabal @@ -0,0 +1,7 @@ +name: version-operator +version: 1 +cabal-version: >= 1.6 + +library + build-depends: base >= 4.9 && <4.10 + hs-source-dirs: . diff --git a/Cabal/tests/ParserTests/warnings/subsection.cabal b/Cabal/tests/ParserTests/warnings/subsection.cabal index ee66d140045..4e02929b3ee 100644 --- a/Cabal/tests/ParserTests/warnings/subsection.cabal +++ b/Cabal/tests/ParserTests/warnings/subsection.cabal @@ -1,6 +1,6 @@ name: subsection version: 1 -cabal-version: >= 1.6 +cabal-version: >= 1.8 library build-depends: base >= 4.9 && <4.10 diff --git a/Cabal/tests/ParserTests/warnings/tab.cabal b/Cabal/tests/ParserTests/warnings/tab.cabal index cddedd9def4..afdc02c9115 100644 --- a/Cabal/tests/ParserTests/warnings/tab.cabal +++ b/Cabal/tests/ParserTests/warnings/tab.cabal @@ -1,6 +1,6 @@ name: tab version: 1 -cabal-version: >= 1.6 +cabal-version: >= 1.8 library build-depends: { base >= 4.9 && <4.10 } diff --git a/Cabal/tests/ParserTests/warnings/trailingfield.cabal b/Cabal/tests/ParserTests/warnings/trailingfield.cabal index 955b903ac6a..f35618048c6 100644 --- a/Cabal/tests/ParserTests/warnings/trailingfield.cabal +++ b/Cabal/tests/ParserTests/warnings/trailingfield.cabal @@ -1,6 +1,6 @@ name: trailingfield version: 1 -cabal-version: >= 1.6 +cabal-version: >= 1.8 library build-depends: base >= 4.9 && <4.10 diff --git a/Cabal/tests/ParserTests/warnings/unknownfield.cabal b/Cabal/tests/ParserTests/warnings/unknownfield.cabal index 95373003c33..39644dd16ff 100644 --- a/Cabal/tests/ParserTests/warnings/unknownfield.cabal +++ b/Cabal/tests/ParserTests/warnings/unknownfield.cabal @@ -1,6 +1,6 @@ name: unknownfield version: 1 -cabal-version: >= 1.6 +cabal-version: >= 1.8 library build-depends: base >= 4.9 && <4.10 diff --git a/Cabal/tests/ParserTests/warnings/unknownsection.cabal b/Cabal/tests/ParserTests/warnings/unknownsection.cabal index 7b3e4194e34..75f55b262bf 100644 --- a/Cabal/tests/ParserTests/warnings/unknownsection.cabal +++ b/Cabal/tests/ParserTests/warnings/unknownsection.cabal @@ -1,6 +1,6 @@ name: unknownsection version: 1 -cabal-version: >= 1.6 +cabal-version: >= 1.8 library build-depends: base >= 4.9 && <4.10 diff --git a/Cabal/tests/ParserTests/warnings/utf8.cabal b/Cabal/tests/ParserTests/warnings/utf8.cabal index b84fe0c0504..b0bb8b76f79 100644 --- a/Cabal/tests/ParserTests/warnings/utf8.cabal +++ b/Cabal/tests/ParserTests/warnings/utf8.cabal @@ -1,7 +1,7 @@ name: utf8 author: Oleg Gr�nroos version: 1 -cabal-version: >= 1.6 +cabal-version: >= 1.8 library build-depends: base >= 4.9 && <4.10 diff --git a/Cabal/tests/ParserTests/warnings/versiontag.cabal b/Cabal/tests/ParserTests/warnings/versiontag.cabal index c22b4804d3f..ec38f0b7ec5 100644 --- a/Cabal/tests/ParserTests/warnings/versiontag.cabal +++ b/Cabal/tests/ParserTests/warnings/versiontag.cabal @@ -1,6 +1,6 @@ name: versiontag version: 1 -cabal-version: >= 1.6 +cabal-version: >= 1.8 library build-depends: base >= 4.9 && <4.10-rc1 diff --git a/Cabal/tests/ParserTests/warnings/wildcard.cabal b/Cabal/tests/ParserTests/warnings/wildcard.cabal new file mode 100644 index 00000000000..84408d23ebb --- /dev/null +++ b/Cabal/tests/ParserTests/warnings/wildcard.cabal @@ -0,0 +1,7 @@ +name: version-wildcard +version: 1 +cabal-version: >= 1.4 + +library + build-depends: base == 4.* + hs-source-dirs: .