Skip to content

Commit 2fad0d5

Browse files
committed
Do not check PVP on internal targets
Internal: testsuite, benchmark. See haskell#8361.
1 parent 6abb8db commit 2fad0d5

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Cabal/src/Distribution/PackageDescription/Check/Target.hs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,9 @@ checkBuildInfo cet ams ads bi = do
338338
let ick = const (PackageDistInexcusable BaseNoUpperBounds)
339339
rck = PackageDistSuspiciousWarn . MissingUpperBounds cet
340340
checkPVP ick ids
341-
checkPVPs rck rds
341+
unless
342+
(isInternalTarget cet)
343+
(checkPVPs rck rds)
342344

343345
-- Custom fields well-formedness (ASCII).
344346
mapM_ checkCustomField (customFieldsBI bi)
@@ -728,6 +730,16 @@ mergeDependencies l@(d : _) =
728730
depName :: Dependency -> String
729731
depName wd = unPackageName . depPkgName $ wd
730732

733+
-- Is this an internal target? We do not perform PVP checks on those,
734+
-- see https://github.com/haskell/cabal/pull/8361#issuecomment-1577547091
735+
isInternalTarget :: CEType -> Bool
736+
isInternalTarget (CETLibrary{}) = False
737+
isInternalTarget (CETForeignLibrary{}) = False
738+
isInternalTarget (CETExecutable{}) = False
739+
isInternalTarget (CETTest{}) = True
740+
isInternalTarget (CETBenchmark{}) = True
741+
isInternalTarget (CETSetup{}) = False
742+
731743
-- ------------------------------------------------------------
732744
-- Options
733745
-- ------------------------------------------------------------

doc/cabal-commands.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ A list of all warnings with their constructor:
11661166
- UnknownArch: unknown architecture in condition.
11671167
- UnknownCompiler: unknown compiler in condition.
11681168
- BaseNoUpperBounds: missing upper bounds for important dependencies (``base``, and for ``custom-setup`` ``Cabal`` too).
1169-
- MissingUpperBounds: missing upper bound in dependency.
1169+
- MissingUpperBounds: missing upper bound in dependency (excluding test-suites and benchmarks).
11701170
- SuspiciousFlagName: troublesome flag name (e.g. starting with a dash).
11711171
- DeclaredUsedFlags: unused user flags.
11721172
- NonASCIICustomField: non-ASCII characters in custom field.

0 commit comments

Comments
 (0)