Skip to content

Commit

Permalink
Commenting out extraneous version warnings
Browse files Browse the repository at this point in the history
(cherry picked from commit 884f6a2)
  • Loading branch information
ptkato committed Jul 22, 2021
1 parent ea75804 commit 81fccc5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 26 deletions.
54 changes: 28 additions & 26 deletions Cabal/src/Distribution/PackageDescription/Check.hs
Original file line number Diff line number Diff line change
Expand Up @@ -539,13 +539,15 @@ checkFields pkg =
++ "for example 'tested-with: GHC==6.10.4, GHC==6.12.3' and not "
++ "'tested-with: GHC==6.10.4 && ==6.12.3'."

, check (not (null depInternalLibraryWithExtraVersion)) $
PackageBuildWarning $
"The package has an extraneous version range for a dependency on an "
++ "internal library: "
++ commaSep (map prettyShow depInternalLibraryWithExtraVersion)
++ ". This version range includes the current package but isn't needed "
++ "as the current package's library will always be used."
-- for more details on why the following was commented out,
-- check https://github.com/haskell/cabal/pull/7470#issuecomment-875878507
-- , check (not (null depInternalLibraryWithExtraVersion)) $
-- PackageBuildWarning $
-- "The package has an extraneous version range for a dependency on an "
-- ++ "internal library: "
-- ++ commaSep (map prettyShow depInternalLibraryWithExtraVersion)
-- ++ ". This version range includes the current package but isn't needed "
-- ++ "as the current package's library will always be used."

, check (not (null depInternalLibraryWithImpossibleVersion)) $
PackageBuildImpossible $
Expand All @@ -555,13 +557,13 @@ checkFields pkg =
++ ". This version range does not include the current package, and must "
++ "be removed as the current package's library will always be used."

, check (not (null depInternalExecutableWithExtraVersion)) $
PackageBuildWarning $
"The package has an extraneous version range for a dependency on an "
++ "internal executable: "
++ commaSep (map prettyShow depInternalExecutableWithExtraVersion)
++ ". This version range includes the current package but isn't needed "
++ "as the current package's executable will always be used."
-- , check (not (null depInternalExecutableWithExtraVersion)) $
-- PackageBuildWarning $
-- "The package has an extraneous version range for a dependency on an "
-- ++ "internal executable: "
-- ++ commaSep (map prettyShow depInternalExecutableWithExtraVersion)
-- ++ ". This version range includes the current package but isn't needed "
-- ++ "as the current package's executable will always be used."

, check (not (null depInternalExecutableWithImpossibleVersion)) $
PackageBuildImpossible $
Expand Down Expand Up @@ -617,25 +619,25 @@ checkFields pkg =
, isInternal pkg dep
]

depInternalLibraryWithExtraVersion =
[ dep
| dep@(Dependency _ versionRange _) <- internalLibDeps
, not $ isAnyVersion versionRange
, packageVersion pkg `withinRange` versionRange
]
-- depInternalLibraryWithExtraVersion =
-- [ dep
-- | dep@(Dependency _ versionRange _) <- internalLibDeps
-- , not $ isAnyVersion versionRange
-- , packageVersion pkg `withinRange` versionRange
-- ]

depInternalLibraryWithImpossibleVersion =
[ dep
| dep@(Dependency _ versionRange _) <- internalLibDeps
, not $ packageVersion pkg `withinRange` versionRange
]

depInternalExecutableWithExtraVersion =
[ dep
| dep@(ExeDependency _ _ versionRange) <- internalExeDeps
, not $ isAnyVersion versionRange
, packageVersion pkg `withinRange` versionRange
]
-- depInternalExecutableWithExtraVersion =
-- [ dep
-- | dep@(ExeDependency _ _ versionRange) <- internalExeDeps
-- , not $ isAnyVersion versionRange
-- , packageVersion pkg `withinRange` versionRange
-- ]

depInternalExecutableWithImpossibleVersion =
[ dep
Expand Down
4 changes: 4 additions & 0 deletions changelog.d/pr-7470-backport
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
synopsis: removes the warnings for extraneous versions
packages: cabal-install
prs: #7470
issues: #7286

0 comments on commit 81fccc5

Please sign in to comment.