From da8b959d89dff2ea453e02c00e84cabd5fd1b76c Mon Sep 17 00:00:00 2001 From: Piyush P Kurur Date: Fri, 27 Apr 2018 10:45:35 +0530 Subject: [PATCH] better handling of whitespaces when parsing mixin stanza. --- Cabal/Cabal.cabal | 17 ++- Cabal/Distribution/Types/ModuleRenaming.hs | 22 +++- Cabal/tests/ParserTests.hs | 5 + Cabal/tests/ParserTests/errors/mixin-1.cabal | 15 +++ Cabal/tests/ParserTests/errors/mixin-1.errors | 4 + Cabal/tests/ParserTests/errors/mixin-2.cabal | 14 +++ Cabal/tests/ParserTests/errors/mixin-2.errors | 4 + .../ParserTests/regressions/mixin-1.cabal | 10 ++ .../ParserTests/regressions/mixin-1.expr | 118 ++++++++++++++++++ .../ParserTests/regressions/mixin-1.format | 14 +++ .../ParserTests/regressions/mixin-2.cabal | 13 ++ .../ParserTests/regressions/mixin-2.expr | 118 ++++++++++++++++++ .../ParserTests/regressions/mixin-2.format | 14 +++ .../ParserTests/regressions/mixin-3.cabal | 12 ++ .../ParserTests/regressions/mixin-3.expr | 117 +++++++++++++++++ .../ParserTests/regressions/mixin-3.format | 12 ++ 16 files changed, 503 insertions(+), 6 deletions(-) create mode 100644 Cabal/tests/ParserTests/errors/mixin-1.cabal create mode 100644 Cabal/tests/ParserTests/errors/mixin-1.errors create mode 100644 Cabal/tests/ParserTests/errors/mixin-2.cabal create mode 100644 Cabal/tests/ParserTests/errors/mixin-2.errors create mode 100644 Cabal/tests/ParserTests/regressions/mixin-1.cabal create mode 100644 Cabal/tests/ParserTests/regressions/mixin-1.expr create mode 100644 Cabal/tests/ParserTests/regressions/mixin-1.format create mode 100644 Cabal/tests/ParserTests/regressions/mixin-2.cabal create mode 100644 Cabal/tests/ParserTests/regressions/mixin-2.expr create mode 100644 Cabal/tests/ParserTests/regressions/mixin-2.format create mode 100644 Cabal/tests/ParserTests/regressions/mixin-3.cabal create mode 100644 Cabal/tests/ParserTests/regressions/mixin-3.expr create mode 100644 Cabal/tests/ParserTests/regressions/mixin-3.format diff --git a/Cabal/Cabal.cabal b/Cabal/Cabal.cabal index 6b0eadee5e2..3cd2cdabdae 100644 --- a/Cabal/Cabal.cabal +++ b/Cabal/Cabal.cabal @@ -57,6 +57,10 @@ extra-source-files: tests/ParserTests/errors/leading-comma-2c.errors tests/ParserTests/errors/leading-comma.cabal tests/ParserTests/errors/leading-comma.errors + tests/ParserTests/errors/mixin-1.cabal + tests/ParserTests/errors/mixin-1.errors + tests/ParserTests/errors/mixin-2.cabal + tests/ParserTests/errors/mixin-2.errors tests/ParserTests/errors/multiple-libs.cabal tests/ParserTests/errors/multiple-libs.errors tests/ParserTests/errors/noVersion.cabal @@ -73,6 +77,8 @@ extra-source-files: tests/ParserTests/errors/spdx-2.errors tests/ParserTests/errors/spdx-3.cabal tests/ParserTests/errors/spdx-3.errors + tests/ParserTests/errors/undefined-flag.cabal + tests/ParserTests/errors/undefined-flag.errors tests/ParserTests/errors/version-sets-1.cabal tests/ParserTests/errors/version-sets-1.errors tests/ParserTests/errors/version-sets-2.cabal @@ -81,8 +87,6 @@ extra-source-files: tests/ParserTests/errors/version-sets-3.errors tests/ParserTests/errors/version-sets-4.cabal tests/ParserTests/errors/version-sets-4.errors - tests/ParserTests/errors/undefined-flag.cabal - tests/ParserTests/errors/undefined-flag.errors tests/ParserTests/ipi/Includes2.cabal tests/ParserTests/ipi/Includes2.expr tests/ParserTests/ipi/Includes2.format @@ -152,6 +156,15 @@ extra-source-files: tests/ParserTests/regressions/leading-comma.cabal tests/ParserTests/regressions/leading-comma.expr tests/ParserTests/regressions/leading-comma.format + tests/ParserTests/regressions/mixin-1.cabal + tests/ParserTests/regressions/mixin-1.expr + tests/ParserTests/regressions/mixin-1.format + tests/ParserTests/regressions/mixin-2.cabal + tests/ParserTests/regressions/mixin-2.expr + tests/ParserTests/regressions/mixin-2.format + tests/ParserTests/regressions/mixin-3.cabal + tests/ParserTests/regressions/mixin-3.expr + tests/ParserTests/regressions/mixin-3.format tests/ParserTests/regressions/multiple-libs-2.cabal tests/ParserTests/regressions/multiple-libs-2.check tests/ParserTests/regressions/multiple-libs-2.expr diff --git a/Cabal/Distribution/Types/ModuleRenaming.hs b/Cabal/Distribution/Types/ModuleRenaming.hs index d2cf3edc7e2..9cf67177b04 100644 --- a/Cabal/Distribution/Types/ModuleRenaming.hs +++ b/Cabal/Distribution/Types/ModuleRenaming.hs @@ -8,6 +8,7 @@ module Distribution.Types.ModuleRenaming ( isDefaultRenaming, ) where +import Distribution.CabalSpecVersion import Distribution.Compat.Prelude hiding (empty) import Prelude () @@ -64,6 +65,19 @@ isDefaultRenaming :: ModuleRenaming -> Bool isDefaultRenaming DefaultRenaming = True isDefaultRenaming _ = False +-- | For cabal spec versions < 2.4 white spaces were not skipped after the '(' +-- and ')' tokens in the mixin field. This parser checks the cabal file version +-- and does the correct skipping of spaces. +betweenParens :: CabalParsing m => m a -> m a +betweenParens p = do + csv <- askCabalSpecVersion + if csv >= CabalSpecV3_0 + then P.between (P.char '(' >> P.spaces) (P.spaces >> P.char ')' >> P.spaces) p + else P.between (P.char '(' >> warnSpaces) (P.char ')') p + where + warnSpaces = P.optional $ + P.space *> fail "space after parenthesis, use cabal-version: 2.4 or higher" + instance Binary ModuleRenaming where instance NFData ModuleRenaming where rnf = genericRnf @@ -84,18 +98,18 @@ instance Parsec ModuleRenaming where -- NB: try not necessary as the first token is obvious parsec = P.choice [ parseRename, parseHiding, return DefaultRenaming ] where + cma = P.char ',' >> P.spaces parseRename = do - rns <- P.between (P.char '(') (P.char ')') parseList + rns <- betweenParens parseList P.spaces return (ModuleRenaming rns) parseHiding = do _ <- P.string "hiding" P.spaces - hides <- P.between (P.char '(') (P.char ')') - (P.sepBy parsec (P.char ',' >> P.spaces)) + hides <- betweenParens (P.sepBy parsec cma) return (HidingRenaming hides) parseList = - P.sepBy parseEntry (P.char ',' >> P.spaces) + P.sepBy parseEntry cma parseEntry = do orig <- parsec P.spaces diff --git a/Cabal/tests/ParserTests.hs b/Cabal/tests/ParserTests.hs index f2e7e464446..e619b3c906a 100644 --- a/Cabal/tests/ParserTests.hs +++ b/Cabal/tests/ParserTests.hs @@ -117,6 +117,8 @@ errorTests = testGroup "errors" , errorTest "version-sets-3.cabal" , errorTest "version-sets-4.cabal" , errorTest "undefined-flag.cabal" + , errorTest "mixin-1.cabal" + , errorTest "mixin-2.cabal" ] errorTest :: FilePath -> TestTree @@ -165,6 +167,9 @@ regressionTests = testGroup "regressions" , regressionTest "hidden-main-lib.cabal" , regressionTest "jaeger-flamegraph.cabal" , regressionTest "version-sets.cabal" + , regressionTest "mixin-1.cabal" + , regressionTest "mixin-2.cabal" + , regressionTest "mixin-3.cabal" ] regressionTest :: FilePath -> TestTree diff --git a/Cabal/tests/ParserTests/errors/mixin-1.cabal b/Cabal/tests/ParserTests/errors/mixin-1.cabal new file mode 100644 index 00000000000..65da472bf8f --- /dev/null +++ b/Cabal/tests/ParserTests/errors/mixin-1.cabal @@ -0,0 +1,15 @@ +cabal-version: 2.4 +name: mixin +version: 0 + +-- mixin field: +-- in 2.2 we got leading/trailing commas +-- in 3.0 we got lax space parsing +-- +-- This should fail +executable str-example + main-is: Main.hs + build-depends: base, str-string, str-bytestring + mixins: str-string ( Str as Str.String ), + str-bytestring ( Str as Str.ByteString ), + hs-source-dirs: str-example diff --git a/Cabal/tests/ParserTests/errors/mixin-1.errors b/Cabal/tests/ParserTests/errors/mixin-1.errors new file mode 100644 index 00000000000..5450469186b --- /dev/null +++ b/Cabal/tests/ParserTests/errors/mixin-1.errors @@ -0,0 +1,4 @@ +VERSION: Just (mkVersion [2,4]) +mixin-1.cabal:13:41: +unexpected space after parenthesis, use cabal-version: 2.4 or higher + diff --git a/Cabal/tests/ParserTests/errors/mixin-2.cabal b/Cabal/tests/ParserTests/errors/mixin-2.cabal new file mode 100644 index 00000000000..9f85ba8ff3c --- /dev/null +++ b/Cabal/tests/ParserTests/errors/mixin-2.cabal @@ -0,0 +1,14 @@ +cabal-version: 2.2 +name: mixin +version: 0 + +-- mixin field: +-- in 2.2 we got leading/trailing commas +-- in 2.2 we got lax space parsing +-- +-- This should fail +executable str-example + main-is: Main.hs + build-depends: base, str-string, str-bytestring + mixins: str-string hiding ( Foo ) + hs-source-dirs: str-example diff --git a/Cabal/tests/ParserTests/errors/mixin-2.errors b/Cabal/tests/ParserTests/errors/mixin-2.errors new file mode 100644 index 00000000000..e6714275978 --- /dev/null +++ b/Cabal/tests/ParserTests/errors/mixin-2.errors @@ -0,0 +1,4 @@ +VERSION: Just (mkVersion [2,2]) +mixin-2.cabal:13:48: +unexpected space after parenthesis, use cabal-version: 2.4 or higher + diff --git a/Cabal/tests/ParserTests/regressions/mixin-1.cabal b/Cabal/tests/ParserTests/regressions/mixin-1.cabal new file mode 100644 index 00000000000..5645cd9ebfb --- /dev/null +++ b/Cabal/tests/ParserTests/regressions/mixin-1.cabal @@ -0,0 +1,10 @@ +cabal-version: 2.0 +name: mixin +version: 0 + +executable str-example + main-is: Main.hs + build-depends: base, str-string, str-bytestring + mixins: str-string (Str as Str.String), + str-bytestring (Str as Str.ByteString) + hs-source-dirs: str-example diff --git a/Cabal/tests/ParserTests/regressions/mixin-1.expr b/Cabal/tests/ParserTests/regressions/mixin-1.expr new file mode 100644 index 00000000000..fd330eed190 --- /dev/null +++ b/Cabal/tests/ParserTests/regressions/mixin-1.expr @@ -0,0 +1,118 @@ +GenericPackageDescription + {condBenchmarks = [], + condExecutables = [_×_ + `UnqualComponentName "str-example"` + CondNode + {condTreeComponents = [], + condTreeConstraints = [Dependency + `PackageName "base"` + AnyVersion + (Set.fromList [LMainLibName]), + Dependency + `PackageName "str-string"` + AnyVersion + (Set.fromList [LMainLibName]), + Dependency + `PackageName "str-bytestring"` + AnyVersion + (Set.fromList [LMainLibName])], + condTreeData = Executable + {buildInfo = BuildInfo + {asmOptions = [], + asmSources = [], + autogenModules = [], + buildToolDepends = [], + buildTools = [], + buildable = True, + cSources = [], + ccOptions = [], + cmmOptions = [], + cmmSources = [], + cppOptions = [], + customFieldsBI = [], + cxxOptions = [], + cxxSources = [], + defaultExtensions = [], + defaultLanguage = Nothing, + extraBundledLibs = [], + extraDynLibFlavours = [], + extraFrameworkDirs = [], + extraGHCiLibs = [], + extraLibDirs = [], + extraLibFlavours = [], + extraLibs = [], + frameworks = [], + hsSourceDirs = ["str-example"], + includeDirs = [], + includes = [], + installIncludes = [], + jsSources = [], + ldOptions = [], + mixins = [`Mixin {mixinPackageName = PackageName "str-string", mixinIncludeRenaming = IncludeRenaming {includeProvidesRn = ModuleRenaming [(ModuleName ["Str"],ModuleName ["Str","String"])], includeRequiresRn = DefaultRenaming}}`, + `Mixin {mixinPackageName = PackageName "str-bytestring", mixinIncludeRenaming = IncludeRenaming {includeProvidesRn = ModuleRenaming [(ModuleName ["Str"],ModuleName ["Str","ByteString"])], includeRequiresRn = DefaultRenaming}}`], + oldExtensions = [], + options = PerCompilerFlavor [] [], + otherExtensions = [], + otherLanguages = [], + otherModules = [], + pkgconfigDepends = [], + profOptions = PerCompilerFlavor [] [], + sharedOptions = PerCompilerFlavor [] [], + staticOptions = PerCompilerFlavor [] [], + targetBuildDepends = [Dependency + `PackageName "base"` + AnyVersion + (Set.fromList + [LMainLibName]), + Dependency + `PackageName "str-string"` + AnyVersion + (Set.fromList + [LMainLibName]), + Dependency + `PackageName "str-bytestring"` + AnyVersion + (Set.fromList + [LMainLibName])], + virtualModules = []}, + exeName = `UnqualComponentName "str-example"`, + exeScope = ExecutablePublic, + modulePath = "Main.hs"}}], + condForeignLibs = [], + condLibrary = Nothing, + condSubLibraries = [], + condTestSuites = [], + genPackageFlags = [], + 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 = [], + specVersionRaw = Left `mkVersion [2,0]`, + stability = "", + subLibraries = [], + synopsis = "", + testSuites = [], + testedWith = []}} diff --git a/Cabal/tests/ParserTests/regressions/mixin-1.format b/Cabal/tests/ParserTests/regressions/mixin-1.format new file mode 100644 index 00000000000..da0bf258552 --- /dev/null +++ b/Cabal/tests/ParserTests/regressions/mixin-1.format @@ -0,0 +1,14 @@ +cabal-version: 2.0 +name: mixin +version: 0 + +executable str-example + main-is: Main.hs + hs-source-dirs: str-example + build-depends: + base -any, + str-string -any, + str-bytestring -any + mixins: + str-string (Str as Str.String), + str-bytestring (Str as Str.ByteString) diff --git a/Cabal/tests/ParserTests/regressions/mixin-2.cabal b/Cabal/tests/ParserTests/regressions/mixin-2.cabal new file mode 100644 index 00000000000..81bcf8e96cc --- /dev/null +++ b/Cabal/tests/ParserTests/regressions/mixin-2.cabal @@ -0,0 +1,13 @@ +cabal-version: 3.0 +name: mixin +version: 0 + +-- mixin field: +-- in 2.2 we got leading/trailing commas +-- in 3.0 we got lax space parsing +executable str-example + main-is: Main.hs + build-depends: base, str-string, str-bytestring + mixins: str-string ( Str as Str.String ), + str-bytestring ( Str as Str.ByteString ), + hs-source-dirs: str-example diff --git a/Cabal/tests/ParserTests/regressions/mixin-2.expr b/Cabal/tests/ParserTests/regressions/mixin-2.expr new file mode 100644 index 00000000000..c36df74f8ac --- /dev/null +++ b/Cabal/tests/ParserTests/regressions/mixin-2.expr @@ -0,0 +1,118 @@ +GenericPackageDescription + {condBenchmarks = [], + condExecutables = [_×_ + `UnqualComponentName "str-example"` + CondNode + {condTreeComponents = [], + condTreeConstraints = [Dependency + `PackageName "base"` + AnyVersion + (Set.fromList [LMainLibName]), + Dependency + `PackageName "str-string"` + AnyVersion + (Set.fromList [LMainLibName]), + Dependency + `PackageName "str-bytestring"` + AnyVersion + (Set.fromList [LMainLibName])], + condTreeData = Executable + {buildInfo = BuildInfo + {asmOptions = [], + asmSources = [], + autogenModules = [], + buildToolDepends = [], + buildTools = [], + buildable = True, + cSources = [], + ccOptions = [], + cmmOptions = [], + cmmSources = [], + cppOptions = [], + customFieldsBI = [], + cxxOptions = [], + cxxSources = [], + defaultExtensions = [], + defaultLanguage = Nothing, + extraBundledLibs = [], + extraDynLibFlavours = [], + extraFrameworkDirs = [], + extraGHCiLibs = [], + extraLibDirs = [], + extraLibFlavours = [], + extraLibs = [], + frameworks = [], + hsSourceDirs = ["str-example"], + includeDirs = [], + includes = [], + installIncludes = [], + jsSources = [], + ldOptions = [], + mixins = [`Mixin {mixinPackageName = PackageName "str-string", mixinIncludeRenaming = IncludeRenaming {includeProvidesRn = ModuleRenaming [(ModuleName ["Str"],ModuleName ["Str","String"])], includeRequiresRn = DefaultRenaming}}`, + `Mixin {mixinPackageName = PackageName "str-bytestring", mixinIncludeRenaming = IncludeRenaming {includeProvidesRn = ModuleRenaming [(ModuleName ["Str"],ModuleName ["Str","ByteString"])], includeRequiresRn = DefaultRenaming}}`], + oldExtensions = [], + options = PerCompilerFlavor [] [], + otherExtensions = [], + otherLanguages = [], + otherModules = [], + pkgconfigDepends = [], + profOptions = PerCompilerFlavor [] [], + sharedOptions = PerCompilerFlavor [] [], + staticOptions = PerCompilerFlavor [] [], + targetBuildDepends = [Dependency + `PackageName "base"` + AnyVersion + (Set.fromList + [LMainLibName]), + Dependency + `PackageName "str-string"` + AnyVersion + (Set.fromList + [LMainLibName]), + Dependency + `PackageName "str-bytestring"` + AnyVersion + (Set.fromList + [LMainLibName])], + virtualModules = []}, + exeName = `UnqualComponentName "str-example"`, + exeScope = ExecutablePublic, + modulePath = "Main.hs"}}], + condForeignLibs = [], + condLibrary = Nothing, + condSubLibraries = [], + condTestSuites = [], + genPackageFlags = [], + 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 = [], + specVersionRaw = Left `mkVersion [3,0]`, + stability = "", + subLibraries = [], + synopsis = "", + testSuites = [], + testedWith = []}} diff --git a/Cabal/tests/ParserTests/regressions/mixin-2.format b/Cabal/tests/ParserTests/regressions/mixin-2.format new file mode 100644 index 00000000000..615c498a7ae --- /dev/null +++ b/Cabal/tests/ParserTests/regressions/mixin-2.format @@ -0,0 +1,14 @@ +cabal-version: 3.0 +name: mixin +version: 0 + +executable str-example + main-is: Main.hs + hs-source-dirs: str-example + build-depends: + base -any, + str-string -any, + str-bytestring -any + mixins: + str-string (Str as Str.String), + str-bytestring (Str as Str.ByteString) diff --git a/Cabal/tests/ParserTests/regressions/mixin-3.cabal b/Cabal/tests/ParserTests/regressions/mixin-3.cabal new file mode 100644 index 00000000000..89f1f44cb9e --- /dev/null +++ b/Cabal/tests/ParserTests/regressions/mixin-3.cabal @@ -0,0 +1,12 @@ +cabal-version: 3.0 +name: mixin +version: 0 + +-- mixin field: +-- in 2.2 we got leading/trailing commas +-- in 3.0 we got lax space parsing +executable str-example + main-is: Main.hs + build-depends: base, str-string, str-bytestring + mixins: str hiding ( Foo ) + hs-source-dirs: str-example diff --git a/Cabal/tests/ParserTests/regressions/mixin-3.expr b/Cabal/tests/ParserTests/regressions/mixin-3.expr new file mode 100644 index 00000000000..2262dc5235b --- /dev/null +++ b/Cabal/tests/ParserTests/regressions/mixin-3.expr @@ -0,0 +1,117 @@ +GenericPackageDescription + {condBenchmarks = [], + condExecutables = [_×_ + `UnqualComponentName "str-example"` + CondNode + {condTreeComponents = [], + condTreeConstraints = [Dependency + `PackageName "base"` + AnyVersion + (Set.fromList [LMainLibName]), + Dependency + `PackageName "str-string"` + AnyVersion + (Set.fromList [LMainLibName]), + Dependency + `PackageName "str-bytestring"` + AnyVersion + (Set.fromList [LMainLibName])], + condTreeData = Executable + {buildInfo = BuildInfo + {asmOptions = [], + asmSources = [], + autogenModules = [], + buildToolDepends = [], + buildTools = [], + buildable = True, + cSources = [], + ccOptions = [], + cmmOptions = [], + cmmSources = [], + cppOptions = [], + customFieldsBI = [], + cxxOptions = [], + cxxSources = [], + defaultExtensions = [], + defaultLanguage = Nothing, + extraBundledLibs = [], + extraDynLibFlavours = [], + extraFrameworkDirs = [], + extraGHCiLibs = [], + extraLibDirs = [], + extraLibFlavours = [], + extraLibs = [], + frameworks = [], + hsSourceDirs = ["str-example"], + includeDirs = [], + includes = [], + installIncludes = [], + jsSources = [], + ldOptions = [], + mixins = [`Mixin {mixinPackageName = PackageName "str", mixinIncludeRenaming = IncludeRenaming {includeProvidesRn = HidingRenaming [ModuleName ["Foo"]], includeRequiresRn = DefaultRenaming}}`], + oldExtensions = [], + options = PerCompilerFlavor [] [], + otherExtensions = [], + otherLanguages = [], + otherModules = [], + pkgconfigDepends = [], + profOptions = PerCompilerFlavor [] [], + sharedOptions = PerCompilerFlavor [] [], + staticOptions = PerCompilerFlavor [] [], + targetBuildDepends = [Dependency + `PackageName "base"` + AnyVersion + (Set.fromList + [LMainLibName]), + Dependency + `PackageName "str-string"` + AnyVersion + (Set.fromList + [LMainLibName]), + Dependency + `PackageName "str-bytestring"` + AnyVersion + (Set.fromList + [LMainLibName])], + virtualModules = []}, + exeName = `UnqualComponentName "str-example"`, + exeScope = ExecutablePublic, + modulePath = "Main.hs"}}], + condForeignLibs = [], + condLibrary = Nothing, + condSubLibraries = [], + condTestSuites = [], + genPackageFlags = [], + 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 = [], + specVersionRaw = Left `mkVersion [3,0]`, + stability = "", + subLibraries = [], + synopsis = "", + testSuites = [], + testedWith = []}} diff --git a/Cabal/tests/ParserTests/regressions/mixin-3.format b/Cabal/tests/ParserTests/regressions/mixin-3.format new file mode 100644 index 00000000000..16a1e420c00 --- /dev/null +++ b/Cabal/tests/ParserTests/regressions/mixin-3.format @@ -0,0 +1,12 @@ +cabal-version: 3.0 +name: mixin +version: 0 + +executable str-example + main-is: Main.hs + hs-source-dirs: str-example + build-depends: + base -any, + str-string -any, + str-bytestring -any + mixins: str hiding (Foo)