File tree Expand file tree Collapse file tree 4 files changed +16
-6
lines changed
Cabal-syntax/src/Distribution/PackageDescription
Cabal-tests/tests/ParserTests/errors Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,10 @@ parseGenericPackageDescription bs = do
8888 Just csv -> return (Just csv)
8989 Nothing ->
9090 parseFatalFailure zeroPos $
91- " Unsupported cabal-version " ++ prettyShow v ++ " . See https://github.com/haskell/cabal/issues/4899."
91+ " Unsupported cabal format version in cabal-version field: "
92+ ++ prettyShow v
93+ ++ " .\n "
94+ ++ cabalFormatVersionsDesc
9295 _ -> pure Nothing
9396
9497 case readFields' bs'' of
@@ -175,8 +178,8 @@ parseGenericPackageDescription' scannedVer lexWarnings utf8WarnPos fs = do
175178 -- if it were at the beginning, scanner would found it
176179 when (v >= CabalSpecV2_2 ) $
177180 parseFailure pos $
178- " cabal-version should be at the beginning of the file starting with spec version 2.2. "
179- ++ " See https://github.com/haskell/cabal/issues/4899 "
181+ " cabal-version should be at the beginning of the file starting with spec version 2.2.\n "
182+ ++ cabalFormatVersionsDesc
180183
181184 return v
182185
@@ -234,6 +237,10 @@ parseGenericPackageDescription' scannedVer lexWarnings utf8WarnPos fs = do
234237 ++ " ' must use section syntax. See the Cabal user guide for details."
235238 maybeWarnCabalVersion _ _ = return ()
236239
240+ -- See #4899
241+ cabalFormatVersionsDesc :: String
242+ cabalFormatVersionsDesc = " Current cabal-version values are listed at https://cabal.readthedocs.io/en/stable/file-format-changelog.html."
243+
237244goSections :: CabalSpecVersion -> [Field Position ] -> SectionParser ()
238245goSections specVer = traverse_ process
239246 where
Original file line number Diff line number Diff line change 11VERSION: Just (mkVersion [99999,9])
2- forward-compat.cabal:0:0: Unsupported cabal-version 99999.9. See https://github.com/haskell/cabal/issues/4899.
2+ forward-compat.cabal:0:0: Unsupported cabal format version in cabal-version field: 99999.9.
3+ Current cabal-version values are listed at https://cabal.readthedocs.io/en/stable/file-format-changelog.html.
Original file line number Diff line number Diff line change 11VERSION: Just (mkVersion [2,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
2+ forward-compat2.cabal:5:1: cabal-version should be at the beginning of the file starting with spec version 2.2.
3+ Current cabal-version values are listed at https://cabal.readthedocs.io/en/stable/file-format-changelog.html.
Original file line number Diff line number Diff line change 11VERSION: Just (mkVersion [99999,99])
2- forward-compat3.cabal:0:0: Unsupported cabal-version 99999.99. See https://github.com/haskell/cabal/issues/4899.
2+ forward-compat3.cabal:0:0: Unsupported cabal format version in cabal-version field: 99999.99.
3+ Current cabal-version values are listed at https://cabal.readthedocs.io/en/stable/file-format-changelog.html.
You can’t perform that action at this time.
0 commit comments