diff --git a/Cabal-syntax/src/Distribution/PackageDescription/Parsec.hs b/Cabal-syntax/src/Distribution/PackageDescription/Parsec.hs index bee6965c127..7cd7a44ca10 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-version specification of 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,9 @@ parseGenericPackageDescription' scannedVer lexWarnings utf8WarnPos fs = do ++ "' must use section syntax. See the Cabal user guide for details." maybeWarnCabalVersion _ _ = return () +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 b027e266d20..4749402cfc4 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-version specification of 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 5270a2d53a3..fdbb38897e1 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 1affcf1174e..50b420746c0 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-version specification of 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.