Skip to content

Commit 0df37a5

Browse files
committed
Add checkVersion for asm-sources, cmm-source, extra-bundled-libaraires, extra-library-flavours, and virtual-modules.
As pointed out by @hvr, haskell#4857, haskell#4875 did not contain the necessary "check" logic. This PR tries to address this shortcoming.
1 parent e3aa190 commit 0df37a5

File tree

1 file changed

+17
-0
lines changed
  • Cabal/Distribution/PackageDescription

1 file changed

+17
-0
lines changed

Cabal/Distribution/PackageDescription/Check.hs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,6 +1186,23 @@ checkCabalVersion pkg =
11861186
[ display (Dependency name (eliminateMajorBoundSyntax versionRange))
11871187
| Dependency name versionRange <- depsUsingMajorBoundSyntax ]
11881188

1189+
, checkVersion [2,1] (any (not . null)
1190+
(concatMap buildInfoField
1191+
[ asmSources
1192+
, cmmSources
1193+
, extraBundledLibs
1194+
, extraLibFlavours ])) $
1195+
PackageDistInexcusable $
1196+
"The use of 'asm-sources', 'cmm-sources', 'extra-bundled-libraries' "
1197+
++ " and 'virtual-modules' requires the package "
1198+
++ " to specify at least 'cabal-version: >= 2.1'."
1199+
1200+
, checkVersion [2,1] (any (not . null)
1201+
(buildInfoField virtualModules)) $
1202+
PackageDistInexcusable $
1203+
"The use of 'virtual-modules' requires the package "
1204+
++ " to specify at least 'cabal-version: >= 2.1'."
1205+
11891206
-- check use of "tested-with: GHC (>= 1.0 && < 1.4) || >=1.8 " syntax
11901207
, checkVersion [1,8] (not (null testedWithVersionRangeExpressions)) $
11911208
PackageDistInexcusable $

0 commit comments

Comments
 (0)