File tree 4 files changed +16
-6
lines changed
Cabal-syntax/src/Distribution/PackageDescription
Cabal-tests/tests/ParserTests/errors
4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,10 @@ parseGenericPackageDescription bs = do
88
88
Just csv -> return (Just csv)
89
89
Nothing ->
90
90
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
92
95
_ -> pure Nothing
93
96
94
97
case readFields' bs'' of
@@ -175,8 +178,8 @@ parseGenericPackageDescription' scannedVer lexWarnings utf8WarnPos fs = do
175
178
-- if it were at the beginning, scanner would found it
176
179
when (v >= CabalSpecV2_2 ) $
177
180
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
180
183
181
184
return v
182
185
@@ -234,6 +237,10 @@ parseGenericPackageDescription' scannedVer lexWarnings utf8WarnPos fs = do
234
237
++ " ' must use section syntax. See the Cabal user guide for details."
235
238
maybeWarnCabalVersion _ _ = return ()
236
239
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
+
237
244
goSections :: CabalSpecVersion -> [Field Position ] -> SectionParser ()
238
245
goSections specVer = traverse_ process
239
246
where
Original file line number Diff line number Diff line change 1
1
VERSION: 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 1
1
VERSION: 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 1
1
VERSION: 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