diff --git a/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs b/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs index cdf6e4fb435..25c5698ff29 100644 --- a/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs +++ b/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs @@ -33,15 +33,15 @@ md5Check proxy md5Int = structureHash proxy @?= md5FromInteger md5Int md5CheckGenericPackageDescription :: Proxy GenericPackageDescription -> Assertion md5CheckGenericPackageDescription proxy = md5Check proxy #if MIN_VERSION_base(4,19,0) - 0xc638caeb7531f107f64d12773f9430d0 + 0xae37c23fa8d463c4db8948c9971690ef #else - 0x7a231bff7bb37049ec7f2ebfd98d3243 + 0x21f4a39a92b847b6632462c8a60539f6 #endif md5CheckLocalBuildInfo :: Proxy LocalBuildInfo -> Assertion md5CheckLocalBuildInfo proxy = md5Check proxy #if MIN_VERSION_base(4,19,0) - 0x023b3cd1665b2acdedf72d231c96336b + 0x3e26b843d4bcc009bbc0a0ce3e3a3637 #else - 0xc6c0cc122cc60ce7943764cbaaacdc2d + 0x8f30685ed435311bb5bd30b921356280 #endif diff --git a/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.out b/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.out new file mode 100644 index 00000000000..f86e86a9ec2 --- /dev/null +++ b/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.out @@ -0,0 +1,31 @@ +# cabal build +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - foo-0.1.0.0 (lib) (first run) +Configuring library for foo-0.1.0.0... +Preprocessing library for foo-0.1.0.0... +Building library for foo-0.1.0.0... +# cabal build +Resolving dependencies... +Error: [Cabal-7107] +Could not resolve dependencies: +[__0] trying: foo-0.1.0.0 (user goal) +[__1] trying: foo:*test +[__2] next goal: time (dependency of foo) +[__2] rejecting: time-/installed- (conflict: foo *test => time<0) +[__2] fail (backjumping, conflict set: foo, time, foo:test) +After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: foo (4), foo:test (3), time (2) +# cabal check +These warnings will likely cause trouble when distributing the package: +Warning: No 'category' field. +Warning: No 'maintainer' field. +These warnings may cause trouble when distributing the package: +Warning: library does not expose any modules +Warning: On package-constraints, these packages miss upper bounds: +- process +Please add them. There is more information at https://pvp.haskell.org/ +The following errors will cause portability problems on other environments: +Error: No 'synopsis' or 'description' field. +Error: The 'license' field is missing or is NONE. +Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.project b/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.project new file mode 100644 index 00000000000..e6fdbadb439 --- /dev/null +++ b/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.project @@ -0,0 +1 @@ +packages: . diff --git a/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.test.hs b/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.test.hs new file mode 100644 index 00000000000..a341a82922d --- /dev/null +++ b/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.test.hs @@ -0,0 +1,6 @@ +import Test.Cabal.Prelude + +main = cabalTest $ withProjectFile "cabal.project" $ do + cabal "build" ["foo"] + fails $ cabal "build" ["foo", "--enable-tests"] + fails $ cabal "check" [] diff --git a/cabal-testsuite/PackageTests/DefaultPackageBounds/foo.cabal b/cabal-testsuite/PackageTests/DefaultPackageBounds/foo.cabal new file mode 100644 index 00000000000..4e158f4a175 --- /dev/null +++ b/cabal-testsuite/PackageTests/DefaultPackageBounds/foo.cabal @@ -0,0 +1,22 @@ +cabal-version: 3.12 +name: foo +version: 0.1.0.0 + +default-package-bounds: + -- time bound should not apply on lib, there is a specific bound defined, + -- however it should prevent the @tests@ from building + , time <0 + -- deepseq bound should never apply, we don't depend on it + , deepseq <0 + -- check will report this missing upper bound + , process + +library + build-depends: + time >1 + default-language: Haskell2010 + +test-suite tests + build-depends: time + default-language: Haskell2010 + main-is: Main.hs