From e2beec069cbd5dfc26d0ccf55dc19927b1ba2c51 Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Tue, 21 Nov 2023 09:52:41 +0100 Subject: [PATCH 1/7] Implement package-constraints field --- .../Distribution/PackageDescription/FieldGrammar.hs | 3 +++ .../src/Distribution/Types/PackageDescription.hs | 5 +++++ .../Distribution/Types/PackageDescription/Lens.hs | 5 +++++ Cabal/src/Distribution/PackageDescription/Check.hs | 1 + .../Distribution/Solver/Modular/IndexConversion.hs | 12 ++++++++++-- 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Cabal-syntax/src/Distribution/PackageDescription/FieldGrammar.hs b/Cabal-syntax/src/Distribution/PackageDescription/FieldGrammar.hs index c60040f8e34..fbee4a61b64 100644 --- a/Cabal-syntax/src/Distribution/PackageDescription/FieldGrammar.hs +++ b/Cabal-syntax/src/Distribution/PackageDescription/FieldGrammar.hs @@ -104,6 +104,7 @@ packageDescriptionFieldGrammar , c (List FSep (Identity (SymbolicPath PackageDir LicenseFile)) (SymbolicPath PackageDir LicenseFile)) , c (List FSep TestedWith (CompilerFlavor, VersionRange)) , c (List VCat FilePathNT String) + , c (List CommaVCat (Identity Dependency) Dependency) , c FilePathNT , c CompatLicenseFile , c CompatFilePath @@ -146,6 +147,8 @@ packageDescriptionFieldGrammar = <*> monoidalFieldAla "extra-source-files" formatExtraSourceFiles L.extraSrcFiles <*> monoidalFieldAla "extra-tmp-files" (alaList' VCat FilePathNT) L.extraTmpFiles <*> monoidalFieldAla "extra-doc-files" (alaList' VCat FilePathNT) L.extraDocFiles + <*> monoidalFieldAla "package-constraints" formatDependencyList L.packageConstraints + ^^^ availableSince CabalSpecV3_12 [] where packageIdentifierGrammar = PackageIdentifier diff --git a/Cabal-syntax/src/Distribution/Types/PackageDescription.hs b/Cabal-syntax/src/Distribution/Types/PackageDescription.hs index f8f84311cec..4fa9fbef4f4 100644 --- a/Cabal-syntax/src/Distribution/Types/PackageDescription.hs +++ b/Cabal-syntax/src/Distribution/Types/PackageDescription.hs @@ -146,6 +146,8 @@ data PackageDescription = PackageDescription , extraSrcFiles :: [FilePath] , extraTmpFiles :: [FilePath] , extraDocFiles :: [FilePath] + , -- default constraints to override unversioned dependencies + packageConstraints :: [Dependency] } deriving (Generic, Show, Read, Eq, Ord, Typeable, Data) @@ -232,6 +234,7 @@ emptyPackageDescription = , extraSrcFiles = [] , extraTmpFiles = [] , extraDocFiles = [] + , packageConstraints = [] } -- --------------------------------------------------------------------------- @@ -488,6 +491,7 @@ instance L.HasBuildInfos PackageDescription where a22 a23 a24 + a25 ) = PackageDescription a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 <$> (traverse . L.buildInfo) f x1 -- library @@ -501,3 +505,4 @@ instance L.HasBuildInfos PackageDescription where <*> pure a22 -- extra src files <*> pure a23 -- extra temp files <*> pure a24 -- extra doc files + <*> pure a25 -- default constraints diff --git a/Cabal-syntax/src/Distribution/Types/PackageDescription/Lens.hs b/Cabal-syntax/src/Distribution/Types/PackageDescription/Lens.hs index f2fdc7e57d6..09a10bebc67 100644 --- a/Cabal-syntax/src/Distribution/Types/PackageDescription/Lens.hs +++ b/Cabal-syntax/src/Distribution/Types/PackageDescription/Lens.hs @@ -19,6 +19,7 @@ import Distribution.Types.Benchmark.Lens (benchmarkBuildInfo, benchmarkName) import Distribution.Types.BuildInfo (BuildInfo) import Distribution.Types.BuildType (BuildType) import Distribution.Types.ComponentName (ComponentName (..)) +import Distribution.Types.Dependency (Dependency (..)) import Distribution.Types.Executable (Executable, exeModules) import Distribution.Types.Executable.Lens (exeBuildInfo, exeName) import Distribution.Types.ForeignLib (ForeignLib, foreignLibModules) @@ -158,6 +159,10 @@ extraDocFiles :: Lens' PackageDescription [String] extraDocFiles f s = fmap (\x -> s{T.extraDocFiles = x}) (f (T.extraDocFiles s)) {-# INLINE extraDocFiles #-} +packageConstraints :: Lens' PackageDescription [Dependency] +packageConstraints f s = fmap (\x -> s{T.packageConstraints = x}) (f (T.packageConstraints s)) +{-# INLINE packageConstraints #-} + -- | @since 3.0.0.0 allLibraries :: Traversal' PackageDescription Library allLibraries f pd = mk <$> traverse f (T.library pd) <*> traverse f (T.subLibraries pd) diff --git a/Cabal/src/Distribution/PackageDescription/Check.hs b/Cabal/src/Distribution/PackageDescription/Check.hs index fb3c05a64b6..1d65cd76f11 100644 --- a/Cabal/src/Distribution/PackageDescription/Check.hs +++ b/Cabal/src/Distribution/PackageDescription/Check.hs @@ -395,6 +395,7 @@ checkPackageDescription extraSrcFiles_ extraTmpFiles_ extraDocFiles_ + _packageConstraints ) = do -- § Sanity checks. checkPackageId package_ diff --git a/cabal-install-solver/src/Distribution/Solver/Modular/IndexConversion.hs b/cabal-install-solver/src/Distribution/Solver/Modular/IndexConversion.hs index 72d0b8193e3..1b938b1c1bc 100644 --- a/cabal-install-solver/src/Distribution/Solver/Modular/IndexConversion.hs +++ b/cabal-install-solver/src/Distribution/Solver/Modular/IndexConversion.hs @@ -20,6 +20,7 @@ import Distribution.Types.ComponentName -- from Cabal import Distribution.Types.CondTree -- from Cabal import Distribution.Types.MungedPackageId -- from Cabal import Distribution.Types.MungedPackageName -- from Cabal +import Distribution.Types.VersionRange -- from Cabal import Distribution.PackageDescription -- from Cabal import Distribution.PackageDescription.Configuration import qualified Distribution.Simple.PackageIndex as SI @@ -339,8 +340,7 @@ convCondTree flags dr pkg os arch cinfo pn fds comp getInfo solveExes@(SolveExec mergeSimpleDeps $ [ D.Simple singleDep comp | dep <- ds - , singleDep <- convLibDeps dr dep ] -- unconditional package dependencies - + , singleDep <- convLibDeps dr (alterDep dep) ] -- unconditional package dependencies ++ L.map (\e -> D.Simple (LDep dr (Ext e)) comp) (allExtensions bi) -- unconditional extension dependencies ++ L.map (\l -> D.Simple (LDep dr (Lang l)) comp) (allLanguages bi) -- unconditional language dependencies ++ L.map (\(PkgconfigDependency pkn vr) -> D.Simple (LDep dr (Pkg pkn vr)) comp) (pkgconfigDepends bi) -- unconditional pkg-config dependencies @@ -358,6 +358,14 @@ convCondTree flags dr pkg os arch cinfo pn fds comp getInfo solveExes@(SolveExec where bi = getInfo info + -- apply package-constraints field of pkg to the actual declared + -- dependencies + alterDep x@(Dependency name vorig ls) = + maybe x (\v -> Dependency name v ls) $ + listToMaybe [ intersectVersionRanges vorig v2 + | Dependency name2 v2 _ <- packageConstraints pkg + , name2 == name ] + data SimpleFlaggedDepKey qpn = SimpleFlaggedDepKey (PkgComponent qpn) Component deriving (Eq, Ord) From 2eccff6012681cb221ae429cbb9f8b7f99b85ac1 Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Tue, 21 Nov 2023 09:57:19 +0100 Subject: [PATCH 2/7] Bound package-constraints to CabalSpecV3_12 --- Cabal-syntax/src/Distribution/CabalSpecVersion.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Cabal-syntax/src/Distribution/CabalSpecVersion.hs b/Cabal-syntax/src/Distribution/CabalSpecVersion.hs index 6290fa9166e..1cb94acb94c 100644 --- a/Cabal-syntax/src/Distribution/CabalSpecVersion.hs +++ b/Cabal-syntax/src/Distribution/CabalSpecVersion.hs @@ -32,7 +32,8 @@ data CabalSpecVersion CabalSpecV3_4 | CabalSpecV3_6 | CabalSpecV3_8 - -- 3.10: no changes + | -- 3.10 -- 3.11: no changes + CabalSpecV3_12 deriving (Eq, Ord, Show, Read, Enum, Bounded, Typeable, Data, Generic) instance Binary CabalSpecVersion @@ -43,6 +44,7 @@ instance NFData CabalSpecVersion where rnf = genericRnf -- -- @since 3.0.0.0 showCabalSpecVersion :: CabalSpecVersion -> String +showCabalSpecVersion CabalSpecV3_12 = "3.12" showCabalSpecVersion CabalSpecV3_8 = "3.8" showCabalSpecVersion CabalSpecV3_6 = "3.6" showCabalSpecVersion CabalSpecV3_4 = "3.4" @@ -63,13 +65,14 @@ showCabalSpecVersion CabalSpecV1_2 = "1.2" showCabalSpecVersion CabalSpecV1_0 = "1.0" cabalSpecLatest :: CabalSpecVersion -cabalSpecLatest = CabalSpecV3_8 +cabalSpecLatest = CabalSpecV3_12 -- | Parse 'CabalSpecVersion' from version digits. -- -- It may fail if for recent versions the version is not exact. cabalSpecFromVersionDigits :: [Int] -> Maybe CabalSpecVersion cabalSpecFromVersionDigits v + | v == [3, 12] = Just CabalSpecV3_12 | v == [3, 8] = Just CabalSpecV3_8 | v == [3, 6] = Just CabalSpecV3_6 | v == [3, 4] = Just CabalSpecV3_4 @@ -92,6 +95,7 @@ cabalSpecFromVersionDigits v -- | @since 3.4.0.0 cabalSpecToVersionDigits :: CabalSpecVersion -> [Int] +cabalSpecToVersionDigits CabalSpecV3_12 = [3, 12] cabalSpecToVersionDigits CabalSpecV3_8 = [3, 8] cabalSpecToVersionDigits CabalSpecV3_6 = [3, 6] cabalSpecToVersionDigits CabalSpecV3_4 = [3, 4] From 8ef0e356de7711d08334fc801de26a065a2b5910 Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Sat, 2 Dec 2023 23:38:51 +0100 Subject: [PATCH 3/7] Extend cabal check for package-constraints --- .../Distribution/PackageDescription/Check.hs | 16 ++++++++++++++-- .../PackageDescription/Check/Common.hs | 18 +++++++++++------- .../PackageDescription/Check/Target.hs | 4 ++++ .../PackageDescription/Check/Warning.hs | 2 ++ 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/Cabal/src/Distribution/PackageDescription/Check.hs b/Cabal/src/Distribution/PackageDescription/Check.hs index 1d65cd76f11..c44d63b0939 100644 --- a/Cabal/src/Distribution/PackageDescription/Check.hs +++ b/Cabal/src/Distribution/PackageDescription/Check.hs @@ -283,6 +283,7 @@ checkGenericPackageDescription let ads = maybe [] ((: []) . extractAssocDeps pName) condLibrary_ ++ map (uncurry extractAssocDeps) condSubLibraries_ + ++ [Left (packageConstraints packageDescription_)] case condLibrary_ of Just cl -> @@ -395,7 +396,7 @@ checkPackageDescription extraSrcFiles_ extraTmpFiles_ extraDocFiles_ - _packageConstraints + packageConstraints_ ) = do -- § Sanity checks. checkPackageId package_ @@ -506,6 +507,17 @@ checkPackageDescription mapM_ (checkGlobFile specVersion_ "." "extra-source-files") extraSrcFiles_ mapM_ (checkGlobFile specVersion_ "." "extra-doc-files") extraDocFiles_ mapM_ (checkGlobFile specVersion_ dataDir_ "data-files") dataFiles_ + + -- PVP: we check for base and all other deps. + (ids, rds) <- + partitionDeps + [] + [mkUnqualComponentName "base"] + (mergeDependencies packageConstraints_) + let ick = const (PackageDistInexcusable BaseNoUpperBounds) + rck = PackageDistSuspiciousWarn . MissingUpperBounds CETPackageConstraints + checkPVP ick ids + checkPVPs rck rds where checkNull :: Monad m @@ -898,7 +910,7 @@ extractAssocDeps n ct = in -- Merging is fine here, remember the specific -- library dependencies will be checked branch -- by branch. - (n, snd a) + Right (n, snd a) -- | August 2022: this function is an oddity due to the historical -- GenericPackageDescription/PackageDescription split (check diff --git a/Cabal/src/Distribution/PackageDescription/Check/Common.hs b/Cabal/src/Distribution/PackageDescription/Check/Common.hs index 4c528831430..94c5e0643c4 100644 --- a/Cabal/src/Distribution/PackageDescription/Check/Common.hs +++ b/Cabal/src/Distribution/PackageDescription/Check/Common.hs @@ -52,9 +52,9 @@ checkCustomField (n, _) = -- PVP types/functions -- ------------------------------------------------------------ --- A library name / dependencies association list. Ultimately to be --- fed to PVP check. -type AssocDep = (UnqualComponentName, [Dependency]) +-- Either a list of dependencies coming from @package-constraints@ or a library +-- name / dependencies association list. Ultimately to be fed to PVP check. +type AssocDep = Either [Dependency] (UnqualComponentName, [Dependency]) -- Convenience function to partition important dependencies by name. To -- be used together with checkPVP. Important: usually “base” or “Cabal”, @@ -67,7 +67,7 @@ type AssocDep = (UnqualComponentName, [Dependency]) partitionDeps :: Monad m => [AssocDep] -- Possibly inherited dependencies, i.e. - -- dependencies from internal/main libs. + -- dependencies from internal/main libs, and from @package-constraints@. -> [UnqualComponentName] -- List of package names ("base", "Cabal"…) -> [Dependency] -- Dependencies to check. -> CheckM m ([Dependency], [Dependency]) @@ -77,11 +77,11 @@ partitionDeps ads ns ds = do -- names of our dependencies dqs = map unqualName ds -- shared targets that match - fads = filter (flip elem dqs . fst) ads + fads = filter (either (const True) (flip elem dqs . fst)) ads -- the names of such targets - inNam = nub $ map fst fads :: [UnqualComponentName] + inNam = nub $ mapMaybe (either (const Nothing) (Just . fst)) fads :: [UnqualComponentName] -- the dependencies of such targets - inDep = concatMap snd fads :: [Dependency] + inDep = concatMap (either id snd) fads :: [Dependency] -- We exclude from checks: -- 1. dependencies which are shared with main library / a @@ -89,11 +89,15 @@ partitionDeps ads ns ds = do -- 2. the names of main library / sub libraries themselves. -- -- So in myPackage.cabal + -- + -- package-constraints: bar < 100 + -- -- library -- build-depends: text < 5 -- ⁝ -- build-depends: myPackage, ← no warning, internal -- text, ← no warning, inherited + -- bar, ← no warning, inherited -- monadacme ← warning! let fFun d = notElem (unqualName d) inNam diff --git a/Cabal/src/Distribution/PackageDescription/Check/Target.hs b/Cabal/src/Distribution/PackageDescription/Check/Target.hs index 99ae5a8d379..ef2b90b566d 100644 --- a/Cabal/src/Distribution/PackageDescription/Check/Target.hs +++ b/Cabal/src/Distribution/PackageDescription/Check/Target.hs @@ -13,6 +13,8 @@ module Distribution.PackageDescription.Check.Target , checkExecutable , checkTestSuite , checkBenchmark + -- Utils + , mergeDependencies ) where import Distribution.Compat.Prelude @@ -743,6 +745,7 @@ isInternalTarget (CETExecutable{}) = False isInternalTarget (CETTest{}) = True isInternalTarget (CETBenchmark{}) = True isInternalTarget (CETSetup{}) = False +isInternalTarget (CETPackageConstraints{}) = True -- ------------------------------------------------------------ -- Options @@ -759,6 +762,7 @@ cet2bit (CETExecutable{}) = BITOther cet2bit (CETTest{}) = BITTestBench cet2bit (CETBenchmark{}) = BITTestBench cet2bit CETSetup = BITOther +cet2bit CETPackageConstraints = BITOther -- General check on all options (ghc, C, C++, …) for common inaccuracies. checkBuildInfoOptions :: Monad m => BITarget -> BuildInfo -> CheckM m () diff --git a/Cabal/src/Distribution/PackageDescription/Check/Warning.hs b/Cabal/src/Distribution/PackageDescription/Check/Warning.hs index a8d9ac78195..a6e2d18587f 100644 --- a/Cabal/src/Distribution/PackageDescription/Check/Warning.hs +++ b/Cabal/src/Distribution/PackageDescription/Check/Warning.hs @@ -271,6 +271,7 @@ data CEType | CETTest UnqualComponentName | CETBenchmark UnqualComponentName | CETSetup + | CETPackageConstraints deriving (Eq, Ord, Show) -- | Pretty printing `CEType`. @@ -282,6 +283,7 @@ ppCET cet = case cet of CETTest n -> "test suite" ++ qn n CETBenchmark n -> "benchmark" ++ qn n CETSetup -> "custom-setup" + CETPackageConstraints -> "package-constraints" where qn :: UnqualComponentName -> String qn wn = (" " ++) . quote . prettyShow $ wn From b7126893a12ba4bfb08e54d3164134965946231c Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Tue, 21 Nov 2023 10:00:08 +0100 Subject: [PATCH 4/7] Provide a better explanation when ignoring fields --- Cabal-syntax/src/Distribution/PackageDescription/Parsec.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cabal-syntax/src/Distribution/PackageDescription/Parsec.hs b/Cabal-syntax/src/Distribution/PackageDescription/Parsec.hs index bee6965c127..fd5b5cd19a2 100644 --- a/Cabal-syntax/src/Distribution/PackageDescription/Parsec.hs +++ b/Cabal-syntax/src/Distribution/PackageDescription/Parsec.hs @@ -240,7 +240,7 @@ goSections specVer = traverse_ process process (Field (Name pos name) _) = lift $ parseWarning pos PWTTrailingFields $ - "Ignoring trailing fields after sections: " ++ show name + "Ignoring trailing fields after sections: " ++ show name ++ ". Consider moving these fields before any stanzas in your cabal file." process (Section name args secFields) = parseSection name args secFields From ab5359f485ec545cb69299446214b9fb227417ed Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Tue, 21 Nov 2023 14:25:45 +0100 Subject: [PATCH 5/7] Add test for package-constraints --- .../Distribution/Utils/Structured.hs | 8 ++--- .../PackageTests/PackageConstraints/cabal.out | 32 +++++++++++++++++++ .../PackageConstraints/cabal.project | 1 + .../PackageConstraints/cabal.test.hs | 6 ++++ .../PackageTests/PackageConstraints/foo.cabal | 21 ++++++++++++ 5 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 cabal-testsuite/PackageTests/PackageConstraints/cabal.out create mode 100644 cabal-testsuite/PackageTests/PackageConstraints/cabal.project create mode 100644 cabal-testsuite/PackageTests/PackageConstraints/cabal.test.hs create mode 100644 cabal-testsuite/PackageTests/PackageConstraints/foo.cabal diff --git a/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs b/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs index efe8151b705..8257809899e 100644 --- a/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs +++ b/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs @@ -27,14 +27,14 @@ tests = testGroup "Distribution.Utils.Structured" -- The difference is in encoding of newtypes #if MIN_VERSION_base(4,19,0) , testCase "GenericPackageDescription" $ - md5Check (Proxy :: Proxy GenericPackageDescription) 0xf5fdb32b43aca790192f44d9ecaa9689 + md5Check (Proxy :: Proxy GenericPackageDescription) 0x0f5eb969ec842514be8b7a22eddd0dd7 , testCase "LocalBuildInfo" $ - md5Check (Proxy :: Proxy LocalBuildInfo) 0x205fbe2649bc5e488bce50c07a71cadb + md5Check (Proxy :: Proxy LocalBuildInfo) 0x720c89fdacc2ced66876cb1a0858d2aa #elif MIN_VERSION_base(4,7,0) , testCase "GenericPackageDescription" $ - md5Check (Proxy :: Proxy GenericPackageDescription) 0xb287a6f04e34ef990cdd15bc6cb01c76 + md5Check (Proxy :: Proxy GenericPackageDescription) 0x21f4a39a92b847b6632462c8a60539f6 , testCase "LocalBuildInfo" $ - md5Check (Proxy :: Proxy LocalBuildInfo) 0x26e91a71ebd19d4d6ce37f798ede249a + md5Check (Proxy :: Proxy LocalBuildInfo) 0x8f30685ed435311bb5bd30b921356280 #endif ] diff --git a/cabal-testsuite/PackageTests/PackageConstraints/cabal.out b/cabal-testsuite/PackageTests/PackageConstraints/cabal.out new file mode 100644 index 00000000000..71a64272e16 --- /dev/null +++ b/cabal-testsuite/PackageTests/PackageConstraints/cabal.out @@ -0,0 +1,32 @@ +# 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] rejecting: foo:-conflicting-constraints (constraint from config file, command line flag, or user target requires opposite flag selection) +[__1] trying: foo:+conflicting-constraints +[__2] next goal: time (dependency of foo +/-conflicting-constraints) +[__2] rejecting: time-/installed- (conflict: foo +conflicting-constraints => time<1 && >1) +[__2] fail (backjumping, conflict set: foo, time, foo:conflicting-constraints) +After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: foo (4), foo:conflicting-constraints (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: +- time +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/PackageConstraints/cabal.project b/cabal-testsuite/PackageTests/PackageConstraints/cabal.project new file mode 100644 index 00000000000..e6fdbadb439 --- /dev/null +++ b/cabal-testsuite/PackageTests/PackageConstraints/cabal.project @@ -0,0 +1 @@ +packages: . diff --git a/cabal-testsuite/PackageTests/PackageConstraints/cabal.test.hs b/cabal-testsuite/PackageTests/PackageConstraints/cabal.test.hs new file mode 100644 index 00000000000..27ae86fd626 --- /dev/null +++ b/cabal-testsuite/PackageTests/PackageConstraints/cabal.test.hs @@ -0,0 +1,6 @@ +import Test.Cabal.Prelude + +main = cabalTest $ withProjectFile "cabal.project" $ do + cabal "build" ["foo"] + fails $ cabal "build" ["foo", "-f+conflicting-constraints"] + fails $ cabal "check" [] diff --git a/cabal-testsuite/PackageTests/PackageConstraints/foo.cabal b/cabal-testsuite/PackageTests/PackageConstraints/foo.cabal new file mode 100644 index 00000000000..f2e4bb6fe6d --- /dev/null +++ b/cabal-testsuite/PackageTests/PackageConstraints/foo.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.12 +name: foo +version: 0.1.0.0 + +package-constraints: + , time >1 + , deepseq <0 + +flag conflicting-constraints + manual: True + default: False + +library + if flag(conflicting-constraints) + build-depends: + time <1 + else + build-depends: + time + + default-language: Haskell2010 From f0f9381c270a3bbf07f73952666000efe6e918d1 Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Tue, 21 Nov 2023 16:17:38 +0100 Subject: [PATCH 6/7] Update golden files --- .../ParserTests/regressions/Octree-0.5.expr | 3 +- .../ParserTests/regressions/anynone.expr | 3 +- .../ParserTests/regressions/big-version.expr | 3 +- .../regressions/common-conditional.expr | 3 +- .../tests/ParserTests/regressions/common.expr | 3 +- .../ParserTests/regressions/common2.expr | 3 +- .../ParserTests/regressions/common3.expr | 3 +- .../tests/ParserTests/regressions/elif.expr | 380 +++++---- .../tests/ParserTests/regressions/elif2.expr | 791 +++++++++--------- .../ParserTests/regressions/encoding-0.8.expr | 275 +++--- .../ParserTests/regressions/generics-sop.expr | 3 +- .../ParserTests/regressions/hasktorch.expr | 3 +- .../regressions/hidden-main-lib.expr | 228 ++--- .../ParserTests/regressions/indentation.expr | 230 ++--- .../ParserTests/regressions/indentation2.expr | 213 ++--- .../ParserTests/regressions/indentation3.expr | 220 ++--- .../ParserTests/regressions/issue-5055.expr | 3 +- .../ParserTests/regressions/issue-5846.expr | 3 +- .../ParserTests/regressions/issue-6083-a.expr | 3 +- .../ParserTests/regressions/issue-6083-b.expr | 3 +- .../ParserTests/regressions/issue-6083-c.expr | 3 +- .../regressions/issue-6083-pkg-pkg.expr | 3 +- .../ParserTests/regressions/issue-774.expr | 234 +++--- .../regressions/jaeger-flamegraph.expr | 3 +- .../regressions/leading-comma-2.expr | 337 ++++---- .../regressions/leading-comma.expr | 323 ++++--- .../tests/ParserTests/regressions/libpq1.expr | 3 +- .../tests/ParserTests/regressions/libpq2.expr | 3 +- .../ParserTests/regressions/mixin-1.expr | 312 +++---- .../ParserTests/regressions/mixin-2.expr | 312 +++---- .../ParserTests/regressions/mixin-3.expr | 280 ++++--- .../ParserTests/regressions/monad-param.expr | 3 +- .../regressions/multiple-libs-2.expr | 375 +++++---- .../ParserTests/regressions/noVersion.expr | 228 ++--- .../regressions/nothing-unicode.expr | 371 ++++---- .../tests/ParserTests/regressions/shake.expr | 3 +- .../tests/ParserTests/regressions/spdx-1.expr | 208 ++--- .../tests/ParserTests/regressions/spdx-2.expr | 213 ++--- .../tests/ParserTests/regressions/spdx-3.expr | 213 ++--- .../regressions/th-lift-instances.expr | 3 +- .../ParserTests/regressions/version-sets.expr | 550 ++++++------ .../regressions/wl-pprint-indef.expr | 464 +++++----- 42 files changed, 3522 insertions(+), 3298 deletions(-) diff --git a/Cabal-tests/tests/ParserTests/regressions/Octree-0.5.expr b/Cabal-tests/tests/ParserTests/regressions/Octree-0.5.expr index d754955f46d..6d4a9fecad5 100644 --- a/Cabal-tests/tests/ParserTests/regressions/Octree-0.5.expr +++ b/Cabal-tests/tests/ParserTests/regressions/Octree-0.5.expr @@ -66,7 +66,8 @@ GenericPackageDescription { dataDir = ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just diff --git a/Cabal-tests/tests/ParserTests/regressions/anynone.expr b/Cabal-tests/tests/ParserTests/regressions/anynone.expr index 17e61add696..e404a2df6bf 100644 --- a/Cabal-tests/tests/ParserTests/regressions/anynone.expr +++ b/Cabal-tests/tests/ParserTests/regressions/anynone.expr @@ -32,7 +32,8 @@ GenericPackageDescription { dataDir = ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just diff --git a/Cabal-tests/tests/ParserTests/regressions/big-version.expr b/Cabal-tests/tests/ParserTests/regressions/big-version.expr index 943e723c191..059c423f878 100644 --- a/Cabal-tests/tests/ParserTests/regressions/big-version.expr +++ b/Cabal-tests/tests/ParserTests/regressions/big-version.expr @@ -34,7 +34,8 @@ GenericPackageDescription { dataDir = ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just diff --git a/Cabal-tests/tests/ParserTests/regressions/common-conditional.expr b/Cabal-tests/tests/ParserTests/regressions/common-conditional.expr index 874b4964267..d1780b6a2b3 100644 --- a/Cabal-tests/tests/ParserTests/regressions/common-conditional.expr +++ b/Cabal-tests/tests/ParserTests/regressions/common-conditional.expr @@ -44,7 +44,8 @@ GenericPackageDescription { dataDir = ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [ MkPackageFlag { diff --git a/Cabal-tests/tests/ParserTests/regressions/common.expr b/Cabal-tests/tests/ParserTests/regressions/common.expr index 9a1c7a53df0..3ef324b25b3 100644 --- a/Cabal-tests/tests/ParserTests/regressions/common.expr +++ b/Cabal-tests/tests/ParserTests/regressions/common.expr @@ -47,7 +47,8 @@ GenericPackageDescription { dataDir = ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just diff --git a/Cabal-tests/tests/ParserTests/regressions/common2.expr b/Cabal-tests/tests/ParserTests/regressions/common2.expr index f74c75224ef..1d73c11a4b9 100644 --- a/Cabal-tests/tests/ParserTests/regressions/common2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/common2.expr @@ -43,7 +43,8 @@ GenericPackageDescription { dataDir = ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just diff --git a/Cabal-tests/tests/ParserTests/regressions/common3.expr b/Cabal-tests/tests/ParserTests/regressions/common3.expr index 91c43cb0755..7d4fa2043b9 100644 --- a/Cabal-tests/tests/ParserTests/regressions/common3.expr +++ b/Cabal-tests/tests/ParserTests/regressions/common3.expr @@ -47,7 +47,8 @@ GenericPackageDescription { dataDir = ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just diff --git a/Cabal-tests/tests/ParserTests/regressions/elif.expr b/Cabal-tests/tests/ParserTests/regressions/elif.expr index b9ea1f18bc9..4e64fcbb936 100644 --- a/Cabal-tests/tests/ParserTests/regressions/elif.expr +++ b/Cabal-tests/tests/ParserTests/regressions/elif.expr @@ -1,184 +1,196 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [CondBranch - {condBranchCondition = `Var (OS Linux)`, - condBranchIfFalse = Nothing, - condBranchIfTrue = CondNode - {condTreeComponents = [], - condTreeConstraints = [Dependency - (PackageName - "unix") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet], - condTreeData = Library - {exposedModules = [], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Nothing, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor - [] - [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor - [] - [], - sharedOptions = PerCompilerFlavor - [] - [], - staticOptions = PerCompilerFlavor - [] - [], - targetBuildDepends = [Dependency - (PackageName - "unix") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}}], - condTreeConstraints = [], - condTreeData = Library - {exposedModules = [ModuleName "ElseIf"], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Just Haskell2010, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Just Simple, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = "", - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left NONE, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "elif", pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [SourceRepo - {repoBranch = Nothing, - repoKind = RepoHead, - repoLocation = Just "https://github.com/hvr/-.git", - repoModule = Nothing, - repoSubdir = Nothing, - repoTag = Nothing, - repoType = Just (KnownRepoType Git)}], - specVersion = CabalSpecV1_10, - stability = "", - subLibraries = [], - synopsis = "The elif demo", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV1_10, + package = PackageIdentifier { + pkgName = PackageName "elif", + pkgVersion = mkVersion [0]}, + licenseRaw = Left NONE, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [ + SourceRepo { + repoKind = RepoHead, + repoType = Just + (KnownRepoType Git), + repoLocation = Just + "https://github.com/hvr/-.git", + repoModule = Nothing, + repoBranch = Nothing, + repoTag = Nothing, + repoSubdir = Nothing}], + synopsis = "The elif demo", + description = "", + category = "", + customFieldsPD = [], + buildTypeRaw = Just Simple, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [ + ModuleName "ElseIf"], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Just + Haskell2010, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [], + mixins = []}}, + condTreeConstraints = [], + condTreeComponents = [ + CondBranch { + condBranchCondition = + `Var (OS Linux)`, + condBranchIfTrue = CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Nothing, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [ + Dependency + (PackageName "unix") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + mixins = []}}, + condTreeConstraints = [ + Dependency + (PackageName "unix") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + condTreeComponents = []}, + condBranchIfFalse = Nothing}]}, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/elif2.expr b/Cabal-tests/tests/ParserTests/regressions/elif2.expr index b4e7be7dc75..66ba3e801c1 100644 --- a/Cabal-tests/tests/ParserTests/regressions/elif2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/elif2.expr @@ -1,393 +1,400 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [CondBranch - {condBranchCondition = `Var (OS Linux)`, - condBranchIfFalse = Just - CondNode - {condTreeComponents = [CondBranch - {condBranchCondition = `Var (OS Windows)`, - condBranchIfFalse = Just - CondNode - {condTreeComponents = [], - condTreeConstraints = [], - condTreeData = Library - {exposedModules = [], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = False, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Nothing, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor - [] - [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor - [] - [], - sharedOptions = PerCompilerFlavor - [] - [], - staticOptions = PerCompilerFlavor - [] - [], - targetBuildDepends = [], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condBranchIfTrue = CondNode - {condTreeComponents = [], - condTreeConstraints = [Dependency - (PackageName - "Win32") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet], - condTreeData = Library - {exposedModules = [], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Nothing, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor - [] - [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor - [] - [], - sharedOptions = PerCompilerFlavor - [] - [], - staticOptions = PerCompilerFlavor - [] - [], - targetBuildDepends = [Dependency - (PackageName - "Win32") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}}], - condTreeConstraints = [], - condTreeData = Library - {exposedModules = [], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Nothing, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor - [] - [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor - [] - [], - sharedOptions = PerCompilerFlavor - [] - [], - staticOptions = PerCompilerFlavor - [] - [], - targetBuildDepends = [], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condBranchIfTrue = CondNode - {condTreeComponents = [], - condTreeConstraints = [Dependency - (PackageName - "unix") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet], - condTreeData = Library - {exposedModules = [], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Nothing, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor - [] - [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor - [] - [], - sharedOptions = PerCompilerFlavor - [] - [], - staticOptions = PerCompilerFlavor - [] - [], - targetBuildDepends = [Dependency - (PackageName - "unix") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}}], +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV2_2, + package = PackageIdentifier { + pkgName = PackageName "elif", + pkgVersion = mkVersion [0]}, + licenseRaw = Left NONE, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [ + SourceRepo { + repoKind = RepoHead, + repoType = Just + (KnownRepoType Git), + repoLocation = Just + "https://github.com/hvr/-.git", + repoModule = Nothing, + repoBranch = Nothing, + repoTag = Nothing, + repoSubdir = Nothing}], + synopsis = "The elif demo", + description = "", + category = "", + customFieldsPD = [], + buildTypeRaw = Just Simple, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [ + ModuleName "ElseIf"], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Just + Haskell2010, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [], + mixins = []}}, + condTreeConstraints = [], + condTreeComponents = [ + CondBranch { + condBranchCondition = + `Var (OS Linux)`, + condBranchIfTrue = CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Nothing, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [ + Dependency + (PackageName "unix") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + mixins = []}}, + condTreeConstraints = [ + Dependency + (PackageName "unix") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + condTreeComponents = []}, + condBranchIfFalse = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Nothing, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [], + mixins = []}}, + condTreeConstraints = [], + condTreeComponents = [ + CondBranch { + condBranchCondition = + `Var (OS Windows)`, + condBranchIfTrue = CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Nothing, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [ + Dependency + (PackageName "Win32") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + mixins = []}}, + condTreeConstraints = [ + Dependency + (PackageName "Win32") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + condTreeComponents = []}, + condBranchIfFalse = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = False, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Nothing, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [], + mixins = []}}, condTreeConstraints = [], - condTreeData = Library - {exposedModules = [ModuleName "ElseIf"], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Just Haskell2010, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Just Simple, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = "", - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left NONE, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "elif", pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [SourceRepo - {repoBranch = Nothing, - repoKind = RepoHead, - repoLocation = Just "https://github.com/hvr/-.git", - repoModule = Nothing, - repoSubdir = Nothing, - repoTag = Nothing, - repoType = Just (KnownRepoType Git)}], - specVersion = CabalSpecV2_2, - stability = "", - subLibraries = [], - synopsis = "The elif demo", - testSuites = [], - testedWith = []}} + condTreeComponents = []}}]}}]}, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/encoding-0.8.expr b/Cabal-tests/tests/ParserTests/regressions/encoding-0.8.expr index f5447429927..0257756e783 100644 --- a/Cabal-tests/tests/ParserTests/regressions/encoding-0.8.expr +++ b/Cabal-tests/tests/ParserTests/regressions/encoding-0.8.expr @@ -1,130 +1,145 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [], - condTreeConstraints = [Dependency - (PackageName "base") - (UnionVersionRanges - (LaterVersion (mkVersion [4, 4])) - (ThisVersion (mkVersion [4, 4]))) - mainLibSet], - condTreeData = Library - {exposedModules = [ModuleName "Data.Encoding"], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Nothing, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor - ["-Wall", - "-O2", - "-threaded", - "-rtsopts", - "-with-rtsopts=-N1 -A64m"] - [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [Dependency - (PackageName - "base") - (UnionVersionRanges - (LaterVersion - (mkVersion - [4, 4])) - (ThisVersion - (mkVersion - [4, 4]))) - mainLibSet], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Nothing, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = "", - executables = [], - extraDocFiles = [], - extraSrcFiles = ["README.md", "--", "--"], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left NONE, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "encoding", - pkgVersion = mkVersion [0, 8]}, - pkgUrl = "", - setupBuildInfo = Just - SetupBuildInfo - {defaultSetupDepends = False, - setupDepends = [Dependency - (PackageName "base") - (EarlierVersion (mkVersion [5])) - mainLibSet, - Dependency - (PackageName "ghc-prim") - (OrLaterVersion (mkVersion [0])) - mainLibSet]}, - sourceRepos = [], - specVersion = CabalSpecV1_12, - stability = "", - subLibraries = [], - synopsis = "", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV1_12, + package = PackageIdentifier { + pkgName = PackageName + "encoding", + pkgVersion = mkVersion [0, 8]}, + licenseRaw = Left NONE, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [], + synopsis = "", + description = "", + category = "", + customFieldsPD = [], + buildTypeRaw = Nothing, + setupBuildInfo = Just + SetupBuildInfo { + setupDepends = [ + Dependency + (PackageName "base") + (EarlierVersion (mkVersion [5])) + mainLibSet, + Dependency + (PackageName "ghc-prim") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + defaultSetupDepends = False}, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [ + "README.md", + "--", + "--"], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [ + ModuleName "Data.Encoding"], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Nothing, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [ + "-Wall", + "-O2", + "-threaded", + "-rtsopts", + "-with-rtsopts=-N1 -A64m"] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [ + Dependency + (PackageName "base") + (UnionVersionRanges + (LaterVersion + (mkVersion [4, 4])) + (ThisVersion + (mkVersion [4, 4]))) + mainLibSet], + mixins = []}}, + condTreeConstraints = [ + Dependency + (PackageName "base") + (UnionVersionRanges + (LaterVersion + (mkVersion [4, 4])) + (ThisVersion + (mkVersion [4, 4]))) + mainLibSet], + condTreeComponents = []}, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/generics-sop.expr b/Cabal-tests/tests/ParserTests/regressions/generics-sop.expr index b549eb51f71..3804435cf40 100644 --- a/Cabal-tests/tests/ParserTests/regressions/generics-sop.expr +++ b/Cabal-tests/tests/ParserTests/regressions/generics-sop.expr @@ -123,7 +123,8 @@ GenericPackageDescription { extraSrcFiles = [ "CHANGELOG.md"], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just diff --git a/Cabal-tests/tests/ParserTests/regressions/hasktorch.expr b/Cabal-tests/tests/ParserTests/regressions/hasktorch.expr index 92b76bbb0eb..4c5540dfc5b 100644 --- a/Cabal-tests/tests/ParserTests/regressions/hasktorch.expr +++ b/Cabal-tests/tests/ParserTests/regressions/hasktorch.expr @@ -54,7 +54,8 @@ GenericPackageDescription { dataDir = ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [ MkPackageFlag { diff --git a/Cabal-tests/tests/ParserTests/regressions/hidden-main-lib.expr b/Cabal-tests/tests/ParserTests/regressions/hidden-main-lib.expr index bcb1f1f5bbb..ba65ec4771d 100644 --- a/Cabal-tests/tests/ParserTests/regressions/hidden-main-lib.expr +++ b/Cabal-tests/tests/ParserTests/regressions/hidden-main-lib.expr @@ -1,108 +1,120 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [], - condTreeConstraints = [Dependency - (PackageName "base") - (OrLaterVersion (mkVersion [0])) - mainLibSet], - condTreeData = Library - {exposedModules = [ModuleName "ElseIf"], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Just Haskell2010, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [Dependency - (PackageName - "base") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Just Simple, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = "", - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left NONE, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "hidden-main-lib", - pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [], - specVersion = CabalSpecV3_0, - stability = "", - subLibraries = [], - synopsis = "main lib have to be visible", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV3_0, + package = PackageIdentifier { + pkgName = PackageName + "hidden-main-lib", + pkgVersion = mkVersion [0]}, + licenseRaw = Left NONE, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [], + synopsis = + "main lib have to be visible", + description = "", + category = "", + customFieldsPD = [], + buildTypeRaw = Just Simple, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [ + ModuleName "ElseIf"], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Just + Haskell2010, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [ + Dependency + (PackageName "base") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + mixins = []}}, + condTreeConstraints = [ + Dependency + (PackageName "base") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + condTreeComponents = []}, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/indentation.expr b/Cabal-tests/tests/ParserTests/regressions/indentation.expr index 2b747fd1b8e..f7fb0942cae 100644 --- a/Cabal-tests/tests/ParserTests/regressions/indentation.expr +++ b/Cabal-tests/tests/ParserTests/regressions/indentation.expr @@ -1,109 +1,121 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [], - condTreeConstraints = [], - condTreeData = Library - {exposedModules = [], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Just Haskell2010, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Nothing, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = concat - ["* foo\n", - "\n", - " * foo-bar\n", - "\n", - " * foo-baz\n", - "\n", - ".\n", - ".\n", - ".\n", - "some dots"], - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left NONE, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "indentation", - pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [], - specVersion = CabalSpecV3_0, - stability = "", - subLibraries = [], - synopsis = "", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV3_0, + package = PackageIdentifier { + pkgName = PackageName + "indentation", + pkgVersion = mkVersion [0]}, + licenseRaw = Left NONE, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [], + synopsis = "", + description = concat + [ + "* foo\n", + "\n", + " * foo-bar\n", + "\n", + " * foo-baz\n", + "\n", + ".\n", + ".\n", + ".\n", + "some dots"], + category = "", + customFieldsPD = [], + buildTypeRaw = Nothing, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Just + Haskell2010, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [], + mixins = []}}, + condTreeConstraints = [], + condTreeComponents = []}, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/indentation2.expr b/Cabal-tests/tests/ParserTests/regressions/indentation2.expr index 56f23f26d0e..c89569cd619 100644 --- a/Cabal-tests/tests/ParserTests/regressions/indentation2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/indentation2.expr @@ -1,99 +1,114 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [], - condTreeConstraints = [], - condTreeData = Library - {exposedModules = [], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Just Haskell2010, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Nothing, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = concat ["foo\n", " indent2\n", " indent4"], - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left NONE, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "indentation", - pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [], - specVersion = CabalSpecV3_0, - stability = "", - subLibraries = [], - synopsis = "", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV3_0, + package = PackageIdentifier { + pkgName = PackageName + "indentation", + pkgVersion = mkVersion [0]}, + licenseRaw = Left NONE, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [], + synopsis = "", + description = concat + [ + "foo\n", + " indent2\n", + " indent4"], + category = "", + customFieldsPD = [], + buildTypeRaw = Nothing, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Just + Haskell2010, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [], + mixins = []}}, + condTreeConstraints = [], + condTreeComponents = []}, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/indentation3.expr b/Cabal-tests/tests/ParserTests/regressions/indentation3.expr index f7ed51e79fa..af8e5d29a5a 100644 --- a/Cabal-tests/tests/ParserTests/regressions/indentation3.expr +++ b/Cabal-tests/tests/ParserTests/regressions/indentation3.expr @@ -1,104 +1,116 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [], - condTreeConstraints = [], - condTreeData = Library - {exposedModules = [], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Just Haskell2010, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Nothing, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = concat - ["indent0\n", - "\n", - " indent2\n", - "indent0\n", - " indent2"], - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left NONE, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "indentation", - pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [], - specVersion = CabalSpecV3_0, - stability = "", - subLibraries = [], - synopsis = "", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV3_0, + package = PackageIdentifier { + pkgName = PackageName + "indentation", + pkgVersion = mkVersion [0]}, + licenseRaw = Left NONE, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [], + synopsis = "", + description = concat + [ + "indent0\n", + "\n", + " indent2\n", + "indent0\n", + " indent2"], + category = "", + customFieldsPD = [], + buildTypeRaw = Nothing, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Just + Haskell2010, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [], + mixins = []}}, + condTreeConstraints = [], + condTreeComponents = []}, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-5055.expr b/Cabal-tests/tests/ParserTests/regressions/issue-5055.expr index be5e955442b..3a759d45b6b 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-5055.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-5055.expr @@ -34,7 +34,8 @@ GenericPackageDescription { dataDir = ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Nothing, diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-5846.expr b/Cabal-tests/tests/ParserTests/regressions/issue-5846.expr index 996d49e6625..1a5ac6fb863 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-5846.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-5846.expr @@ -32,7 +32,8 @@ GenericPackageDescription { dataDir = ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-6083-a.expr b/Cabal-tests/tests/ParserTests/regressions/issue-6083-a.expr index aa4f6492cd7..416888e597c 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-6083-a.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-6083-a.expr @@ -32,7 +32,8 @@ GenericPackageDescription { dataDir = ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-6083-b.expr b/Cabal-tests/tests/ParserTests/regressions/issue-6083-b.expr index 208e17e41f0..676d5f061f2 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-6083-b.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-6083-b.expr @@ -32,7 +32,8 @@ GenericPackageDescription { dataDir = ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-6083-c.expr b/Cabal-tests/tests/ParserTests/regressions/issue-6083-c.expr index 5cf5a7c1db8..472d6b92115 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-6083-c.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-6083-c.expr @@ -32,7 +32,8 @@ GenericPackageDescription { dataDir = ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just 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 b436742cd03..17580d00e6b 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-6083-pkg-pkg.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-6083-pkg-pkg.expr @@ -32,7 +32,8 @@ GenericPackageDescription { dataDir = ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-774.expr b/Cabal-tests/tests/ParserTests/regressions/issue-774.expr index af63d8cd9f0..6a6858aebf8 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-774.expr +++ b/Cabal-tests/tests/ParserTests/regressions/issue-774.expr @@ -1,111 +1,123 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [], - condTreeConstraints = [], - condTreeData = Library - {exposedModules = [ModuleName "Issue"], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Just Haskell2010, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor - ["-Wall", - "-threaded", - "-with-rtsopts=-N -s -M1G -c", - "-rtsopts"] - [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Just Simple, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = concat - ["Here is some C code:\n", - "\n", - "> for(i = 0; i < 100; i++) {\n", - "> printf(\"%d\\n\",i);\n", - "> }\n", - "\n", - "What does it look like?"], - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left NONE, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "issue", - pkgVersion = mkVersion [744]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [], - specVersion = CabalSpecV1_12, - stability = "", - subLibraries = [], - synopsis = "Package description parser interprets curly braces in the description field", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV1_12, + package = PackageIdentifier { + pkgName = PackageName "issue", + pkgVersion = mkVersion [744]}, + licenseRaw = Left NONE, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [], + synopsis = + "Package description parser interprets curly braces in the description field", + description = concat + [ + "Here is some C code:\n", + "\n", + "> for(i = 0; i < 100; i++) {\n", + "> printf(\"%d\\n\",i);\n", + "> }\n", + "\n", + "What does it look like?"], + category = "", + customFieldsPD = [], + buildTypeRaw = Just Simple, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [ + ModuleName "Issue"], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Just + Haskell2010, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [ + "-Wall", + "-threaded", + "-with-rtsopts=-N -s -M1G -c", + "-rtsopts"] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [], + mixins = []}}, + condTreeConstraints = [], + condTreeComponents = []}, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/jaeger-flamegraph.expr b/Cabal-tests/tests/ParserTests/regressions/jaeger-flamegraph.expr index aac1a2153e6..42ac47530a6 100644 --- a/Cabal-tests/tests/ParserTests/regressions/jaeger-flamegraph.expr +++ b/Cabal-tests/tests/ParserTests/regressions/jaeger-flamegraph.expr @@ -73,7 +73,8 @@ GenericPackageDescription { dataDir = ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just diff --git a/Cabal-tests/tests/ParserTests/regressions/leading-comma-2.expr b/Cabal-tests/tests/ParserTests/regressions/leading-comma-2.expr index 6fc8dafb3e8..7a47eeff2fe 100644 --- a/Cabal-tests/tests/ParserTests/regressions/leading-comma-2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/leading-comma-2.expr @@ -1,170 +1,167 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [], - condTreeConstraints = [Dependency - (PackageName "base") - (OrLaterVersion (mkVersion [0])) - mainLibSet, - Dependency - (PackageName "containers") - (OrLaterVersion (mkVersion [0])) - mainLibSet, - Dependency - (PackageName "deepseq") - (OrLaterVersion (mkVersion [0])) - mainLibSet, - Dependency - (PackageName "transformers") - (OrLaterVersion (mkVersion [0])) - mainLibSet, - Dependency - (PackageName "filepath") - (OrLaterVersion (mkVersion [0])) - mainLibSet, - Dependency - (PackageName "directory") - (OrLaterVersion (mkVersion [0])) - mainLibSet], - condTreeData = Library - {exposedModules = [ModuleName "LeadingComma", - ModuleName "LeadingComma2", - ModuleName "TrailingComma", - ModuleName "TrailingComma", - ModuleName "Comma", - ModuleName "InBetween", - ModuleName "NoCommas", - ModuleName "NoCommas"], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Just Haskell2010, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [Dependency - (PackageName - "base") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet, - Dependency - (PackageName - "containers") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet, - Dependency - (PackageName - "deepseq") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet, - Dependency - (PackageName - "transformers") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet, - Dependency - (PackageName - "filepath") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet, - Dependency - (PackageName - "directory") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Just Simple, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = "", - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left NONE, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "leading-comma", - pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [], - specVersion = CabalSpecV3_0, - stability = "", - subLibraries = [], - synopsis = "leading comma, trailing comma, or ordinary", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV3_0, + package = PackageIdentifier { + pkgName = PackageName + "leading-comma", + pkgVersion = mkVersion [0]}, + licenseRaw = Left NONE, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [], + synopsis = + "leading comma, trailing comma, or ordinary", + description = "", + category = "", + customFieldsPD = [], + buildTypeRaw = Just Simple, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [ + ModuleName "LeadingComma", + ModuleName "LeadingComma2", + ModuleName "TrailingComma", + ModuleName "TrailingComma", + ModuleName "Comma", + ModuleName "InBetween", + ModuleName "NoCommas", + ModuleName "NoCommas"], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Just + Haskell2010, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [ + Dependency + (PackageName "base") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "containers") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "deepseq") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "transformers") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "filepath") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "directory") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + mixins = []}}, + condTreeConstraints = [ + Dependency + (PackageName "base") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "containers") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "deepseq") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "transformers") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "filepath") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "directory") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + condTreeComponents = []}, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/leading-comma.expr b/Cabal-tests/tests/ParserTests/regressions/leading-comma.expr index c813d8b5668..4cd8b18fd6a 100644 --- a/Cabal-tests/tests/ParserTests/regressions/leading-comma.expr +++ b/Cabal-tests/tests/ParserTests/regressions/leading-comma.expr @@ -1,163 +1,160 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [], - condTreeConstraints = [Dependency - (PackageName "base") - (OrLaterVersion (mkVersion [0])) - mainLibSet, - Dependency - (PackageName "containers") - (OrLaterVersion (mkVersion [0])) - mainLibSet, - Dependency - (PackageName "deepseq") - (OrLaterVersion (mkVersion [0])) - mainLibSet, - Dependency - (PackageName "transformers") - (OrLaterVersion (mkVersion [0])) - mainLibSet, - Dependency - (PackageName "filepath") - (OrLaterVersion (mkVersion [0])) - mainLibSet, - Dependency - (PackageName "directory") - (OrLaterVersion (mkVersion [0])) - mainLibSet], - condTreeData = Library - {exposedModules = [ModuleName "LeadingComma"], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Just Haskell2010, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [Dependency - (PackageName - "base") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet, - Dependency - (PackageName - "containers") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet, - Dependency - (PackageName - "deepseq") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet, - Dependency - (PackageName - "transformers") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet, - Dependency - (PackageName - "filepath") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet, - Dependency - (PackageName - "directory") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Just Simple, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = "", - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left NONE, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "leading-comma", - pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [], - specVersion = CabalSpecV2_2, - stability = "", - subLibraries = [], - synopsis = "leading comma, trailing comma, or ordinary", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV2_2, + package = PackageIdentifier { + pkgName = PackageName + "leading-comma", + pkgVersion = mkVersion [0]}, + licenseRaw = Left NONE, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [], + synopsis = + "leading comma, trailing comma, or ordinary", + description = "", + category = "", + customFieldsPD = [], + buildTypeRaw = Just Simple, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [ + ModuleName "LeadingComma"], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Just + Haskell2010, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [ + Dependency + (PackageName "base") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "containers") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "deepseq") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "transformers") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "filepath") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "directory") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + mixins = []}}, + condTreeConstraints = [ + Dependency + (PackageName "base") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "containers") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "deepseq") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "transformers") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "filepath") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "directory") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + condTreeComponents = []}, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/libpq1.expr b/Cabal-tests/tests/ParserTests/regressions/libpq1.expr index 954c378122c..ba0118d44a9 100644 --- a/Cabal-tests/tests/ParserTests/regressions/libpq1.expr +++ b/Cabal-tests/tests/ParserTests/regressions/libpq1.expr @@ -110,7 +110,8 @@ GenericPackageDescription { "cbits/noticehandlers.h", "CHANGELOG.md"], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [ MkPackageFlag { diff --git a/Cabal-tests/tests/ParserTests/regressions/libpq2.expr b/Cabal-tests/tests/ParserTests/regressions/libpq2.expr index 0b1c1ccd528..a03d6eef91b 100644 --- a/Cabal-tests/tests/ParserTests/regressions/libpq2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/libpq2.expr @@ -114,7 +114,8 @@ GenericPackageDescription { "cbits/noticehandlers.h", "CHANGELOG.md"], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [ MkPackageFlag { diff --git a/Cabal-tests/tests/ParserTests/regressions/mixin-1.expr b/Cabal-tests/tests/ParserTests/regressions/mixin-1.expr index 2878577225b..9f7c44ab1cf 100644 --- a/Cabal-tests/tests/ParserTests/regressions/mixin-1.expr +++ b/Cabal-tests/tests/ParserTests/regressions/mixin-1.expr @@ -1,151 +1,161 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [_×_ - (UnqualComponentName "str-example") - CondNode - {condTreeComponents = [], - condTreeConstraints = [Dependency - (PackageName "base") - (OrLaterVersion (mkVersion [0])) - mainLibSet, - Dependency - (PackageName "str-string") - (OrLaterVersion (mkVersion [0])) - mainLibSet, - Dependency - (PackageName "str-bytestring") - (OrLaterVersion (mkVersion [0])) - mainLibSet], - condTreeData = Executable - {buildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Nothing, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [SymbolicPath - "str-example"], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [Mixin - {mixinIncludeRenaming = IncludeRenaming - {includeProvidesRn = ModuleRenaming - [_×_ - (ModuleName - "Str") - (ModuleName - "Str.String")], - includeRequiresRn = DefaultRenaming}, - mixinLibraryName = LMainLibName, - mixinPackageName = PackageName - "str-string"}, - Mixin - {mixinIncludeRenaming = IncludeRenaming - {includeProvidesRn = ModuleRenaming - [_×_ - (ModuleName - "Str") - (ModuleName - "Str.ByteString")], - includeRequiresRn = DefaultRenaming}, - mixinLibraryName = LMainLibName, - mixinPackageName = PackageName - "str-bytestring"}], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [Dependency - (PackageName - "base") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet, - Dependency - (PackageName - "str-string") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet, - Dependency - (PackageName - "str-bytestring") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet], - virtualModules = []}, - exeName = UnqualComponentName "str-example", - exeScope = ExecutablePublic, - modulePath = "Main.hs"}}], - condForeignLibs = [], - condLibrary = Nothing, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Just Simple, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = "", - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left NONE, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "mixin", pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [], - specVersion = CabalSpecV2_0, - stability = "", - subLibraries = [], - synopsis = "", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV2_0, + package = PackageIdentifier { + pkgName = PackageName "mixin", + pkgVersion = mkVersion [0]}, + licenseRaw = Left NONE, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [], + synopsis = "", + description = "", + category = "", + customFieldsPD = [], + buildTypeRaw = Just Simple, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Nothing, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [ + _×_ + (UnqualComponentName + "str-example") + CondNode { + condTreeData = Executable { + exeName = UnqualComponentName + "str-example", + modulePath = "Main.hs", + exeScope = ExecutablePublic, + buildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [ + SymbolicPath "str-example"], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Nothing, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [ + Dependency + (PackageName "base") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "str-string") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "str-bytestring") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + mixins = [ + Mixin { + mixinPackageName = PackageName + "str-string", + mixinLibraryName = LMainLibName, + mixinIncludeRenaming = + IncludeRenaming { + includeProvidesRn = + ModuleRenaming + [ + _×_ + (ModuleName "Str") + (ModuleName "Str.String")], + includeRequiresRn = + DefaultRenaming}}, + Mixin { + mixinPackageName = PackageName + "str-bytestring", + mixinLibraryName = LMainLibName, + mixinIncludeRenaming = + IncludeRenaming { + includeProvidesRn = + ModuleRenaming + [ + _×_ + (ModuleName "Str") + (ModuleName "Str.ByteString")], + includeRequiresRn = + DefaultRenaming}}]}}, + condTreeConstraints = [ + Dependency + (PackageName "base") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "str-string") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "str-bytestring") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + condTreeComponents = []}], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/mixin-2.expr b/Cabal-tests/tests/ParserTests/regressions/mixin-2.expr index b2866d4a5e0..ac53a6edb82 100644 --- a/Cabal-tests/tests/ParserTests/regressions/mixin-2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/mixin-2.expr @@ -1,151 +1,161 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [_×_ - (UnqualComponentName "str-example") - CondNode - {condTreeComponents = [], - condTreeConstraints = [Dependency - (PackageName "base") - (OrLaterVersion (mkVersion [0])) - mainLibSet, - Dependency - (PackageName "str-string") - (OrLaterVersion (mkVersion [0])) - mainLibSet, - Dependency - (PackageName "str-bytestring") - (OrLaterVersion (mkVersion [0])) - mainLibSet], - condTreeData = Executable - {buildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Nothing, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [SymbolicPath - "str-example"], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [Mixin - {mixinIncludeRenaming = IncludeRenaming - {includeProvidesRn = ModuleRenaming - [_×_ - (ModuleName - "Str") - (ModuleName - "Str.String")], - includeRequiresRn = DefaultRenaming}, - mixinLibraryName = LMainLibName, - mixinPackageName = PackageName - "str-string"}, - Mixin - {mixinIncludeRenaming = IncludeRenaming - {includeProvidesRn = ModuleRenaming - [_×_ - (ModuleName - "Str") - (ModuleName - "Str.ByteString")], - includeRequiresRn = DefaultRenaming}, - mixinLibraryName = LMainLibName, - mixinPackageName = PackageName - "str-bytestring"}], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [Dependency - (PackageName - "base") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet, - Dependency - (PackageName - "str-string") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet, - Dependency - (PackageName - "str-bytestring") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet], - virtualModules = []}, - exeName = UnqualComponentName "str-example", - exeScope = ExecutablePublic, - modulePath = "Main.hs"}}], - condForeignLibs = [], - condLibrary = Nothing, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Nothing, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = "", - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left NONE, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "mixin", pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [], - specVersion = CabalSpecV3_0, - stability = "", - subLibraries = [], - synopsis = "", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV3_0, + package = PackageIdentifier { + pkgName = PackageName "mixin", + pkgVersion = mkVersion [0]}, + licenseRaw = Left NONE, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [], + synopsis = "", + description = "", + category = "", + customFieldsPD = [], + buildTypeRaw = Nothing, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Nothing, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [ + _×_ + (UnqualComponentName + "str-example") + CondNode { + condTreeData = Executable { + exeName = UnqualComponentName + "str-example", + modulePath = "Main.hs", + exeScope = ExecutablePublic, + buildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [ + SymbolicPath "str-example"], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Nothing, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [ + Dependency + (PackageName "base") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "str-string") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "str-bytestring") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + mixins = [ + Mixin { + mixinPackageName = PackageName + "str-string", + mixinLibraryName = LMainLibName, + mixinIncludeRenaming = + IncludeRenaming { + includeProvidesRn = + ModuleRenaming + [ + _×_ + (ModuleName "Str") + (ModuleName "Str.String")], + includeRequiresRn = + DefaultRenaming}}, + Mixin { + mixinPackageName = PackageName + "str-bytestring", + mixinLibraryName = LMainLibName, + mixinIncludeRenaming = + IncludeRenaming { + includeProvidesRn = + ModuleRenaming + [ + _×_ + (ModuleName "Str") + (ModuleName "Str.ByteString")], + includeRequiresRn = + DefaultRenaming}}]}}, + condTreeConstraints = [ + Dependency + (PackageName "base") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "str-string") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "str-bytestring") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + condTreeComponents = []}], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/mixin-3.expr b/Cabal-tests/tests/ParserTests/regressions/mixin-3.expr index 1a02247a87a..849a153b617 100644 --- a/Cabal-tests/tests/ParserTests/regressions/mixin-3.expr +++ b/Cabal-tests/tests/ParserTests/regressions/mixin-3.expr @@ -1,136 +1,144 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [_×_ - (UnqualComponentName "str-example") - CondNode - {condTreeComponents = [], - condTreeConstraints = [Dependency - (PackageName "base") - (OrLaterVersion (mkVersion [0])) - mainLibSet, - Dependency - (PackageName "str-string") - (OrLaterVersion (mkVersion [0])) - mainLibSet, - Dependency - (PackageName "str-bytestring") - (OrLaterVersion (mkVersion [0])) - mainLibSet], - condTreeData = Executable - {buildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Nothing, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [SymbolicPath - "str-example"], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [Mixin - {mixinIncludeRenaming = IncludeRenaming - {includeProvidesRn = HidingRenaming - [ModuleName - "Foo"], - includeRequiresRn = DefaultRenaming}, - mixinLibraryName = LMainLibName, - mixinPackageName = PackageName - "str"}], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [Dependency - (PackageName - "base") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet, - Dependency - (PackageName - "str-string") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet, - Dependency - (PackageName - "str-bytestring") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet], - virtualModules = []}, - exeName = UnqualComponentName "str-example", - exeScope = ExecutablePublic, - modulePath = "Main.hs"}}], - condForeignLibs = [], - condLibrary = Nothing, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Nothing, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = "", - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left NONE, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "mixin", pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [], - specVersion = CabalSpecV3_0, - stability = "", - subLibraries = [], - synopsis = "", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV3_0, + package = PackageIdentifier { + pkgName = PackageName "mixin", + pkgVersion = mkVersion [0]}, + licenseRaw = Left NONE, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [], + synopsis = "", + description = "", + category = "", + customFieldsPD = [], + buildTypeRaw = Nothing, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Nothing, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [ + _×_ + (UnqualComponentName + "str-example") + CondNode { + condTreeData = Executable { + exeName = UnqualComponentName + "str-example", + modulePath = "Main.hs", + exeScope = ExecutablePublic, + buildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [ + SymbolicPath "str-example"], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Nothing, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [ + Dependency + (PackageName "base") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "str-string") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "str-bytestring") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + mixins = [ + Mixin { + mixinPackageName = PackageName + "str", + mixinLibraryName = LMainLibName, + mixinIncludeRenaming = + IncludeRenaming { + includeProvidesRn = + HidingRenaming + [ModuleName "Foo"], + includeRequiresRn = + DefaultRenaming}}]}}, + condTreeConstraints = [ + Dependency + (PackageName "base") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "str-string") + (OrLaterVersion (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "str-bytestring") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + condTreeComponents = []}], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/monad-param.expr b/Cabal-tests/tests/ParserTests/regressions/monad-param.expr index 0f94cf3be9d..02990c7735f 100644 --- a/Cabal-tests/tests/ParserTests/regressions/monad-param.expr +++ b/Cabal-tests/tests/ParserTests/regressions/monad-param.expr @@ -42,7 +42,8 @@ GenericPackageDescription { dataDir = ".", extraSrcFiles = [], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just diff --git a/Cabal-tests/tests/ParserTests/regressions/multiple-libs-2.expr b/Cabal-tests/tests/ParserTests/regressions/multiple-libs-2.expr index 2af5d422e3b..3799d61cbae 100644 --- a/Cabal-tests/tests/ParserTests/regressions/multiple-libs-2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/multiple-libs-2.expr @@ -1,178 +1,197 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [], - condTreeConstraints = [Dependency - (PackageName "base") - (OrLaterVersion (mkVersion [0])) - mainLibSet], - condTreeData = Library - {exposedModules = [ModuleName "ElseIf"], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Just Haskell2010, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [Dependency - (PackageName - "base") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [_×_ - (UnqualComponentName "public") - CondNode - {condTreeComponents = [], - condTreeConstraints = [Dependency - (PackageName "base") - (OrLaterVersion (mkVersion [0])) - mainLibSet], - condTreeData = Library - {exposedModules = [ModuleName "ElseIf2"], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Just Haskell2010, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor - [] [], - sharedOptions = PerCompilerFlavor - [] [], - staticOptions = PerCompilerFlavor - [] [], - targetBuildDepends = [Dependency - (PackageName - "base") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet], - virtualModules = []}, - libExposed = True, - libName = LSubLibName (UnqualComponentName "public"), - libVisibility = LibraryVisibilityPrivate, - reexportedModules = [], - signatures = []}}], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Just Simple, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = "", - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left NONE, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "multiple-libs", - pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [], - specVersion = CabalSpecV2_0, - stability = "", - subLibraries = [], - synopsis = "visible flag only since 3.0", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV2_0, + package = PackageIdentifier { + pkgName = PackageName + "multiple-libs", + pkgVersion = mkVersion [0]}, + licenseRaw = Left NONE, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [], + synopsis = + "visible flag only since 3.0", + description = "", + category = "", + customFieldsPD = [], + buildTypeRaw = Just Simple, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [ + ModuleName "ElseIf"], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Just + Haskell2010, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [ + Dependency + (PackageName "base") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + mixins = []}}, + condTreeConstraints = [ + Dependency + (PackageName "base") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + condTreeComponents = []}, + condSubLibraries = [ + _×_ + (UnqualComponentName "public") + CondNode { + condTreeData = Library { + libName = LSubLibName + (UnqualComponentName "public"), + exposedModules = [ + ModuleName "ElseIf2"], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPrivate, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Just + Haskell2010, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [ + Dependency + (PackageName "base") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + mixins = []}}, + condTreeConstraints = [ + Dependency + (PackageName "base") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + condTreeComponents = []}], + condForeignLibs = [], + condExecutables = [], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/noVersion.expr b/Cabal-tests/tests/ParserTests/regressions/noVersion.expr index e96ca1efb35..a3a6c569689 100644 --- a/Cabal-tests/tests/ParserTests/regressions/noVersion.expr +++ b/Cabal-tests/tests/ParserTests/regressions/noVersion.expr @@ -1,108 +1,120 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [], - condTreeConstraints = [Dependency - (PackageName "bad-package") - (EarlierVersion (mkVersion [0])) - mainLibSet], - condTreeData = Library - {exposedModules = [ModuleName "ElseIf"], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Just Haskell2010, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [Dependency - (PackageName - "bad-package") - (EarlierVersion - (mkVersion - [0])) - mainLibSet], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Just Simple, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = "", - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left NONE, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "noVersion", - pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [], - specVersion = CabalSpecV1_22, - stability = "", - subLibraries = [], - synopsis = "-none in build-depends", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV1_22, + package = PackageIdentifier { + pkgName = PackageName + "noVersion", + pkgVersion = mkVersion [0]}, + licenseRaw = Left NONE, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [], + synopsis = + "-none in build-depends", + description = "", + category = "", + customFieldsPD = [], + buildTypeRaw = Just Simple, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [ + ModuleName "ElseIf"], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Just + Haskell2010, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [ + Dependency + (PackageName "bad-package") + (EarlierVersion (mkVersion [0])) + mainLibSet], + mixins = []}}, + condTreeConstraints = [ + Dependency + (PackageName "bad-package") + (EarlierVersion (mkVersion [0])) + mainLibSet], + condTreeComponents = []}, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/nothing-unicode.expr b/Cabal-tests/tests/ParserTests/regressions/nothing-unicode.expr index 650054bcf00..3fba6ef6e2d 100644 --- a/Cabal-tests/tests/ParserTests/regressions/nothing-unicode.expr +++ b/Cabal-tests/tests/ParserTests/regressions/nothing-unicode.expr @@ -1,176 +1,195 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [CondBranch - {condBranchCondition = `CNot (Var (PackageFlag (FlagName "\\28961")))`, - condBranchIfFalse = Nothing, - condBranchIfTrue = CondNode - {condTreeComponents = [], - condTreeConstraints = [], - condTreeData = Library - {exposedModules = [], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = False, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Nothing, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor - [] - [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor - [] - [], - sharedOptions = PerCompilerFlavor - [] - [], - staticOptions = PerCompilerFlavor - [] - [], - targetBuildDepends = [], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}}], - condTreeConstraints = [], - condTreeData = Library - {exposedModules = [ModuleName "\937"], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Just Haskell2010, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [MkPackageFlag - {flagDefault = True, - flagDescription = "\28961", - flagManual = False, - flagName = FlagName "\28961"}], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Just Simple, - category = "", - copyright = "", - customFieldsPD = [_×_ "x-\28961" "\28961"], - dataDir = ".", - dataFiles = [], - description = "", - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left NONE, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "\28961", pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [SourceRepo - {repoBranch = Nothing, - repoKind = RepoHead, - repoLocation = Just "https://github.com/hvr/-.git", - repoModule = Nothing, - repoSubdir = Nothing, - repoTag = Nothing, - repoType = Just (KnownRepoType Git)}], - specVersion = CabalSpecV1_10, - stability = "", - subLibraries = [], - synopsis = "The canonical non-package \28961", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV1_10, + package = PackageIdentifier { + pkgName = PackageName "\28961", + pkgVersion = mkVersion [0]}, + licenseRaw = Left NONE, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [ + SourceRepo { + repoKind = RepoHead, + repoType = Just + (KnownRepoType Git), + repoLocation = Just + "https://github.com/hvr/-.git", + repoModule = Nothing, + repoBranch = Nothing, + repoTag = Nothing, + repoSubdir = Nothing}], + synopsis = + "The canonical non-package \28961", + description = "", + category = "", + customFieldsPD = [ + _×_ "x-\28961" "\28961"], + buildTypeRaw = Just Simple, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [ + MkPackageFlag { + flagName = FlagName "\28961", + flagDescription = "\28961", + flagDefault = True, + flagManual = False}], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [ + ModuleName "\937"], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Just + Haskell2010, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [], + mixins = []}}, + condTreeConstraints = [], + condTreeComponents = [ + CondBranch { + condBranchCondition = + `CNot (Var (PackageFlag (FlagName "\\28961")))`, + condBranchIfTrue = CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = False, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Nothing, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [], + mixins = []}}, + condTreeConstraints = [], + condTreeComponents = []}, + condBranchIfFalse = Nothing}]}, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/shake.expr b/Cabal-tests/tests/ParserTests/regressions/shake.expr index 30e0f9077c1..01bb11f2122 100644 --- a/Cabal-tests/tests/ParserTests/regressions/shake.expr +++ b/Cabal-tests/tests/ParserTests/regressions/shake.expr @@ -123,7 +123,8 @@ GenericPackageDescription { extraTmpFiles = [], extraDocFiles = [ "CHANGES.txt", - "README.md"]}, + "README.md"], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [ MkPackageFlag { diff --git a/Cabal-tests/tests/ParserTests/regressions/spdx-1.expr b/Cabal-tests/tests/ParserTests/regressions/spdx-1.expr index 29b85215c1a..427afefd362 100644 --- a/Cabal-tests/tests/ParserTests/regressions/spdx-1.expr +++ b/Cabal-tests/tests/ParserTests/regressions/spdx-1.expr @@ -1,98 +1,110 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [], - condTreeConstraints = [], - condTreeData = Library - {exposedModules = [], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Just Haskell2010, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Just Simple, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = "", - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Right BSD3, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "spdx", pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [], - specVersion = CabalSpecV2_0, - stability = "", - subLibraries = [], - synopsis = "testing positive parsing of spdx identifiers", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV2_0, + package = PackageIdentifier { + pkgName = PackageName "spdx", + pkgVersion = mkVersion [0]}, + licenseRaw = Right BSD3, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [], + synopsis = + "testing positive parsing of spdx identifiers", + description = "", + category = "", + customFieldsPD = [], + buildTypeRaw = Just Simple, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Just + Haskell2010, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [], + mixins = []}}, + condTreeConstraints = [], + condTreeComponents = []}, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/spdx-2.expr b/Cabal-tests/tests/ParserTests/regressions/spdx-2.expr index 427f0eb21ca..64d90bc5e46 100644 --- a/Cabal-tests/tests/ParserTests/regressions/spdx-2.expr +++ b/Cabal-tests/tests/ParserTests/regressions/spdx-2.expr @@ -1,99 +1,114 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [], - condTreeConstraints = [], - condTreeData = Library - {exposedModules = [], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Just Haskell2010, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Just Simple, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = "", - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left - (License (ELicense (ELicenseId AGPL_1_0) Nothing)), - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "spdx", pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [], - specVersion = CabalSpecV2_2, - stability = "", - subLibraries = [], - synopsis = "testing positive parsing of spdx identifiers", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV2_2, + package = PackageIdentifier { + pkgName = PackageName "spdx", + pkgVersion = mkVersion [0]}, + licenseRaw = Left + (License + (ELicense + (ELicenseId AGPL_1_0) + Nothing)), + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [], + synopsis = + "testing positive parsing of spdx identifiers", + description = "", + category = "", + customFieldsPD = [], + buildTypeRaw = Just Simple, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Just + Haskell2010, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [], + mixins = []}}, + condTreeConstraints = [], + condTreeComponents = []}, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/spdx-3.expr b/Cabal-tests/tests/ParserTests/regressions/spdx-3.expr index b7b57e34bf1..1a99b34a807 100644 --- a/Cabal-tests/tests/ParserTests/regressions/spdx-3.expr +++ b/Cabal-tests/tests/ParserTests/regressions/spdx-3.expr @@ -1,99 +1,114 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [], - condTreeConstraints = [], - condTreeData = Library - {exposedModules = [], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Just Haskell2010, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Just Simple, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = "", - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left - (License (ELicense (ELicenseId AGPL_1_0_only) Nothing)), - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "spdx", pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [], - specVersion = CabalSpecV2_4, - stability = "", - subLibraries = [], - synopsis = "testing positive parsing of spdx identifiers", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV2_4, + package = PackageIdentifier { + pkgName = PackageName "spdx", + pkgVersion = mkVersion [0]}, + licenseRaw = Left + (License + (ELicense + (ELicenseId AGPL_1_0_only) + Nothing)), + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [], + synopsis = + "testing positive parsing of spdx identifiers", + description = "", + category = "", + customFieldsPD = [], + buildTypeRaw = Just Simple, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Just + Haskell2010, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [], + mixins = []}}, + condTreeConstraints = [], + condTreeComponents = []}, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/th-lift-instances.expr b/Cabal-tests/tests/ParserTests/regressions/th-lift-instances.expr index f714c7a0fe4..3c82a57aa99 100644 --- a/Cabal-tests/tests/ParserTests/regressions/th-lift-instances.expr +++ b/Cabal-tests/tests/ParserTests/regressions/th-lift-instances.expr @@ -61,7 +61,8 @@ GenericPackageDescription { ".vim.custom", "README.md"], extraTmpFiles = [], - extraDocFiles = []}, + extraDocFiles = [], + packageConstraints = []}, gpdScannedVersion = Nothing, genPackageFlags = [], condLibrary = Just diff --git a/Cabal-tests/tests/ParserTests/regressions/version-sets.expr b/Cabal-tests/tests/ParserTests/regressions/version-sets.expr index f3c993b7b7b..5c3e4656a92 100644 --- a/Cabal-tests/tests/ParserTests/regressions/version-sets.expr +++ b/Cabal-tests/tests/ParserTests/regressions/version-sets.expr @@ -1,286 +1,264 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [], - condTreeConstraints = [Dependency - (PackageName "network") - (MajorBoundVersion (mkVersion [0])) - mainLibSet, - Dependency - (PackageName "base") - (ThisVersion (mkVersion [1])) - mainLibSet, - Dependency - (PackageName "base") - (ThisVersion (mkVersion [1])) - mainLibSet, - Dependency - (PackageName "base") - (UnionVersionRanges - (ThisVersion (mkVersion [1])) - (ThisVersion (mkVersion [2]))) - mainLibSet, - Dependency - (PackageName "base") - (ThisVersion (mkVersion [1, 2])) - mainLibSet, - Dependency - (PackageName "base") - (UnionVersionRanges - (ThisVersion (mkVersion [1, 2])) - (ThisVersion (mkVersion [3, 4]))) - mainLibSet, - Dependency - (PackageName "ghc") - (UnionVersionRanges - (ThisVersion (mkVersion [8, 6, 3])) - (UnionVersionRanges - (ThisVersion (mkVersion [8, 4, 4])) - (UnionVersionRanges - (ThisVersion (mkVersion [8, 2, 2])) - (UnionVersionRanges - (ThisVersion (mkVersion [8, 0, 2])) - (UnionVersionRanges - (ThisVersion (mkVersion [7, 10, 3])) - (UnionVersionRanges - (ThisVersion (mkVersion [7, 8, 4])) - (UnionVersionRanges - (ThisVersion - (mkVersion [7, 6, 3])) - (ThisVersion - (mkVersion [7, 4, 2]))))))))) - mainLibSet, - Dependency - (PackageName "Cabal") - (UnionVersionRanges - (MajorBoundVersion (mkVersion [2, 4, 1, 1])) - (MajorBoundVersion (mkVersion [2, 2, 0, 0]))) - mainLibSet], - condTreeData = Library - {exposedModules = [], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Just Haskell2010, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [Dependency - (PackageName - "network") - (MajorBoundVersion - (mkVersion - [0])) - mainLibSet, - Dependency - (PackageName - "base") - (ThisVersion - (mkVersion - [1])) - mainLibSet, - Dependency - (PackageName - "base") - (ThisVersion - (mkVersion - [1])) - mainLibSet, - Dependency - (PackageName - "base") - (UnionVersionRanges - (ThisVersion - (mkVersion - [1])) - (ThisVersion - (mkVersion - [2]))) - mainLibSet, - Dependency - (PackageName - "base") - (ThisVersion - (mkVersion - [1, 2])) - mainLibSet, - Dependency - (PackageName - "base") - (UnionVersionRanges - (ThisVersion - (mkVersion - [1, 2])) - (ThisVersion - (mkVersion - [3, 4]))) - mainLibSet, - Dependency - (PackageName - "ghc") - (UnionVersionRanges - (ThisVersion - (mkVersion - [8, - 6, - 3])) - (UnionVersionRanges - (ThisVersion - (mkVersion - [8, - 4, - 4])) - (UnionVersionRanges - (ThisVersion - (mkVersion - [8, - 2, - 2])) - (UnionVersionRanges - (ThisVersion - (mkVersion - [8, - 0, - 2])) - (UnionVersionRanges - (ThisVersion - (mkVersion - [7, - 10, - 3])) - (UnionVersionRanges - (ThisVersion - (mkVersion - [7, - 8, - 4])) - (UnionVersionRanges - (ThisVersion - (mkVersion - [7, - 6, - 3])) - (ThisVersion - (mkVersion - [7, - 4, - 2]))))))))) - mainLibSet, - Dependency - (PackageName - "Cabal") - (UnionVersionRanges - (MajorBoundVersion - (mkVersion - [2, - 4, - 1, - 1])) - (MajorBoundVersion - (mkVersion - [2, - 2, - 0, - 0]))) - mainLibSet], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "", - benchmarks = [], - bugReports = "", - buildTypeRaw = Nothing, - category = "", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = "", - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [], - licenseRaw = Left NONE, - maintainer = "", - package = PackageIdentifier - {pkgName = PackageName "version-sets", - pkgVersion = mkVersion [0]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [], - specVersion = CabalSpecV3_0, - stability = "", - subLibraries = [], - synopsis = "version set notation", - testSuites = [], - testedWith = [_×_ - GHC - (UnionVersionRanges - (ThisVersion (mkVersion [8, 6, 3])) - (UnionVersionRanges - (ThisVersion (mkVersion [8, 4, 4])) - (UnionVersionRanges - (ThisVersion (mkVersion [8, 2, 2])) - (UnionVersionRanges - (ThisVersion (mkVersion [8, 0, 2])) - (UnionVersionRanges - (ThisVersion (mkVersion [7, 10, 3])) - (UnionVersionRanges - (ThisVersion (mkVersion [7, 8, 4])) - (UnionVersionRanges - (ThisVersion (mkVersion [7, 6, 3])) - (ThisVersion - (mkVersion [7, 4, 2])))))))))]}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV3_0, + package = PackageIdentifier { + pkgName = PackageName + "version-sets", + pkgVersion = mkVersion [0]}, + licenseRaw = Left NONE, + licenseFiles = [], + copyright = "", + maintainer = "", + author = "", + stability = "", + testedWith = [ + _×_ + GHC + (UnionVersionRanges + (ThisVersion + (mkVersion [8, 6, 3])) + (UnionVersionRanges + (ThisVersion + (mkVersion [8, 4, 4])) + (UnionVersionRanges + (ThisVersion + (mkVersion [8, 2, 2])) + (UnionVersionRanges + (ThisVersion + (mkVersion [8, 0, 2])) + (UnionVersionRanges + (ThisVersion + (mkVersion [7, 10, 3])) + (UnionVersionRanges + (ThisVersion + (mkVersion [7, 8, 4])) + (UnionVersionRanges + (ThisVersion + (mkVersion [7, 6, 3])) + (ThisVersion + (mkVersion [7, 4, 2])))))))))], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [], + synopsis = + "version set notation", + description = "", + category = "", + customFieldsPD = [], + buildTypeRaw = Nothing, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Just + Haskell2010, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [ + Dependency + (PackageName "network") + (MajorBoundVersion + (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "base") + (ThisVersion (mkVersion [1])) + mainLibSet, + Dependency + (PackageName "base") + (ThisVersion (mkVersion [1])) + mainLibSet, + Dependency + (PackageName "base") + (UnionVersionRanges + (ThisVersion (mkVersion [1])) + (ThisVersion (mkVersion [2]))) + mainLibSet, + Dependency + (PackageName "base") + (ThisVersion (mkVersion [1, 2])) + mainLibSet, + Dependency + (PackageName "base") + (UnionVersionRanges + (ThisVersion (mkVersion [1, 2])) + (ThisVersion + (mkVersion [3, 4]))) + mainLibSet, + Dependency + (PackageName "ghc") + (UnionVersionRanges + (ThisVersion + (mkVersion [8, 6, 3])) + (UnionVersionRanges + (ThisVersion + (mkVersion [8, 4, 4])) + (UnionVersionRanges + (ThisVersion + (mkVersion [8, 2, 2])) + (UnionVersionRanges + (ThisVersion + (mkVersion [8, 0, 2])) + (UnionVersionRanges + (ThisVersion + (mkVersion [7, 10, 3])) + (UnionVersionRanges + (ThisVersion + (mkVersion [7, 8, 4])) + (UnionVersionRanges + (ThisVersion + (mkVersion [7, 6, 3])) + (ThisVersion + (mkVersion [7, 4, 2]))))))))) + mainLibSet, + Dependency + (PackageName "Cabal") + (UnionVersionRanges + (MajorBoundVersion + (mkVersion [2, 4, 1, 1])) + (MajorBoundVersion + (mkVersion [2, 2, 0, 0]))) + mainLibSet], + mixins = []}}, + condTreeConstraints = [ + Dependency + (PackageName "network") + (MajorBoundVersion + (mkVersion [0])) + mainLibSet, + Dependency + (PackageName "base") + (ThisVersion (mkVersion [1])) + mainLibSet, + Dependency + (PackageName "base") + (ThisVersion (mkVersion [1])) + mainLibSet, + Dependency + (PackageName "base") + (UnionVersionRanges + (ThisVersion (mkVersion [1])) + (ThisVersion (mkVersion [2]))) + mainLibSet, + Dependency + (PackageName "base") + (ThisVersion (mkVersion [1, 2])) + mainLibSet, + Dependency + (PackageName "base") + (UnionVersionRanges + (ThisVersion (mkVersion [1, 2])) + (ThisVersion + (mkVersion [3, 4]))) + mainLibSet, + Dependency + (PackageName "ghc") + (UnionVersionRanges + (ThisVersion + (mkVersion [8, 6, 3])) + (UnionVersionRanges + (ThisVersion + (mkVersion [8, 4, 4])) + (UnionVersionRanges + (ThisVersion + (mkVersion [8, 2, 2])) + (UnionVersionRanges + (ThisVersion + (mkVersion [8, 0, 2])) + (UnionVersionRanges + (ThisVersion + (mkVersion [7, 10, 3])) + (UnionVersionRanges + (ThisVersion + (mkVersion [7, 8, 4])) + (UnionVersionRanges + (ThisVersion + (mkVersion [7, 6, 3])) + (ThisVersion + (mkVersion [7, 4, 2]))))))))) + mainLibSet, + Dependency + (PackageName "Cabal") + (UnionVersionRanges + (MajorBoundVersion + (mkVersion [2, 4, 1, 1])) + (MajorBoundVersion + (mkVersion [2, 2, 0, 0]))) + mainLibSet], + condTreeComponents = []}, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [], + condTestSuites = [], + condBenchmarks = []} diff --git a/Cabal-tests/tests/ParserTests/regressions/wl-pprint-indef.expr b/Cabal-tests/tests/ParserTests/regressions/wl-pprint-indef.expr index edbbeed7483..3b52f7d6342 100644 --- a/Cabal-tests/tests/ParserTests/regressions/wl-pprint-indef.expr +++ b/Cabal-tests/tests/ParserTests/regressions/wl-pprint-indef.expr @@ -1,225 +1,239 @@ -GenericPackageDescription - {condBenchmarks = [], - condExecutables = [_×_ - (UnqualComponentName "wl-pprint-string-example") - CondNode - {condTreeComponents = [], - condTreeConstraints = [Dependency - (PackageName "base") - (EarlierVersion (mkVersion [5])) - mainLibSet, - Dependency - (PackageName "str-string") - (OrLaterVersion (mkVersion [0, 1, 0, 0])) - mainLibSet, - Dependency - (PackageName "wl-pprint-indef") - (OrLaterVersion (mkVersion [0])) - mainLibSet], - condTreeData = Executable - {buildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Nothing, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [SymbolicPath - "example-string"], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [ModuleName - "StringImpl"], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [Dependency - (PackageName - "base") - (EarlierVersion - (mkVersion - [5])) - mainLibSet, - Dependency - (PackageName - "str-string") - (OrLaterVersion - (mkVersion - [0, - 1, - 0, - 0])) - mainLibSet, - Dependency - (PackageName - "wl-pprint-indef") - (OrLaterVersion - (mkVersion - [0])) - mainLibSet], - virtualModules = []}, - exeName = UnqualComponentName - "wl-pprint-string-example", - exeScope = ExecutablePublic, - modulePath = "Main.hs"}}], - condForeignLibs = [], - condLibrary = Just - CondNode - {condTreeComponents = [], - condTreeConstraints = [Dependency - (PackageName "base") - (EarlierVersion (mkVersion [5])) - mainLibSet, - Dependency - (PackageName "str-sig") - (OrLaterVersion (mkVersion [0, 1, 0, 0])) - mainLibSet], - condTreeData = Library - {exposedModules = [ModuleName "Text.PrettyPrint.Leijen"], - libBuildInfo = BuildInfo - {asmOptions = [], - asmSources = [], - autogenIncludes = [], - autogenModules = [], - buildToolDepends = [], - buildTools = [], - buildable = True, - cSources = [], - ccOptions = [], - cmmOptions = [], - cmmSources = [], - cppOptions = [], - customFieldsBI = [], - cxxOptions = [], - cxxSources = [], - defaultExtensions = [], - defaultLanguage = Nothing, - extraBundledLibs = [], - extraDynLibFlavours = [], - extraFrameworkDirs = [], - extraGHCiLibs = [], - extraLibDirs = [], - extraLibDirsStatic = [], - extraLibFlavours = [], - extraLibs = [], - extraLibsStatic = [], - frameworks = [], - hsSourceDirs = [], - hsc2hsOptions = [], - includeDirs = [], - includes = [], - installIncludes = [], - jsSources = [], - ldOptions = [], - mixins = [], - oldExtensions = [], - options = PerCompilerFlavor [] [], - otherExtensions = [], - otherLanguages = [], - otherModules = [], - pkgconfigDepends = [], - profOptions = PerCompilerFlavor [] [], - sharedOptions = PerCompilerFlavor [] [], - staticOptions = PerCompilerFlavor [] [], - targetBuildDepends = [Dependency - (PackageName - "base") - (EarlierVersion - (mkVersion - [5])) - mainLibSet, - Dependency - (PackageName - "str-sig") - (OrLaterVersion - (mkVersion - [0, - 1, - 0, - 0])) - mainLibSet], - virtualModules = []}, - libExposed = True, - libName = LMainLibName, - libVisibility = LibraryVisibilityPublic, - reexportedModules = [], - signatures = []}}, - condSubLibraries = [], - condTestSuites = [], - genPackageFlags = [], - gpdScannedVersion = Nothing, - packageDescription = PackageDescription - {author = "Daan Leijen", - benchmarks = [], - bugReports = "", - buildTypeRaw = Just Simple, - category = "Text", - copyright = "", - customFieldsPD = [], - dataDir = ".", - dataFiles = [], - description = concat - ["This is a pretty printing library based on Wadler's paper \"A Prettier\n", - "Printer\". See the haddocks for full info. This version allows the\n", - "library user to declare overlapping instances of the 'Pretty' class."], - executables = [], - extraDocFiles = [], - extraSrcFiles = [], - extraTmpFiles = [], - foreignLibs = [], - homepage = "", - library = Nothing, - licenseFiles = [SymbolicPath "LICENSE"], - licenseRaw = Right BSD3, - maintainer = "Noam Lewis ", - package = PackageIdentifier - {pkgName = PackageName "wl-pprint-indef", - pkgVersion = mkVersion [1, 2]}, - pkgUrl = "", - setupBuildInfo = Nothing, - sourceRepos = [SourceRepo - {repoBranch = Nothing, - repoKind = RepoHead, - repoLocation = Just - "git@github.com:danidiaz/wl-pprint-indef.git", - repoModule = Nothing, - repoSubdir = Nothing, - repoTag = Nothing, - repoType = Just (KnownRepoType Git)}], - specVersion = CabalSpecV1_6, - stability = "", - subLibraries = [], - synopsis = "The Wadler/Leijen Pretty Printer", - testSuites = [], - testedWith = []}} +GenericPackageDescription { + packageDescription = + PackageDescription { + specVersion = CabalSpecV1_6, + package = PackageIdentifier { + pkgName = PackageName + "wl-pprint-indef", + pkgVersion = mkVersion [1, 2]}, + licenseRaw = Right BSD3, + licenseFiles = [ + SymbolicPath "LICENSE"], + copyright = "", + maintainer = + "Noam Lewis ", + author = "Daan Leijen", + stability = "", + testedWith = [], + homepage = "", + pkgUrl = "", + bugReports = "", + sourceRepos = [ + SourceRepo { + repoKind = RepoHead, + repoType = Just + (KnownRepoType Git), + repoLocation = Just + "git@github.com:danidiaz/wl-pprint-indef.git", + repoModule = Nothing, + repoBranch = Nothing, + repoTag = Nothing, + repoSubdir = Nothing}], + synopsis = + "The Wadler/Leijen Pretty Printer", + description = + concat + [ + "This is a pretty printing library based on Wadler's paper \"A Prettier\n", + "Printer\". See the haddocks for full info. This version allows the\n", + "library user to declare overlapping instances of the 'Pretty' class."], + category = "Text", + customFieldsPD = [], + buildTypeRaw = Just Simple, + setupBuildInfo = Nothing, + library = Nothing, + subLibraries = [], + executables = [], + foreignLibs = [], + testSuites = [], + benchmarks = [], + dataFiles = [], + dataDir = ".", + extraSrcFiles = [], + extraTmpFiles = [], + extraDocFiles = [], + packageConstraints = []}, + gpdScannedVersion = Nothing, + genPackageFlags = [], + condLibrary = Just + CondNode { + condTreeData = Library { + libName = LMainLibName, + exposedModules = [ + ModuleName + "Text.PrettyPrint.Leijen"], + reexportedModules = [], + signatures = [], + libExposed = True, + libVisibility = + LibraryVisibilityPublic, + libBuildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [], + otherModules = [], + virtualModules = [], + autogenModules = [], + defaultLanguage = Nothing, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [ + Dependency + (PackageName "base") + (EarlierVersion (mkVersion [5])) + mainLibSet, + Dependency + (PackageName "str-sig") + (OrLaterVersion + (mkVersion [0, 1, 0, 0])) + mainLibSet], + mixins = []}}, + condTreeConstraints = [ + Dependency + (PackageName "base") + (EarlierVersion (mkVersion [5])) + mainLibSet, + Dependency + (PackageName "str-sig") + (OrLaterVersion + (mkVersion [0, 1, 0, 0])) + mainLibSet], + condTreeComponents = []}, + condSubLibraries = [], + condForeignLibs = [], + condExecutables = [ + _×_ + (UnqualComponentName + "wl-pprint-string-example") + CondNode { + condTreeData = Executable { + exeName = UnqualComponentName + "wl-pprint-string-example", + modulePath = "Main.hs", + exeScope = ExecutablePublic, + buildInfo = BuildInfo { + buildable = True, + buildTools = [], + buildToolDepends = [], + cppOptions = [], + asmOptions = [], + cmmOptions = [], + ccOptions = [], + cxxOptions = [], + ldOptions = [], + hsc2hsOptions = [], + pkgconfigDepends = [], + frameworks = [], + extraFrameworkDirs = [], + asmSources = [], + cmmSources = [], + cSources = [], + cxxSources = [], + jsSources = [], + hsSourceDirs = [ + SymbolicPath "example-string"], + otherModules = [ + ModuleName "StringImpl"], + virtualModules = [], + autogenModules = [], + defaultLanguage = Nothing, + otherLanguages = [], + defaultExtensions = [], + otherExtensions = [], + oldExtensions = [], + extraLibs = [], + extraLibsStatic = [], + extraGHCiLibs = [], + extraBundledLibs = [], + extraLibFlavours = [], + extraDynLibFlavours = [], + extraLibDirs = [], + extraLibDirsStatic = [], + includeDirs = [], + includes = [], + autogenIncludes = [], + installIncludes = [], + options = PerCompilerFlavor + [] + [], + profOptions = PerCompilerFlavor + [] + [], + sharedOptions = + PerCompilerFlavor [] [], + staticOptions = + PerCompilerFlavor [] [], + customFieldsBI = [], + targetBuildDepends = [ + Dependency + (PackageName "base") + (EarlierVersion (mkVersion [5])) + mainLibSet, + Dependency + (PackageName "str-string") + (OrLaterVersion + (mkVersion [0, 1, 0, 0])) + mainLibSet, + Dependency + (PackageName "wl-pprint-indef") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + mixins = []}}, + condTreeConstraints = [ + Dependency + (PackageName "base") + (EarlierVersion (mkVersion [5])) + mainLibSet, + Dependency + (PackageName "str-string") + (OrLaterVersion + (mkVersion [0, 1, 0, 0])) + mainLibSet, + Dependency + (PackageName "wl-pprint-indef") + (OrLaterVersion (mkVersion [0])) + mainLibSet], + condTreeComponents = []}], + condTestSuites = [], + condBenchmarks = []} From d0338a8c6db7f53c3377c87c5313c1e3529ad6d3 Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Tue, 21 Nov 2023 15:05:32 +0100 Subject: [PATCH 7/7] Document package-constraints --- changelog.d/package-constraints | 12 ++++++ doc/cabal-package-description-file.rst | 58 ++++++++++++++++++++++---- doc/file-format-changelog.rst | 7 ++++ 3 files changed, 69 insertions(+), 8 deletions(-) create mode 100644 changelog.d/package-constraints diff --git a/changelog.d/package-constraints b/changelog.d/package-constraints new file mode 100644 index 00000000000..a92bc99c571 --- /dev/null +++ b/changelog.d/package-constraints @@ -0,0 +1,12 @@ +synopsis: Implement `package-constraints` field +packages: Cabal-syntax +prs: #9462 + +description: { + +The new `package-constraints` stanza can be used to default versions that are +ommitted in the build-depends fields. This could be done previously by means of +common stanzas but it was too verbose and obscure (dependencies came sometimes +from stanzas). + +} diff --git a/doc/cabal-package-description-file.rst b/doc/cabal-package-description-file.rst index ae07f3ff3bc..ef117473e48 100644 --- a/doc/cabal-package-description-file.rst +++ b/doc/cabal-package-description-file.rst @@ -795,6 +795,49 @@ describe the package as a whole: additional hooks, such as the scheme described in the section on `system-dependent parameters`_. +.. pkg-field:: package-constraints: library list + :since: 3.11 + + Starting with **Cabal 3.11**, a new section ``package-constraints`` + can be declared on the package description which will provide + version bounds that will be monoidally combined with those in + `build-depends` sections. + + So the package description: + + :: + + package-constraints: + , x ^>= 5 + + library a + build-depends: x + + library b + build-depends: x >5.5 + + library c + build-depends: y + + will be parsed as: + + :: + + library a + build-depends: x ^>=5 + + library b + build-depends: x >5.5 && ^>= 5 + + library c + build-depends: y + + This process is only applied as a syntactic desugar, only to avoid + duplication and verbosity on the cabal file. It will not apply version bounds + on transitive dependencies that are not explicitly listed as a dependency. It + will not be applied to ``build-tool-depends`` or ``pkgconfig-depends`` + entries. + Library ^^^^^^^ @@ -1480,13 +1523,13 @@ system-dependent values for these fields. Version constraints use the operators ``==, >=, >, <, <=`` and a version number. Multiple constraints can be combined using ``&&`` or ``||``. - + .. Note:: Even though there is no ``/=`` operator, by combining operators we can skip over one or more versions, to skip a deprecated version or to skip versions that narrow the constraint solving more than we'd like. - + For example, the ``time =1.12.*`` series depends on ``base >=4.13 && <5`` but ``time-1.12.3`` bumps the lower bound on base to ``>=4.14``. If we still want to compile with a ``ghc-8.8.*`` version of GHC that ships with @@ -1515,12 +1558,12 @@ system-dependent values for these fields. common because it is recommended practice for package versions to correspond to API versions (see PVP_). - Since Cabal 1.6, there is a special wildcard syntax to help with + Since **Cabal 1.6**, there is a special wildcard syntax to help with such ranges :: - build-depends: foo ==1.2.* + build-depends: foo ==1.2.*** It is only syntactic sugar. It is exactly equivalent to ``foo >= 1.2 && < 1.3``. @@ -1533,7 +1576,7 @@ system-dependent values for these fields. than ``1.0``. This is not an issue with the caret-operator ``^>=`` described below. - Starting with Cabal 2.0, there's a new version operator to express + Starting with **Cabal 2.0**, there's a new version operator to express PVP_-style major upper bounds conveniently, and is inspired by similar syntactic sugar found in other language ecosystems where it's often called the "Caret" operator: @@ -1624,8 +1667,8 @@ system-dependent values for these fields. renaming in ``build-depends``; however, this support has since been removed and should not be used. - Starting with Cabal 3.0, a set notation for the ``==`` and ``^>=`` operator - is available. For instance, + Starting with **Cabal 3.0**, a set notation for the ``==`` and ``^>=`` + operator is available. For instance, :: @@ -1642,7 +1685,6 @@ system-dependent values for these fields. build-depends: network ^>= { 2.6.3.6, 2.7.0.2, 2.8.0.0, 3.0.1.0 } - .. pkg-field:: other-modules: identifier list A list of modules used by the component but not exposed to users. diff --git a/doc/file-format-changelog.rst b/doc/file-format-changelog.rst index c3d9aa2dfc8..c1b59879f66 100644 --- a/doc/file-format-changelog.rst +++ b/doc/file-format-changelog.rst @@ -19,6 +19,13 @@ relative to the respective preceding *published* version. versions of the ``Cabal`` library denote unreleased development branches which have no stability guarantee. +``cabal-version: 3.11`` +----------------------- + +* Added :pkg-field:`package-constraints` stanza. This allows to declare + constraints that will be used for the dependencies that have no specified + constraints associated in ``build-depends`` lists. + ``cabal-version: 3.8`` ----------------------