diff --git a/Cabal-syntax/src/Distribution/PackageDescription/Parsec.hs b/Cabal-syntax/src/Distribution/PackageDescription/Parsec.hs index bee6965c12777e4e1543496eaf27e8a31bdd2965..cd299b87675488ef18793981d85f92207482bf5d 100644 --- a/Cabal-syntax/src/Distribution/PackageDescription/Parsec.hs +++ b/Cabal-syntax/src/Distribution/PackageDescription/Parsec.hs @@ -88,7 +88,10 @@ parseGenericPackageDescription bs = do Just csv -> return (Just csv) Nothing -> parseFatalFailure zeroPos $ - "Unsupported cabal-version " ++ prettyShow v ++ ". See https://github.com/haskell/cabal/issues/4899." + "Unsupported cabal format version in cabal-version field: " + ++ prettyShow v + ++ ".\n" + ++ cabalFormatVersionsDesc _ -> pure Nothing case readFields' bs'' of @@ -175,8 +178,8 @@ parseGenericPackageDescription' scannedVer lexWarnings utf8WarnPos fs = do -- if it were at the beginning, scanner would found it when (v >= CabalSpecV2_2) $ parseFailure pos $ - "cabal-version should be at the beginning of the file starting with spec version 2.2. " - ++ "See https://github.com/haskell/cabal/issues/4899" + "cabal-version should be at the beginning of the file starting with spec version 2.2.\n" + ++ cabalFormatVersionsDesc return v @@ -234,6 +237,10 @@ parseGenericPackageDescription' scannedVer lexWarnings utf8WarnPos fs = do ++ "' must use section syntax. See the Cabal user guide for details." maybeWarnCabalVersion _ _ = return () +-- See #4899 +cabalFormatVersionsDesc :: String +cabalFormatVersionsDesc = "Current cabal-version values are listed at https://cabal.readthedocs.io/en/stable/file-format-changelog.html." + goSections :: CabalSpecVersion -> [Field Position] -> SectionParser () goSections specVer = traverse_ process where diff --git a/Cabal-tests/tests/ParserTests/errors/forward-compat.errors b/Cabal-tests/tests/ParserTests/errors/forward-compat.errors index b027e266d20cba65ba8b57a4d64b132e229a682f..d0d64f6abc21885bacb13bb595333a19985ac9cf 100644 --- a/Cabal-tests/tests/ParserTests/errors/forward-compat.errors +++ b/Cabal-tests/tests/ParserTests/errors/forward-compat.errors @@ -1,2 +1,3 @@ VERSION: Just (mkVersion [99999,9]) -forward-compat.cabal:0:0: Unsupported cabal-version 99999.9. See https://github.com/haskell/cabal/issues/4899. +forward-compat.cabal:0:0: Unsupported cabal format version in cabal-version field: 99999.9. +Current cabal-version values are listed at https://cabal.readthedocs.io/en/stable/file-format-changelog.html. diff --git a/Cabal-tests/tests/ParserTests/errors/forward-compat2.errors b/Cabal-tests/tests/ParserTests/errors/forward-compat2.errors index 5270a2d53a35a14a5e5d48db12b86fc51e6d8921..fdbb38897e13d07e1b0b16f43b0a7db407e716f8 100644 --- a/Cabal-tests/tests/ParserTests/errors/forward-compat2.errors +++ b/Cabal-tests/tests/ParserTests/errors/forward-compat2.errors @@ -1,2 +1,3 @@ VERSION: Just (mkVersion [2,2]) -forward-compat2.cabal:5:1: cabal-version should be at the beginning of the file starting with spec version 2.2. See https://github.com/haskell/cabal/issues/4899 +forward-compat2.cabal:5:1: cabal-version should be at the beginning of the file starting with spec version 2.2. +Current cabal-version values are listed at https://cabal.readthedocs.io/en/stable/file-format-changelog.html. diff --git a/Cabal-tests/tests/ParserTests/errors/forward-compat3.errors b/Cabal-tests/tests/ParserTests/errors/forward-compat3.errors index 1affcf1174ee0af5d2dec7de3202241ea6fee287..2d48094c986452da449615ae30c8b40b9449e5c6 100644 --- a/Cabal-tests/tests/ParserTests/errors/forward-compat3.errors +++ b/Cabal-tests/tests/ParserTests/errors/forward-compat3.errors @@ -1,2 +1,3 @@ VERSION: Just (mkVersion [99999,99]) -forward-compat3.cabal:0:0: Unsupported cabal-version 99999.99. See https://github.com/haskell/cabal/issues/4899. +forward-compat3.cabal:0:0: Unsupported cabal format version in cabal-version field: 99999.99. +Current cabal-version values are listed at https://cabal.readthedocs.io/en/stable/file-format-changelog.html.