Skip to content

Commit

Permalink
Do not check PVP on internal targets
Browse files Browse the repository at this point in the history
Internal: testsuite, benchmark.
See haskell#8361.
  • Loading branch information
ffaf1 committed Jun 22, 2023
1 parent 83d89db commit 68f2be8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion Cabal/src/Distribution/PackageDescription/Check/Target.hs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,9 @@ checkBuildInfo cet ams ads bi = do
let ick = const (PackageDistInexcusable BaseNoUpperBounds)
rck = PackageDistSuspiciousWarn . MissingUpperBounds cet
checkPVP ick ids
checkPVPs rck rds
unless
(isInternalTarget cet)
(checkPVPs rck rds)

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

-- Is this an internal target? We do not perform PVP checks on those,
-- see https://github.com/haskell/cabal/pull/8361#issuecomment-1577547091
isInternalTarget :: CEType -> Bool
isInternalTarget (CETLibrary{}) = False
isInternalTarget (CETForeignLibrary{}) = False
isInternalTarget (CETExecutable{}) = False
isInternalTarget (CETTest{}) = True
isInternalTarget (CETBenchmark{}) = True
isInternalTarget (CETSetup{}) = False

-- ------------------------------------------------------------
-- Options
-- ------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion doc/cabal-commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ A list of all warnings with their constructor:
- UnknownArch: unknown architecture in condition.
- UnknownCompiler: unknown compiler in condition.
- BaseNoUpperBounds: missing upper bounds for important dependencies (``base``, and for ``custom-setup`` ``Cabal`` too).
- MissingUpperBounds: missing upper bound in dependency.
- MissingUpperBounds: missing upper bound in dependency (excluding test-suites and benchmarks).
- SuspiciousFlagName: troublesome flag name (e.g. starting with a dash).
- DeclaredUsedFlags: unused user flags.
- NonASCIICustomField: non-ASCII characters in custom field.
Expand Down

0 comments on commit 68f2be8

Please sign in to comment.