From 0f17eff2cd4eb1b450637d98d74e78cf389b1226 Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Wed, 26 Jun 2024 21:17:53 +0200 Subject: [PATCH] Fix tests for default-package-bounds --- Cabal-tests/tests/NoThunks.hs | 1 + .../ParserTests/regressions/Octree-0.5.expr | 2 + .../ParserTests/regressions/anynone.expr | 2 + .../ParserTests/regressions/big-version.expr | 2 + .../regressions/common-conditional.expr | 2 + .../tests/ParserTests/regressions/common.expr | 2 + .../ParserTests/regressions/common2.expr | 2 + .../ParserTests/regressions/common3.expr | 2 + .../tests/ParserTests/regressions/elif.expr | 2 + .../tests/ParserTests/regressions/elif2.expr | 2 + .../ParserTests/regressions/encoding-0.8.expr | 2 + .../ParserTests/regressions/generics-sop.expr | 2 + .../ParserTests/regressions/hasktorch.expr | 2 + .../regressions/hidden-main-lib.expr | 2 + .../ParserTests/regressions/indentation.expr | 2 + .../ParserTests/regressions/indentation2.expr | 2 + .../ParserTests/regressions/indentation3.expr | 2 + .../ParserTests/regressions/issue-5055.expr | 2 + .../ParserTests/regressions/issue-5846.expr | 2 + .../ParserTests/regressions/issue-6083-a.expr | 2 + .../ParserTests/regressions/issue-6083-b.expr | 2 + .../ParserTests/regressions/issue-6083-c.expr | 2 + .../regressions/issue-6083-pkg-pkg.expr | 2 + .../ParserTests/regressions/issue-774.expr | 2 + .../regressions/jaeger-flamegraph.expr | 2 + .../regressions/leading-comma-2.expr | 2 + .../regressions/leading-comma.expr | 2 + .../tests/ParserTests/regressions/libpq1.expr | 2 + .../tests/ParserTests/regressions/libpq2.expr | 2 + .../ParserTests/regressions/mixin-1.expr | 2 + .../ParserTests/regressions/mixin-2.expr | 2 + .../ParserTests/regressions/mixin-3.expr | 2 + .../ParserTests/regressions/monad-param.expr | 2 + .../regressions/multiple-libs-2.expr | 2 + .../ParserTests/regressions/noVersion.expr | 2 + .../regressions/nothing-unicode.expr | 2 + .../tests/ParserTests/regressions/shake.expr | 2 + .../tests/ParserTests/regressions/spdx-1.expr | 2 + .../tests/ParserTests/regressions/spdx-2.expr | 2 + .../tests/ParserTests/regressions/spdx-3.expr | 2 + .../regressions/th-lift-instances.expr | 2 + .../ParserTests/regressions/version-sets.expr | 2 + .../regressions/wl-pprint-indef.expr | 2 + .../Distribution/PackageDescription/Check.hs | 3 +- .../Distribution/Utils/Structured.hs | 4 +- .../src/Data/TreeDiff/Instances/Cabal.hs | 1 + .../DefaultPackageBounds/bar/Main.hs | 5 +++ .../DefaultPackageBounds/bar/bar.cabal | 7 ++++ .../DefaultPackageBounds/cabal.out | 37 +++++++++++++++++++ .../DefaultPackageBounds/cabal.project | 1 + .../DefaultPackageBounds/cabal.test.hs | 7 ++++ .../DefaultPackageBounds/foo.cabal | 33 +++++++++++++++++ .../PackageTests/Regression/T9640/cabal.out | 2 +- 53 files changed, 180 insertions(+), 5 deletions(-) create mode 100644 cabal-testsuite/PackageTests/DefaultPackageBounds/bar/Main.hs create mode 100644 cabal-testsuite/PackageTests/DefaultPackageBounds/bar/bar.cabal create mode 100644 cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.out create mode 100644 cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.project create mode 100644 cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.test.hs create mode 100644 cabal-testsuite/PackageTests/DefaultPackageBounds/foo.cabal diff --git a/Cabal-tests/tests/NoThunks.hs b/Cabal-tests/tests/NoThunks.hs index 6a81475dc03..3783ef3a977 100644 --- a/Cabal-tests/tests/NoThunks.hs +++ b/Cabal-tests/tests/NoThunks.hs @@ -69,6 +69,7 @@ instance NoThunks BuildType instance NoThunks CabalSpecVersion instance NoThunks CompilerFlavor instance NoThunks ConfVar +instance NoThunks DefaultBounds instance NoThunks Dependency instance NoThunks Executable instance NoThunks ExecutableScope diff --git a/Cabal-tests/tests/ParserTests/regressions/Octree-0.5.expr b/Cabal-tests/tests/ParserTests/regressions/Octree-0.5.expr index b3494104aed..77a263aaad3 100644 --- a/Cabal-tests/tests/ParserTests/regressions/Octree-0.5.expr +++ b/Cabal-tests/tests/ParserTests/regressions/Octree-0.5.expr @@ -69,6 +69,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/anynone.expr b/Cabal-tests/tests/ParserTests/regressions/anynone.expr index 8c9c8879ab4..555b5fd6c66 100644 --- a/Cabal-tests/tests/ParserTests/regressions/anynone.expr +++ b/Cabal-tests/tests/ParserTests/regressions/anynone.expr @@ -35,6 +35,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/big-version.expr b/Cabal-tests/tests/ParserTests/regressions/big-version.expr index d4ef82adf52..d7aa02f7f07 100644 --- a/Cabal-tests/tests/ParserTests/regressions/big-version.expr +++ b/Cabal-tests/tests/ParserTests/regressions/big-version.expr @@ -37,6 +37,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/common-conditional.expr b/Cabal-tests/tests/ParserTests/regressions/common-conditional.expr index 9cacba2b770..45daaff5348 100644 --- a/Cabal-tests/tests/ParserTests/regressions/common-conditional.expr +++ b/Cabal-tests/tests/ParserTests/regressions/common-conditional.expr @@ -52,6 +52,8 @@ GenericPackageDescription { flagDescription = "", flagDefault = True, flagManual = True}], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/common.expr b/Cabal-tests/tests/ParserTests/regressions/common.expr index 25abadef9e7..9fcc46d63b1 100644 --- a/Cabal-tests/tests/ParserTests/regressions/common.expr +++ b/Cabal-tests/tests/ParserTests/regressions/common.expr @@ -50,6 +50,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/common2.expr b/Cabal-tests/tests/ParserTests/regressions/common2.expr index cd501d11cf2..8607bde5f3a 100644 --- a/Cabal-tests/tests/ParserTests/regressions/common2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/common2.expr @@ -46,6 +46,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/common3.expr b/Cabal-tests/tests/ParserTests/regressions/common3.expr index fc1fc155c09..f79fc0b4a0f 100644 --- a/Cabal-tests/tests/ParserTests/regressions/common3.expr +++ b/Cabal-tests/tests/ParserTests/regressions/common3.expr @@ -50,6 +50,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/elif.expr b/Cabal-tests/tests/ParserTests/regressions/elif.expr index f17c1e17b88..60071a7c48b 100644 --- a/Cabal-tests/tests/ParserTests/regressions/elif.expr +++ b/Cabal-tests/tests/ParserTests/regressions/elif.expr @@ -45,6 +45,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/elif2.expr b/Cabal-tests/tests/ParserTests/regressions/elif2.expr index ec01a92a79d..c7b68fb69b7 100644 --- a/Cabal-tests/tests/ParserTests/regressions/elif2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/elif2.expr @@ -45,6 +45,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/encoding-0.8.expr b/Cabal-tests/tests/ParserTests/regressions/encoding-0.8.expr index 0d248029a31..9222eaff9aa 100644 --- a/Cabal-tests/tests/ParserTests/regressions/encoding-0.8.expr +++ b/Cabal-tests/tests/ParserTests/regressions/encoding-0.8.expr @@ -50,6 +50,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/generics-sop.expr b/Cabal-tests/tests/ParserTests/regressions/generics-sop.expr index 25786cdfad5..ac2c0ea4d6e 100644 --- a/Cabal-tests/tests/ParserTests/regressions/generics-sop.expr +++ b/Cabal-tests/tests/ParserTests/regressions/generics-sop.expr @@ -126,6 +126,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/hasktorch.expr b/Cabal-tests/tests/ParserTests/regressions/hasktorch.expr index c68fac467e1..2a70a60f71e 100644 --- a/Cabal-tests/tests/ParserTests/regressions/hasktorch.expr +++ b/Cabal-tests/tests/ParserTests/regressions/hasktorch.expr @@ -69,6 +69,8 @@ GenericPackageDescription { "only build with Double and Long support", flagDefault = False, flagManual = False}], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/hidden-main-lib.expr b/Cabal-tests/tests/ParserTests/regressions/hidden-main-lib.expr index b51b4adacb2..8d400ac671f 100644 --- a/Cabal-tests/tests/ParserTests/regressions/hidden-main-lib.expr +++ b/Cabal-tests/tests/ParserTests/regressions/hidden-main-lib.expr @@ -37,6 +37,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/indentation.expr b/Cabal-tests/tests/ParserTests/regressions/indentation.expr index c97630ddb00..cc303c75b75 100644 --- a/Cabal-tests/tests/ParserTests/regressions/indentation.expr +++ b/Cabal-tests/tests/ParserTests/regressions/indentation.expr @@ -47,6 +47,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/indentation2.expr b/Cabal-tests/tests/ParserTests/regressions/indentation2.expr index 605cba525d1..d0c46a34eab 100644 --- a/Cabal-tests/tests/ParserTests/regressions/indentation2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/indentation2.expr @@ -40,6 +40,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/indentation3.expr b/Cabal-tests/tests/ParserTests/regressions/indentation3.expr index 55d0533c3fe..0ba1404c095 100644 --- a/Cabal-tests/tests/ParserTests/regressions/indentation3.expr +++ b/Cabal-tests/tests/ParserTests/regressions/indentation3.expr @@ -42,6 +42,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-5055.expr b/Cabal-tests/tests/ParserTests/regressions/issue-5055.expr index 3b5092639e4..f84e6506f38 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-5055.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-5055.expr @@ -37,6 +37,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Nothing, condSubLibraries = [], condForeignLibs = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-5846.expr b/Cabal-tests/tests/ParserTests/regressions/issue-5846.expr index 61a7b7d2ca1..58da04c977b 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-5846.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-5846.expr @@ -35,6 +35,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-6083-a.expr b/Cabal-tests/tests/ParserTests/regressions/issue-6083-a.expr index c9c57785ac6..d3d213d58ab 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-6083-a.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-6083-a.expr @@ -35,6 +35,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-6083-b.expr b/Cabal-tests/tests/ParserTests/regressions/issue-6083-b.expr index b0ed19062fc..c8cca40546e 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-6083-b.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-6083-b.expr @@ -35,6 +35,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-6083-c.expr b/Cabal-tests/tests/ParserTests/regressions/issue-6083-c.expr index c901eebc8ce..08d463693a5 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-6083-c.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-6083-c.expr @@ -35,6 +35,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-6083-pkg-pkg.expr b/Cabal-tests/tests/ParserTests/regressions/issue-6083-pkg-pkg.expr index 62ed5fd2fb9..39f2efc4598 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-6083-pkg-pkg.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-6083-pkg-pkg.expr @@ -35,6 +35,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-774.expr b/Cabal-tests/tests/ParserTests/regressions/issue-774.expr index 2f58de4eb00..1c392d38e8a 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-774.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-774.expr @@ -44,6 +44,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/jaeger-flamegraph.expr b/Cabal-tests/tests/ParserTests/regressions/jaeger-flamegraph.expr index 9994c9b72c1..84a24f82a7c 100644 --- a/Cabal-tests/tests/ParserTests/regressions/jaeger-flamegraph.expr +++ b/Cabal-tests/tests/ParserTests/regressions/jaeger-flamegraph.expr @@ -76,6 +76,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/leading-comma-2.expr b/Cabal-tests/tests/ParserTests/regressions/leading-comma-2.expr index 99f7cddf881..ffe1cfccd7a 100644 --- a/Cabal-tests/tests/ParserTests/regressions/leading-comma-2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/leading-comma-2.expr @@ -37,6 +37,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/leading-comma.expr b/Cabal-tests/tests/ParserTests/regressions/leading-comma.expr index 441fe75261d..1f67c72f846 100644 --- a/Cabal-tests/tests/ParserTests/regressions/leading-comma.expr +++ b/Cabal-tests/tests/ParserTests/regressions/leading-comma.expr @@ -37,6 +37,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/libpq1.expr b/Cabal-tests/tests/ParserTests/regressions/libpq1.expr index 2e0bc309f9f..47287fbc8eb 100644 --- a/Cabal-tests/tests/ParserTests/regressions/libpq1.expr +++ b/Cabal-tests/tests/ParserTests/regressions/libpq1.expr @@ -120,6 +120,8 @@ GenericPackageDescription { flagDescription = "", flagDefault = False, flagManual = True}], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/libpq2.expr b/Cabal-tests/tests/ParserTests/regressions/libpq2.expr index b74143af0b9..636a25c7741 100644 --- a/Cabal-tests/tests/ParserTests/regressions/libpq2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/libpq2.expr @@ -124,6 +124,8 @@ GenericPackageDescription { flagDescription = "", flagDefault = False, flagManual = True}], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/mixin-1.expr b/Cabal-tests/tests/ParserTests/regressions/mixin-1.expr index 77821302ddf..4d37fd39187 100644 --- a/Cabal-tests/tests/ParserTests/regressions/mixin-1.expr +++ b/Cabal-tests/tests/ParserTests/regressions/mixin-1.expr @@ -35,6 +35,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Nothing, condSubLibraries = [], condForeignLibs = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/mixin-2.expr b/Cabal-tests/tests/ParserTests/regressions/mixin-2.expr index d8b58ff5a0b..0da2ce70a39 100644 --- a/Cabal-tests/tests/ParserTests/regressions/mixin-2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/mixin-2.expr @@ -35,6 +35,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Nothing, condSubLibraries = [], condForeignLibs = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/mixin-3.expr b/Cabal-tests/tests/ParserTests/regressions/mixin-3.expr index c0cbfe921ad..03965350e71 100644 --- a/Cabal-tests/tests/ParserTests/regressions/mixin-3.expr +++ b/Cabal-tests/tests/ParserTests/regressions/mixin-3.expr @@ -35,6 +35,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Nothing, condSubLibraries = [], condForeignLibs = [], diff --git a/Cabal-tests/tests/ParserTests/regressions/monad-param.expr b/Cabal-tests/tests/ParserTests/regressions/monad-param.expr index e450672e868..17e2c63e6c0 100644 --- a/Cabal-tests/tests/ParserTests/regressions/monad-param.expr +++ b/Cabal-tests/tests/ParserTests/regressions/monad-param.expr @@ -45,6 +45,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/multiple-libs-2.expr b/Cabal-tests/tests/ParserTests/regressions/multiple-libs-2.expr index aa7d6954637..284e62e180c 100644 --- a/Cabal-tests/tests/ParserTests/regressions/multiple-libs-2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/multiple-libs-2.expr @@ -37,6 +37,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/noVersion.expr b/Cabal-tests/tests/ParserTests/regressions/noVersion.expr index dfe79d768fb..f55c7d357bb 100644 --- a/Cabal-tests/tests/ParserTests/regressions/noVersion.expr +++ b/Cabal-tests/tests/ParserTests/regressions/noVersion.expr @@ -37,6 +37,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/nothing-unicode.expr b/Cabal-tests/tests/ParserTests/regressions/nothing-unicode.expr index 2ed17f6d557..0bc096e13f3 100644 --- a/Cabal-tests/tests/ParserTests/regressions/nothing-unicode.expr +++ b/Cabal-tests/tests/ParserTests/regressions/nothing-unicode.expr @@ -52,6 +52,8 @@ GenericPackageDescription { flagDescription = "\28961", flagDefault = True, flagManual = False}], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/shake.expr b/Cabal-tests/tests/ParserTests/regressions/shake.expr index 4dd37e84de0..44f7e65c866 100644 --- a/Cabal-tests/tests/ParserTests/regressions/shake.expr +++ b/Cabal-tests/tests/ParserTests/regressions/shake.expr @@ -158,6 +158,8 @@ GenericPackageDescription { "Obtain FileTime using portable functions", flagDefault = False, flagManual = True}], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/spdx-1.expr b/Cabal-tests/tests/ParserTests/regressions/spdx-1.expr index ddeaf37cbe4..333848da482 100644 --- a/Cabal-tests/tests/ParserTests/regressions/spdx-1.expr +++ b/Cabal-tests/tests/ParserTests/regressions/spdx-1.expr @@ -36,6 +36,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/spdx-2.expr b/Cabal-tests/tests/ParserTests/regressions/spdx-2.expr index b865b1f31db..5d418bb5508 100644 --- a/Cabal-tests/tests/ParserTests/regressions/spdx-2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/spdx-2.expr @@ -40,6 +40,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/spdx-3.expr b/Cabal-tests/tests/ParserTests/regressions/spdx-3.expr index dc8f3f922b9..0986d96f7c4 100644 --- a/Cabal-tests/tests/ParserTests/regressions/spdx-3.expr +++ b/Cabal-tests/tests/ParserTests/regressions/spdx-3.expr @@ -40,6 +40,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/th-lift-instances.expr b/Cabal-tests/tests/ParserTests/regressions/th-lift-instances.expr index 5e781597f30..b963a3a8346 100644 --- a/Cabal-tests/tests/ParserTests/regressions/th-lift-instances.expr +++ b/Cabal-tests/tests/ParserTests/regressions/th-lift-instances.expr @@ -64,6 +64,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/version-sets.expr b/Cabal-tests/tests/ParserTests/regressions/version-sets.expr index 3244bc1cc45..4191afac338 100644 --- a/Cabal-tests/tests/ParserTests/regressions/version-sets.expr +++ b/Cabal-tests/tests/ParserTests/regressions/version-sets.expr @@ -62,6 +62,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/ParserTests/regressions/wl-pprint-indef.expr b/Cabal-tests/tests/ParserTests/regressions/wl-pprint-indef.expr index 6e718e3e685..27188d028fb 100644 --- a/Cabal-tests/tests/ParserTests/regressions/wl-pprint-indef.expr +++ b/Cabal-tests/tests/ParserTests/regressions/wl-pprint-indef.expr @@ -54,6 +54,8 @@ GenericPackageDescription { extraDocFiles = []}, gpdScannedVersion = Nothing, genPackageFlags = [], + genDefaultPackageBounds = + Nothing, condLibrary = Just CondNode { condTreeData = Library { diff --git a/Cabal-tests/tests/UnitTests/Distribution/PackageDescription/Check.hs b/Cabal-tests/tests/UnitTests/Distribution/PackageDescription/Check.hs index 662a0684cda..1c3da5281e0 100644 --- a/Cabal-tests/tests/UnitTests/Distribution/PackageDescription/Check.hs +++ b/Cabal-tests/tests/UnitTests/Distribution/PackageDescription/Check.hs @@ -32,6 +32,5 @@ tests = longerThan = filter ((>25). length) allExplanationIdStrings usingTooManyDashes :: [CheckExplanationIDString] - usingTooManyDashes = filter ((>2) . length . filter (=='-')) + usingTooManyDashes = filter ((>3) . length . filter (=='-')) allExplanationIdStrings - diff --git a/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs b/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs index d600a51fa05..70370de76c0 100644 --- a/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs +++ b/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs @@ -33,9 +33,9 @@ md5Check proxy md5Int = structureHash proxy @?= md5FromInteger md5Int md5CheckGenericPackageDescription :: Proxy GenericPackageDescription -> Assertion md5CheckGenericPackageDescription proxy = md5Check proxy #if MIN_VERSION_base(4,19,0) - 0xe28f08e7ac644f836d8b3fe7f9428dcf + 0xbcb29fedd00cda89586faf963028e31d #else - 0x3442058190aa48c2f795b83ee995f702 + 0xbb48247a1d86d5b514ffc4d6df853c74 #endif md5CheckLocalBuildInfo :: Proxy LocalBuildInfo -> Assertion diff --git a/Cabal-tree-diff/src/Data/TreeDiff/Instances/Cabal.hs b/Cabal-tree-diff/src/Data/TreeDiff/Instances/Cabal.hs index 15fae62649e..f3c61814e7e 100644 --- a/Cabal-tree-diff/src/Data/TreeDiff/Instances/Cabal.hs +++ b/Cabal-tree-diff/src/Data/TreeDiff/Instances/Cabal.hs @@ -72,6 +72,7 @@ instance ToExpr CompilerFlavor instance ToExpr CompilerId instance ToExpr ComponentId instance ToExpr DebugInfoLevel +instance ToExpr DefaultBounds instance ToExpr DefUnitId instance ToExpr DumpBuildInfo instance ToExpr ExeDependency diff --git a/cabal-testsuite/PackageTests/DefaultPackageBounds/bar/Main.hs b/cabal-testsuite/PackageTests/DefaultPackageBounds/bar/Main.hs new file mode 100644 index 00000000000..f77c6bfe548 --- /dev/null +++ b/cabal-testsuite/PackageTests/DefaultPackageBounds/bar/Main.hs @@ -0,0 +1,5 @@ +-- | + +module Main where + +main = pure () diff --git a/cabal-testsuite/PackageTests/DefaultPackageBounds/bar/bar.cabal b/cabal-testsuite/PackageTests/DefaultPackageBounds/bar/bar.cabal new file mode 100644 index 00000000000..ce082d386f2 --- /dev/null +++ b/cabal-testsuite/PackageTests/DefaultPackageBounds/bar/bar.cabal @@ -0,0 +1,7 @@ +cabal-version: 3.14 +name: bar +version: 0.1.0.0 + +executable bar + default-language: Haskell2010 + main-is: Main.hs diff --git a/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.out b/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.out new file mode 100644 index 00000000000..75f7582b538 --- /dev/null +++ b/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.out @@ -0,0 +1,37 @@ +# cabal build +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following would be built: + - bar-0.1.0.0 (exe:bar) (first run) + - foo-0.1.0.0 (lib) (first run) +# cabal build +Resolving dependencies... +Error: [Cabal-7107] +Could not resolve dependencies: +[__0] trying: foo-0.1.0.0 (user goal) +[__1] rejecting: foo:-build-depends-conflict (constraint from config file, command line flag, or user target requires opposite flag selection) +[__1] trying: foo:+build-depends-conflict +[__2] next goal: time (dependency of foo +/-build-depends-conflict) +[__2] rejecting: time-/installed- (conflict: foo +build-depends-conflict => time<0.1) +[__2] fail (backjumping, conflict set: foo, time, foo:build-depends-conflict) +After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: foo (4), foo:build-depends-conflict (3), time (2) +# cabal build +Resolving dependencies... +Error: [Cabal-7107] +Could not resolve dependencies: +[__0] trying: bar-0.1.0.0 (user goal) +[__1] trying: foo-0.1.0.0 (user goal) +[__2] rejecting: foo:-build-tool-conflict (constraint from config file, command line flag, or user target requires opposite flag selection) +[__2] trying: foo:+build-tool-conflict +[__3] next goal: foo:bar:exe.bar (dependency of foo +/-build-tool-conflict) +[__3] rejecting: foo:bar:exe.bar~>bar-0.1.0.0 (conflict: foo +build-tool-conflict => foo:bar:exe.bar (exe bar)<0.1) +[__3] rejecting: foo:bar:exe.bar-0.1.0.0 (multiple instances) +[__3] fail (backjumping, conflict set: bar, foo, foo:bar:exe.bar, foo:build-tool-conflict) +After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: foo (4), foo:bar:exe.bar (3), foo:build-tool-conflict (3), bar (2) +Try running with --minimize-conflict-set to improve the error message. +# cabal build +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following would be built: + - bar-0.1.0.0 (exe:bar) (first run) + - foo-0.1.0.0 (lib) (first run) diff --git a/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.project b/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.project new file mode 100644 index 00000000000..01850a34e25 --- /dev/null +++ b/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.project @@ -0,0 +1 @@ +packages: . bar diff --git a/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.test.hs b/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.test.hs new file mode 100644 index 00000000000..c5c6e6eba18 --- /dev/null +++ b/cabal-testsuite/PackageTests/DefaultPackageBounds/cabal.test.hs @@ -0,0 +1,7 @@ +import Test.Cabal.Prelude + +main = cabalTest $ withProjectFile "cabal.project" $ do + cabal "build" ["foo", "--dry-run"] + fails $ cabal "build" ["foo", "--dry-run", "-fbuild-depends-conflict"] + fails $ cabal "build" ["foo", "--dry-run", "-fbuild-tool-conflict"] + cabal "build" ["foo", "--dry-run", "-fbuild-depends-conflict", "--allow-newer=time"] diff --git a/cabal-testsuite/PackageTests/DefaultPackageBounds/foo.cabal b/cabal-testsuite/PackageTests/DefaultPackageBounds/foo.cabal new file mode 100644 index 00000000000..6f88a55e5bf --- /dev/null +++ b/cabal-testsuite/PackageTests/DefaultPackageBounds/foo.cabal @@ -0,0 +1,33 @@ +cabal-version: 3.14 +name: foo +version: 0.1.0.0 + +default-package-bounds + build-depends: + , time <0.1 + build-tool-depends: + , bar:bar <0.1 + +flag build-depends-conflict + manual: True + default: False + description: cause conflict + +flag build-tool-conflict + manual: True + default: False + description: cause conflict + +library + if flag(build-depends-conflict) + build-depends: + time + else + build-depends: + time >0 + default-language: Haskell2010 + + if flag(build-tool-conflict) + build-tool-depends: bar:bar + else + build-tool-depends: bar:bar >0 diff --git a/cabal-testsuite/PackageTests/Regression/T9640/cabal.out b/cabal-testsuite/PackageTests/Regression/T9640/cabal.out index 4c0f119823f..907c05a57be 100644 --- a/cabal-testsuite/PackageTests/Regression/T9640/cabal.out +++ b/cabal-testsuite/PackageTests/Regression/T9640/cabal.out @@ -10,7 +10,7 @@ Configuring one-custom-0.1.0.0... Preprocessing library for one-custom-0.1.0.0... Building library for one-custom-0.1.0.0... Installing library in -Warning: depend-on-custom-with-exe.cabal:16:1: Ignoring trailing fields after sections: "ghc-options" +Warning: depend-on-custom-with-exe.cabal:16:1: Ignoring trailing fields after sections: "ghc-options". Consider moving these fields before any stanzas in your cabal file. Configuring library for depend-on-custom-with-exe-0.1.0.0... Preprocessing library for depend-on-custom-with-exe-0.1.0.0... Building library for depend-on-custom-with-exe-0.1.0.0...