From 81fccc550da400d00075120244e490ec459330f3 Mon Sep 17 00:00:00 2001 From: Patrick Augusto Date: Fri, 9 Jul 2021 17:18:35 -0300 Subject: [PATCH] Commenting out extraneous version warnings (cherry picked from commit 884f6a2847f37fa1e744d70fdffdfa22ba36a8a5) --- .../Distribution/PackageDescription/Check.hs | 54 ++++++++++--------- changelog.d/pr-7470-backport | 4 ++ 2 files changed, 32 insertions(+), 26 deletions(-) create mode 100644 changelog.d/pr-7470-backport diff --git a/Cabal/src/Distribution/PackageDescription/Check.hs b/Cabal/src/Distribution/PackageDescription/Check.hs index 821c61aa71c..108aa9836ad 100644 --- a/Cabal/src/Distribution/PackageDescription/Check.hs +++ b/Cabal/src/Distribution/PackageDescription/Check.hs @@ -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 $ @@ -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 $ @@ -617,12 +619,12 @@ 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 @@ -630,12 +632,12 @@ checkFields pkg = , 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 diff --git a/changelog.d/pr-7470-backport b/changelog.d/pr-7470-backport new file mode 100644 index 00000000000..4775abf0beb --- /dev/null +++ b/changelog.d/pr-7470-backport @@ -0,0 +1,4 @@ +synopsis: removes the warnings for extraneous versions +packages: cabal-install +prs: #7470 +issues: #7286 \ No newline at end of file