From 5b54345d023bd91e610d8397ea3d8f9cbb38c90e Mon Sep 17 00:00:00 2001 From: quasicomputational Date: Tue, 14 Aug 2018 15:37:06 +0100 Subject: [PATCH] Hack around #5119 by disabling the warning. (#5524) Issue #5119 is tracking spurious generation of these warnings. There are a lot of them! We can't release with so many false positives, so just squelch the warning outright. This is a hack and this commit should be reverted if we get a proper fix that can be backported to the 2.4 branch. (cherry picked from commit e8ba73190823ad142802cf3504f0ead4f1746646) --- Cabal/ChangeLog.md | 4 ++++ Cabal/Distribution/PackageDescription/Check.hs | 5 ++++- .../Backpack/Includes2/cabal-internal.out | 2 -- .../PackageTests/BuildTools/Internal/cabal.out | 1 - .../BuildDependsExtra/setup.cabal.out | 13 ------------- .../InternalVersions/BuildDependsExtra/setup.out | 13 ------------- .../BuildDependsExtra/setup.test.hs | 6 ++++-- .../PackageTests/Regression/T5309/cabal.out | 3 --- .../PackageTests/Regression/T5677/cabal.out | 1 - .../PackageTests/TestSuiteTests/ExeV10/cabal.out | 2 -- 10 files changed, 12 insertions(+), 38 deletions(-) diff --git a/Cabal/ChangeLog.md b/Cabal/ChangeLog.md index 0e9506760a7..a12a2872614 100644 --- a/Cabal/ChangeLog.md +++ b/Cabal/ChangeLog.md @@ -53,6 +53,10 @@ # 2.4.0.0 [Mikhail Glushenkov](mailto:mikhail.glushenkov@gmail.com) September 2018 + * Due to [#5119](https://github.com/haskell/cabal/issues/5119), the + `cabal check` warning for bounds on internal libraries has been + disabled. +# 2.4.0.0 (current development version) * Due to [#5119](https://github.com/haskell/cabal/issues/5119), the `cabal check` warning for bounds on internal libraries has been disabled. diff --git a/Cabal/Distribution/PackageDescription/Check.hs b/Cabal/Distribution/PackageDescription/Check.hs index 0f2d21a2773..390436bcc74 100644 --- a/Cabal/Distribution/PackageDescription/Check.hs +++ b/Cabal/Distribution/PackageDescription/Check.hs @@ -546,7 +546,10 @@ 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)) $ + -- Disabled due to #5119: we generate loads of spurious instances of + -- this warning. Re-enabling this check should be part of the fix to + -- #5119. + , check (False && not (null depInternalLibraryWithExtraVersion)) $ PackageBuildWarning $ "The package has an extraneous version range for a dependency on an " ++ "internal library: " diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.out b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.out index 64df9b09144..d5058239ef6 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.out +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.out @@ -34,11 +34,9 @@ Building library 'mylib' instantiated with Database = Includes2-0.1.0.0-inplace-postgresql:Database.PostgreSQL for Includes2-0.1.0.0.. Configuring library for Includes2-0.1.0.0.. -Warning: The package has an extraneous version range for a dependency on an internal library: Includes2 -any && ==0.1.0.0 && ==0.1.0.0 && ==0.1.0.0. This version range includes the current package but isn't needed as the current package's library will always be used. Preprocessing library for Includes2-0.1.0.0.. Building library for Includes2-0.1.0.0.. Configuring executable 'exe' for Includes2-0.1.0.0.. -Warning: The package has an extraneous version range for a dependency on an internal library: Includes2 -any && ==0.1.0.0. This version range includes the current package but isn't needed as the current package's library will always be used. Preprocessing executable 'exe' for Includes2-0.1.0.0.. Building executable 'exe' for Includes2-0.1.0.0.. # Includes2 exe diff --git a/cabal-testsuite/PackageTests/BuildTools/Internal/cabal.out b/cabal-testsuite/PackageTests/BuildTools/Internal/cabal.out index d3c6bbd5ec0..8cb4ac09bcd 100644 --- a/cabal-testsuite/PackageTests/BuildTools/Internal/cabal.out +++ b/cabal-testsuite/PackageTests/BuildTools/Internal/cabal.out @@ -12,6 +12,5 @@ Configuring library for foo-0.1.0.0.. Preprocessing library for foo-0.1.0.0.. Building library for foo-0.1.0.0.. Configuring executable 'hello-world' for foo-0.1.0.0.. -Warning: The package has an extraneous version range for a dependency on an internal library: foo -any && ==0.1.0.0. This version range includes the current package but isn't needed as the current package's library will always be used. Preprocessing executable 'hello-world' for foo-0.1.0.0.. Building executable 'hello-world' for foo-0.1.0.0.. diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.cabal.out b/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.cabal.out index adc6f5a04dd..0948d520737 100644 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.cabal.out +++ b/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.cabal.out @@ -1,16 +1,3 @@ # Setup configure Resolving dependencies... Configuring build-depends-extra-version-0.1.0.0... -Warning: The package has an extraneous version range for a dependency on an internal library: build-depends-extra-version >=0.0.0.1. This version range includes the current package but isn't needed as the current package's library will always be used. -# Setup sdist -Distribution quality errors: -The package has an extraneous version range for a dependency on an internal library: build-depends-extra-version >=0.0.0.1. This version range includes the current package but isn't needed as the current package's library will always be used. -Distribution quality warnings: -No 'maintainer' field. -No 'description' field. -A 'license-file' is not specified. -Note: the public hackage server would reject this package. -Building source dist for build-depends-extra-version-0.1.0.0... -Preprocessing library for build-depends-extra-version-0.1.0.0.. -Preprocessing executable 'bar' for build-depends-extra-version-0.1.0.0.. -Source tarball created: setup.cabal.dist/work/dist/build-depends-extra-version-0.1.0.0.tar.gz diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.out b/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.out index 85979d93a9c..6d5a2ba23de 100644 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.out +++ b/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.out @@ -1,15 +1,2 @@ # Setup configure Configuring build-depends-extra-version-0.1.0.0... -Warning: The package has an extraneous version range for a dependency on an internal library: build-depends-extra-version >=0.0.0.1. This version range includes the current package but isn't needed as the current package's library will always be used. -# Setup sdist -Distribution quality errors: -The package has an extraneous version range for a dependency on an internal library: build-depends-extra-version >=0.0.0.1. This version range includes the current package but isn't needed as the current package's library will always be used. -Distribution quality warnings: -No 'maintainer' field. -No 'description' field. -A 'license-file' is not specified. -Note: the public hackage server would reject this package. -Building source dist for build-depends-extra-version-0.1.0.0... -Preprocessing library for build-depends-extra-version-0.1.0.0.. -Preprocessing executable 'bar' for build-depends-extra-version-0.1.0.0.. -Source tarball created: setup.dist/work/dist/build-depends-extra-version-0.1.0.0.tar.gz diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.test.hs b/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.test.hs index b0b4e9bc58e..001de81f4d0 100644 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.test.hs +++ b/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.test.hs @@ -2,5 +2,7 @@ import Test.Cabal.Prelude -- Test unneed version bound on internal build-tools deps main = setupAndCabalTest $ do setup' "configure" [] - assertOutputContains "extraneous version range" - =<< setup' "sdist" [] + -- Hack alert: had to squelch this warning because of #5119. +-- assertOutputContains "extraneous version range" +-- =<< setup' "sdist" [] + return () diff --git a/cabal-testsuite/PackageTests/Regression/T5309/cabal.out b/cabal-testsuite/PackageTests/Regression/T5309/cabal.out index e73dc9b85aa..4d9d7c8dc6e 100644 --- a/cabal-testsuite/PackageTests/Regression/T5309/cabal.out +++ b/cabal-testsuite/PackageTests/Regression/T5309/cabal.out @@ -12,7 +12,6 @@ Configuring executable 'exe-no-lib' for T5309-1.0.0.0.. Preprocessing executable 'exe-no-lib' for T5309-1.0.0.0.. Building executable 'exe-no-lib' for T5309-1.0.0.0.. Configuring executable 'exe-with-lib' for T5309-1.0.0.0.. -Warning: The package has an extraneous version range for a dependency on an internal library: T5309 -any && ==1.0.0.0, T5309 -any && ==1.0.0.0, T5309 -any && ==1.0.0.0. This version range includes the current package but isn't needed as the current package's library will always be used. Preprocessing executable 'exe-with-lib' for T5309-1.0.0.0.. Building executable 'exe-with-lib' for T5309-1.0.0.0.. # cabal v2-test @@ -29,7 +28,6 @@ Test suite test-no-lib: PASS Test suite logged to: /cabal.dist/work/./dist/build//ghc-/T5309-1.0.0.0/t/test-no-lib/test/T5309-1.0.0.0-test-no-lib.log 1 of 1 test suites (1 of 1 test cases) passed. Configuring test suite 'test-with-lib' for T5309-1.0.0.0.. -Warning: The package has an extraneous version range for a dependency on an internal library: T5309 -any && ==1.0.0.0, T5309 -any && ==1.0.0.0, T5309 -any && ==1.0.0.0. This version range includes the current package but isn't needed as the current package's library will always be used. Preprocessing test suite 'test-with-lib' for T5309-1.0.0.0.. Building test suite 'test-with-lib' for T5309-1.0.0.0.. Running 1 test suites... @@ -49,7 +47,6 @@ Running 1 benchmarks... Benchmark bench-no-lib: RUNNING... Benchmark bench-no-lib: FINISH Configuring benchmark 'bench-with-lib' for T5309-1.0.0.0.. -Warning: The package has an extraneous version range for a dependency on an internal library: T5309 -any && ==1.0.0.0, T5309 -any && ==1.0.0.0, T5309 -any && ==1.0.0.0. This version range includes the current package but isn't needed as the current package's library will always be used. Preprocessing benchmark 'bench-with-lib' for T5309-1.0.0.0.. Building benchmark 'bench-with-lib' for T5309-1.0.0.0.. Running 1 benchmarks... diff --git a/cabal-testsuite/PackageTests/Regression/T5677/cabal.out b/cabal-testsuite/PackageTests/Regression/T5677/cabal.out index c349e08bb9f..5207c5bb5e9 100644 --- a/cabal-testsuite/PackageTests/Regression/T5677/cabal.out +++ b/cabal-testsuite/PackageTests/Regression/T5677/cabal.out @@ -24,6 +24,5 @@ Preprocessing library for prog-0.. Building library instantiated with Sig = impl-0-inplace:Sig for prog-0.. Configuring executable 'prog' for prog-0.. -Warning: The package has an extraneous version range for a dependency on an internal library: prog -any && ==0. This version range includes the current package but isn't needed as the current package's library will always be used. Preprocessing executable 'prog' for prog-0.. Building executable 'prog' for prog-0.. diff --git a/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal.out b/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal.out index 7bff7ab154d..d300a8acdf9 100644 --- a/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal.out +++ b/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal.out @@ -9,7 +9,6 @@ Configuring library for my-0.1.. Preprocessing library for my-0.1.. Building library for my-0.1.. Configuring test suite 'test-Short' for my-0.1.. -Warning: The package has an extraneous version range for a dependency on an internal library: my -any && ==0.1, my -any && ==0.1. This version range includes the current package but isn't needed as the current package's library will always be used. Preprocessing test suite 'test-Short' for my-0.1.. Building test suite 'test-Short' for my-0.1.. Running 1 test suites... @@ -18,7 +17,6 @@ Test suite test-Short: PASS Test suite logged to: /cabal.dist/work/./dist/build//ghc-/my-0.1/t/test-Short/test/my-0.1-test-Short.log 1 of 1 test suites (1 of 1 test cases) passed. Configuring test suite 'test-Foo' for my-0.1.. -Warning: The package has an extraneous version range for a dependency on an internal library: my -any && ==0.1, my -any && ==0.1. This version range includes the current package but isn't needed as the current package's library will always be used. Preprocessing test suite 'test-Foo' for my-0.1.. Building test suite 'test-Foo' for my-0.1.. Running 1 test suites...