summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergeiTrofimovich <>2018-03-15 07:44:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-03-15 07:44:00 (GMT)
commit084556c030992cb52e5a67273a956784ddaf1de9 (patch)
tree38a0c65cf0401dbc0c674d6192183da146213835
parent03864dc66a711ed7eca6bbb2911ca1aa9e396b64 (diff)
version 0.5.50.5.5
-rw-r--r--HackPort/GlobalFlags.hs3
-rw-r--r--Main.hs15
-rw-r--r--Merge.hs37
-rw-r--r--Merge/Dependencies.hs2
-rw-r--r--Portage/Cabal.hs14
-rw-r--r--cabal/.mailmap15
-rw-r--r--cabal/.travis.yml55
-rw-r--r--cabal/AUTHORS20
-rw-r--r--cabal/Cabal/Cabal.cabal162
-rw-r--r--cabal/Cabal/Distribution/Backpack.hs4
-rw-r--r--cabal/Cabal/Distribution/Backpack/ComponentsGraph.hs66
-rw-r--r--cabal/Cabal/Distribution/Backpack/Configure.hs105
-rw-r--r--cabal/Cabal/Distribution/Backpack/ConfiguredComponent.hs287
-rw-r--r--cabal/Cabal/Distribution/Backpack/DescribeUnitId.hs61
-rw-r--r--cabal/Cabal/Distribution/Backpack/FullUnitId.hs2
-rw-r--r--cabal/Cabal/Distribution/Backpack/Id.hs65
-rw-r--r--cabal/Cabal/Distribution/Backpack/LinkedComponent.hs360
-rw-r--r--cabal/Cabal/Distribution/Backpack/MixLink.hs124
-rw-r--r--cabal/Cabal/Distribution/Backpack/ModuleScope.hs91
-rw-r--r--cabal/Cabal/Distribution/Backpack/PreExistingComponent.hs40
-rw-r--r--cabal/Cabal/Distribution/Backpack/PreModuleShape.hs45
-rw-r--r--cabal/Cabal/Distribution/Backpack/ReadyComponent.hs212
-rw-r--r--cabal/Cabal/Distribution/Backpack/UnifyM.hs270
-rw-r--r--cabal/Cabal/Distribution/Compat/Binary/Class.hs98
-rw-r--r--cabal/Cabal/Distribution/Compat/CopyFile.hs19
-rw-r--r--cabal/Cabal/Distribution/Compat/DList.hs4
-rw-r--r--cabal/Cabal/Distribution/Compat/Graph.hs36
-rw-r--r--cabal/Cabal/Distribution/Compat/Lens.hs274
-rw-r--r--cabal/Cabal/Distribution/Compat/Map/Strict.hs31
-rw-r--r--cabal/Cabal/Distribution/Compat/Newtype.hs70
-rw-r--r--cabal/Cabal/Distribution/Compat/Parsec.hs5
-rw-r--r--cabal/Cabal/Distribution/Compat/Prelude.hs7
-rw-r--r--cabal/Cabal/Distribution/Compat/ReadP.hs27
-rw-r--r--cabal/Cabal/Distribution/Compat/Stack.hs17
-rw-r--r--cabal/Cabal/Distribution/Compiler.hs23
-rw-r--r--cabal/Cabal/Distribution/FieldGrammar.hs86
-rw-r--r--cabal/Cabal/Distribution/FieldGrammar/Class.hs149
-rw-r--r--cabal/Cabal/Distribution/FieldGrammar/Parsec.hs260
-rw-r--r--cabal/Cabal/Distribution/FieldGrammar/Pretty.hs70
-rw-r--r--cabal/Cabal/Distribution/InstalledPackageInfo.hs115
-rw-r--r--cabal/Cabal/Distribution/License.hs52
-rw-r--r--cabal/Cabal/Distribution/ModuleName.hs33
-rw-r--r--cabal/Cabal/Distribution/Package.hs496
-rw-r--r--cabal/Cabal/Distribution/Package/TextClass.hs56
-rw-r--r--cabal/Cabal/Distribution/PackageDescription.hs9
-rw-r--r--cabal/Cabal/Distribution/PackageDescription/Check.hs382
-rw-r--r--cabal/Cabal/Distribution/PackageDescription/Configuration.hs257
-rw-r--r--cabal/Cabal/Distribution/PackageDescription/FieldGrammar.hs514
-rw-r--r--cabal/Cabal/Distribution/PackageDescription/Parse.hs91
-rw-r--r--cabal/Cabal/Distribution/PackageDescription/Parsec.hs589
-rw-r--r--cabal/Cabal/Distribution/PackageDescription/Parsec/FieldDescr.hs607
-rw-r--r--cabal/Cabal/Distribution/PackageDescription/PrettyPrint.hs384
-rw-r--r--cabal/Cabal/Distribution/PackageDescription/Quirks.hs203
-rw-r--r--cabal/Cabal/Distribution/ParseUtils.hs35
-rw-r--r--cabal/Cabal/Distribution/Parsec/Class.hs402
-rw-r--r--cabal/Cabal/Distribution/Parsec/Common.hs93
-rw-r--r--cabal/Cabal/Distribution/Parsec/ConfVar.hs41
-rw-r--r--cabal/Cabal/Distribution/Parsec/Field.hs96
-rw-r--r--cabal/Cabal/Distribution/Parsec/Lexer.hs506
-rw-r--r--cabal/Cabal/Distribution/Parsec/Lexer.x269
-rw-r--r--cabal/Cabal/Distribution/Parsec/LexerMonad.hs13
-rw-r--r--cabal/Cabal/Distribution/Parsec/Newtypes.hs236
-rw-r--r--cabal/Cabal/Distribution/Parsec/ParseResult.hs128
-rw-r--r--cabal/Cabal/Distribution/Parsec/Parser.hs71
-rw-r--r--cabal/Cabal/Distribution/Parsec/Types/Common.hs89
-rw-r--r--cabal/Cabal/Distribution/Parsec/Types/Field.hs82
-rw-r--r--cabal/Cabal/Distribution/Parsec/Types/FieldDescr.hs238
-rw-r--r--cabal/Cabal/Distribution/Parsec/Types/ParseResult.hs87
-rw-r--r--cabal/Cabal/Distribution/Pretty.hs95
-rw-r--r--cabal/Cabal/Distribution/PrettyUtils.hs47
-rw-r--r--cabal/Cabal/Distribution/ReadE.hs12
-rw-r--r--cabal/Cabal/Distribution/Simple.hs38
-rw-r--r--cabal/Cabal/Distribution/Simple/Bench.hs10
-rw-r--r--cabal/Cabal/Distribution/Simple/Build.hs165
-rw-r--r--cabal/Cabal/Distribution/Simple/Build/Macros.hs27
-rw-r--r--cabal/Cabal/Distribution/Simple/Build/PathsModule.hs2
-rw-r--r--cabal/Cabal/Distribution/Simple/BuildPaths.hs111
-rw-r--r--cabal/Cabal/Distribution/Simple/BuildTarget.hs40
-rw-r--r--cabal/Cabal/Distribution/Simple/BuildToolDepends.hs96
-rw-r--r--cabal/Cabal/Distribution/Simple/Command.hs2
-rw-r--r--cabal/Cabal/Distribution/Simple/Compiler.hs6
-rw-r--r--cabal/Cabal/Distribution/Simple/Configure.hs483
-rw-r--r--cabal/Cabal/Distribution/Simple/Doctest.hs188
-rw-r--r--cabal/Cabal/Distribution/Simple/GHC.hs377
-rw-r--r--cabal/Cabal/Distribution/Simple/GHC/IPI642.hs11
-rw-r--r--cabal/Cabal/Distribution/Simple/GHC/IPIConvert.hs7
-rw-r--r--cabal/Cabal/Distribution/Simple/GHC/ImplInfo.hs6
-rw-r--r--cabal/Cabal/Distribution/Simple/GHC/Internal.hs67
-rw-r--r--cabal/Cabal/Distribution/Simple/GHCJS.hs67
-rw-r--r--cabal/Cabal/Distribution/Simple/Haddock.hs176
-rw-r--r--cabal/Cabal/Distribution/Simple/HaskellSuite.hs8
-rw-r--r--cabal/Cabal/Distribution/Simple/Hpc.hs2
-rw-r--r--cabal/Cabal/Distribution/Simple/Install.hs52
-rw-r--r--cabal/Cabal/Distribution/Simple/InstallDirs.hs12
-rw-r--r--cabal/Cabal/Distribution/Simple/JHC.hs5
-rw-r--r--cabal/Cabal/Distribution/Simple/LHC.hs35
-rw-r--r--cabal/Cabal/Distribution/Simple/LocalBuildInfo.hs6
-rw-r--r--cabal/Cabal/Distribution/Simple/PackageIndex.hs261
-rw-r--r--cabal/Cabal/Distribution/Simple/PreProcess.hs52
-rw-r--r--cabal/Cabal/Distribution/Simple/Program.hs5
-rw-r--r--cabal/Cabal/Distribution/Simple/Program/Ar.hs41
-rw-r--r--cabal/Cabal/Distribution/Simple/Program/Builtin.hs25
-rw-r--r--cabal/Cabal/Distribution/Simple/Program/Db.hs14
-rw-r--r--cabal/Cabal/Distribution/Simple/Program/GHC.hs29
-rw-r--r--cabal/Cabal/Distribution/Simple/Program/HcPkg.hs158
-rw-r--r--cabal/Cabal/Distribution/Simple/Program/Hpc.hs8
-rw-r--r--cabal/Cabal/Distribution/Simple/Program/Ld.hs43
-rw-r--r--cabal/Cabal/Distribution/Simple/Program/ResponseFile.hs60
-rw-r--r--cabal/Cabal/Distribution/Simple/Program/Run.hs60
-rw-r--r--cabal/Cabal/Distribution/Simple/Program/Strip.hs2
-rw-r--r--cabal/Cabal/Distribution/Simple/Program/Types.hs2
-rw-r--r--cabal/Cabal/Distribution/Simple/Register.hs181
-rw-r--r--cabal/Cabal/Distribution/Simple/Setup.hs329
-rw-r--r--cabal/Cabal/Distribution/Simple/SrcDist.hs35
-rw-r--r--cabal/Cabal/Distribution/Simple/Test.hs19
-rw-r--r--cabal/Cabal/Distribution/Simple/Test/ExeV10.hs8
-rw-r--r--cabal/Cabal/Distribution/Simple/Test/LibV09.hs29
-rw-r--r--cabal/Cabal/Distribution/Simple/Test/Log.hs1
-rw-r--r--cabal/Cabal/Distribution/Simple/UHC.hs3
-rw-r--r--cabal/Cabal/Distribution/Simple/UserHooks.hs10
-rw-r--r--cabal/Cabal/Distribution/Simple/Utils.hs816
-rw-r--r--cabal/Cabal/Distribution/System.hs63
-rw-r--r--cabal/Cabal/Distribution/Text.hs28
-rw-r--r--cabal/Cabal/Distribution/Types/AbiHash.hs55
-rw-r--r--cabal/Cabal/Distribution/Types/AnnotatedId.hs25
-rw-r--r--cabal/Cabal/Distribution/Types/Benchmark.hs7
-rw-r--r--cabal/Cabal/Distribution/Types/Benchmark/Lens.hs27
-rw-r--r--cabal/Cabal/Distribution/Types/BenchmarkType.hs23
-rw-r--r--cabal/Cabal/Distribution/Types/BuildInfo.hs81
-rw-r--r--cabal/Cabal/Distribution/Types/BuildInfo/Lens.hs316
-rw-r--r--cabal/Cabal/Distribution/Types/BuildType.hs24
-rw-r--r--cabal/Cabal/Distribution/Types/Component.hs17
-rw-r--r--cabal/Cabal/Distribution/Types/ComponentId.hs74
-rw-r--r--cabal/Cabal/Distribution/Types/ComponentInclude.hs32
-rw-r--r--cabal/Cabal/Distribution/Types/ComponentLocalBuildInfo.hs25
-rw-r--r--cabal/Cabal/Distribution/Types/ComponentName.hs34
-rw-r--r--cabal/Cabal/Distribution/Types/ComponentRequestedSpec.hs14
-rw-r--r--cabal/Cabal/Distribution/Types/CondTree.hs158
-rw-r--r--cabal/Cabal/Distribution/Types/Condition.hs133
-rw-r--r--cabal/Cabal/Distribution/Types/Dependency.hs72
-rw-r--r--cabal/Cabal/Distribution/Types/DependencyMap.hs74
-rw-r--r--cabal/Cabal/Distribution/Types/ExeDependency.hs57
-rw-r--r--cabal/Cabal/Distribution/Types/Executable.hs10
-rw-r--r--cabal/Cabal/Distribution/Types/Executable/Lens.hs32
-rw-r--r--cabal/Cabal/Distribution/Types/ExecutableScope.hs53
-rw-r--r--cabal/Cabal/Distribution/Types/ForeignLib.hs161
-rw-r--r--cabal/Cabal/Distribution/Types/ForeignLib/Lens.hs45
-rw-r--r--cabal/Cabal/Distribution/Types/ForeignLibOption.hs21
-rw-r--r--cabal/Cabal/Distribution/Types/ForeignLibType.hs25
-rw-r--r--cabal/Cabal/Distribution/Types/GenericPackageDescription.hs265
-rw-r--r--cabal/Cabal/Distribution/Types/GenericPackageDescription/Lens.hs121
-rw-r--r--cabal/Cabal/Distribution/Types/HookedBuildInfo.hs2
-rw-r--r--cabal/Cabal/Distribution/Types/IncludeRenaming.hs39
-rw-r--r--cabal/Cabal/Distribution/Types/LegacyExeDependency.hs65
-rw-r--r--cabal/Cabal/Distribution/Types/Lens.hs25
-rw-r--r--cabal/Cabal/Distribution/Types/Library.hs21
-rw-r--r--cabal/Cabal/Distribution/Types/Library/Lens.hs40
-rw-r--r--cabal/Cabal/Distribution/Types/LocalBuildInfo.hs13
-rw-r--r--cabal/Cabal/Distribution/Types/Mixin.hs29
-rw-r--r--cabal/Cabal/Distribution/Types/Module.hs54
-rw-r--r--cabal/Cabal/Distribution/Types/ModuleReexport.hs36
-rw-r--r--cabal/Cabal/Distribution/Types/ModuleRenaming.hs71
-rw-r--r--cabal/Cabal/Distribution/Types/MungedPackageId.hs55
-rw-r--r--cabal/Cabal/Distribution/Types/MungedPackageName.hs134
-rw-r--r--cabal/Cabal/Distribution/Types/PackageDescription.hs14
-rw-r--r--cabal/Cabal/Distribution/Types/PackageDescription/Lens.hs149
-rw-r--r--cabal/Cabal/Distribution/Types/PackageId.hs47
-rw-r--r--cabal/Cabal/Distribution/Types/PackageId/Lens.hs22
-rw-r--r--cabal/Cabal/Distribution/Types/PackageName.hs62
-rw-r--r--cabal/Cabal/Distribution/Types/PkgconfigDependency.hs50
-rw-r--r--cabal/Cabal/Distribution/Types/PkgconfigName.hs67
-rw-r--r--cabal/Cabal/Distribution/Types/SetupBuildInfo.hs17
-rw-r--r--cabal/Cabal/Distribution/Types/SetupBuildInfo/Lens.hs21
-rw-r--r--cabal/Cabal/Distribution/Types/SourceRepo.hs39
-rw-r--r--cabal/Cabal/Distribution/Types/SourceRepo/Lens.hs39
-rw-r--r--cabal/Cabal/Distribution/Types/TargetInfo.hs2
-rw-r--r--cabal/Cabal/Distribution/Types/TestSuite.hs7
-rw-r--r--cabal/Cabal/Distribution/Types/TestSuite/Lens.hs27
-rw-r--r--cabal/Cabal/Distribution/Types/TestType.hs26
-rw-r--r--cabal/Cabal/Distribution/Types/UnitId.hs134
-rw-r--r--cabal/Cabal/Distribution/Types/UnqualComponentName.hs89
-rw-r--r--cabal/Cabal/Distribution/Types/Version.hs231
-rw-r--r--cabal/Cabal/Distribution/Types/VersionInterval.hs361
-rw-r--r--cabal/Cabal/Distribution/Types/VersionRange.hs526
-rw-r--r--cabal/Cabal/Distribution/Utils/BinaryWithFingerprint.hs87
-rw-r--r--cabal/Cabal/Distribution/Utils/Generic.hs452
-rw-r--r--cabal/Cabal/Distribution/Utils/IOData.hs73
-rw-r--r--cabal/Cabal/Distribution/Utils/LogProgress.hs80
-rw-r--r--cabal/Cabal/Distribution/Utils/ShortText.hs4
-rw-r--r--cabal/Cabal/Distribution/Utils/String.hs16
-rw-r--r--cabal/Cabal/Distribution/Verbosity.hs130
-rw-r--r--cabal/Cabal/Distribution/Version.hs1015
-rw-r--r--cabal/Cabal/LICENSE2
-rw-r--r--cabal/Cabal/Language/Haskell/Extension.hs278
-rw-r--r--cabal/Cabal/Makefile47
-rw-r--r--cabal/Cabal/changelog121
-rw-r--r--cabal/Cabal/doc/README.md8
-rw-r--r--cabal/Cabal/doc/conf.py15
-rw-r--r--cabal/Cabal/doc/developing-packages.rst550
-rw-r--r--cabal/Cabal/doc/index.rst1
-rw-r--r--cabal/Cabal/doc/installing-packages.rst144
-rw-r--r--cabal/Cabal/doc/nix-integration.rst49
-rw-r--r--cabal/Cabal/doc/nix-local-build-overview.rst12
-rw-r--r--cabal/Cabal/doc/nix-local-build.rst340
-rwxr-xr-xcabal/Cabal/misc/gen-extra-source-files.hs119
-rw-r--r--cabal/LICENSE2
-rw-r--r--cabal/Makefile23
-rw-r--r--cabal/Paths_Cabal.hs2
-rw-r--r--cabal/Paths_cabal_install.hs2
-rw-r--r--cabal/README.md178
-rw-r--r--cabal/appveyor-retry.cmd21
-rw-r--r--cabal/appveyor.yml39
-rw-r--r--cabal/boot/Lexer.x281
-rw-r--r--cabal/cabal-dev-scripts/LICENSE30
-rw-r--r--cabal/cabal-dev-scripts/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/sandbox-sources/q/Setup.hs)0
-rw-r--r--cabal/cabal-dev-scripts/cabal-dev-scripts.cabal23
-rw-r--r--cabal/cabal-dev-scripts/src/GenExtraSourceFiles.hs107
-rw-r--r--cabal/cabal-install/.ghci1
-rw-r--r--cabal/cabal-install/Distribution/Client/BuildReports/Anonymous.hs21
-rw-r--r--cabal/cabal-install/Distribution/Client/BuildReports/Storage.hs9
-rw-r--r--cabal/cabal-install/Distribution/Client/BuildReports/Upload.hs6
-rw-r--r--cabal/cabal-install/Distribution/Client/BuildTarget.hs1670
-rw-r--r--cabal/cabal-install/Distribution/Client/Check.hs12
-rw-r--r--cabal/cabal-install/Distribution/Client/CmdBench.hs240
-rw-r--r--cabal/cabal-install/Distribution/Client/CmdBuild.hs197
-rw-r--r--cabal/cabal-install/Distribution/Client/CmdConfigure.hs106
-rw-r--r--cabal/cabal-install/Distribution/Client/CmdErrorMessages.hs364
-rw-r--r--cabal/cabal-install/Distribution/Client/CmdExec.hs259
-rw-r--r--cabal/cabal-install/Distribution/Client/CmdFreeze.hs110
-rw-r--r--cabal/cabal-install/Distribution/Client/CmdHaddock.hs209
-rw-r--r--cabal/cabal-install/Distribution/Client/CmdInstall.hs353
-rw-r--r--cabal/cabal-install/Distribution/Client/CmdRepl.hs294
-rw-r--r--cabal/cabal-install/Distribution/Client/CmdRun.hs423
-rw-r--r--cabal/cabal-install/Distribution/Client/CmdTest.hs243
-rw-r--r--cabal/cabal-install/Distribution/Client/CmdUpdate.hs196
-rw-r--r--cabal/cabal-install/Distribution/Client/Compat/FileLock.hsc201
-rw-r--r--cabal/cabal-install/Distribution/Client/Compat/FilePerms.hs5
-rw-r--r--cabal/cabal-install/Distribution/Client/Compat/Prelude.hs2
-rw-r--r--cabal/cabal-install/Distribution/Client/Compat/Semaphore.hs4
-rw-r--r--cabal/cabal-install/Distribution/Client/Config.hs89
-rw-r--r--cabal/cabal-install/Distribution/Client/Configure.hs67
-rw-r--r--cabal/cabal-install/Distribution/Client/Dependency.hs204
-rw-r--r--cabal/cabal-install/Distribution/Client/DistDirLayout.hs156
-rw-r--r--cabal/cabal-install/Distribution/Client/Exec.hs83
-rw-r--r--cabal/cabal-install/Distribution/Client/Fetch.hs21
-rw-r--r--cabal/cabal-install/Distribution/Client/FetchUtils.hs22
-rw-r--r--cabal/cabal-install/Distribution/Client/FileMonitor.hs16
-rw-r--r--cabal/cabal-install/Distribution/Client/Freeze.hs44
-rw-r--r--cabal/cabal-install/Distribution/Client/GenBounds.hs18
-rw-r--r--cabal/cabal-install/Distribution/Client/Get.hs36
-rw-r--r--cabal/cabal-install/Distribution/Client/GlobalFlags.hs8
-rw-r--r--cabal/cabal-install/Distribution/Client/HttpUtils.hs116
-rw-r--r--cabal/cabal-install/Distribution/Client/IndexUtils.hs179
-rw-r--r--cabal/cabal-install/Distribution/Client/Init.hs125
-rw-r--r--cabal/cabal-install/Distribution/Client/Init/Types.hs11
-rw-r--r--cabal/cabal-install/Distribution/Client/Install.hs174
-rw-r--r--cabal/cabal-install/Distribution/Client/InstallPlan.hs40
-rw-r--r--cabal/cabal-install/Distribution/Client/InstallSymlink.hs7
-rw-r--r--cabal/cabal-install/Distribution/Client/List.hs33
-rw-r--r--cabal/cabal-install/Distribution/Client/Nix.hs202
-rw-r--r--cabal/cabal-install/Distribution/Client/Outdated.hs206
-rw-r--r--cabal/cabal-install/Distribution/Client/PackageHash.hs57
-rw-r--r--cabal/cabal-install/Distribution/Client/PackageUtils.hs4
-rw-r--r--cabal/cabal-install/Distribution/Client/ParseUtils.hs8
-rw-r--r--cabal/cabal-install/Distribution/Client/ProjectBuilding.hs241
-rw-r--r--cabal/cabal-install/Distribution/Client/ProjectBuilding/Types.hs1
-rw-r--r--cabal/cabal-install/Distribution/Client/ProjectConfig.hs254
-rw-r--r--cabal/cabal-install/Distribution/Client/ProjectConfig/Legacy.hs133
-rw-r--r--cabal/cabal-install/Distribution/Client/ProjectConfig/Types.hs31
-rw-r--r--cabal/cabal-install/Distribution/Client/ProjectOrchestration.hs692
-rw-r--r--cabal/cabal-install/Distribution/Client/ProjectPlanOutput.hs151
-rw-r--r--cabal/cabal-install/Distribution/Client/ProjectPlanning.hs1663
-rw-r--r--cabal/cabal-install/Distribution/Client/ProjectPlanning/Types.hs204
-rw-r--r--cabal/cabal-install/Distribution/Client/RebuildMonad.hs11
-rw-r--r--cabal/cabal-install/Distribution/Client/Reconfigure.hs65
-rw-r--r--cabal/cabal-install/Distribution/Client/Run.hs12
-rw-r--r--cabal/cabal-install/Distribution/Client/Sandbox.hs59
-rw-r--r--cabal/cabal-install/Distribution/Client/Sandbox/Index.hs34
-rw-r--r--cabal/cabal-install/Distribution/Client/Sandbox/PackageEnvironment.hs38
-rw-r--r--cabal/cabal-install/Distribution/Client/Sandbox/Timestamp.hs46
-rw-r--r--cabal/cabal-install/Distribution/Client/Security/DNS.hs74
-rw-r--r--cabal/cabal-install/Distribution/Client/Setup.hs388
-rw-r--r--cabal/cabal-install/Distribution/Client/SetupWrapper.hs86
-rw-r--r--cabal/cabal-install/Distribution/Client/SolverInstallPlan.hs16
-rw-r--r--cabal/cabal-install/Distribution/Client/SolverPlanIndex.hs233
-rw-r--r--cabal/cabal-install/Distribution/Client/SrcDist.hs15
-rw-r--r--cabal/cabal-install/Distribution/Client/Store.hs251
-rw-r--r--cabal/cabal-install/Distribution/Client/TargetSelector.hs2253
-rw-r--r--cabal/cabal-install/Distribution/Client/Targets.hs441
-rw-r--r--cabal/cabal-install/Distribution/Client/Types.hs267
-rw-r--r--cabal/cabal-install/Distribution/Client/Update.hs45
-rw-r--r--cabal/cabal-install/Distribution/Client/Upload.hs49
-rw-r--r--cabal/cabal-install/Distribution/Client/Utils.hs14
-rw-r--r--cabal/cabal-install/Distribution/Client/Utils/Assertion.hs18
-rw-r--r--cabal/cabal-install/Distribution/Client/Win32SelfUpgrade.hs4
-rw-r--r--cabal/cabal-install/Distribution/Client/World.hs35
-rw-r--r--cabal/cabal-install/Distribution/Solver/Compat/Prelude.hs19
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular.hs20
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/Assignment.hs78
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/Builder.hs333
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/ConfiguredConversion.hs2
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/ConflictSet.hs69
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/Cycles.hs124
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/Degree.hs21
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/Dependency.hs344
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/Explore.hs85
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/Flag.hs56
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/Index.hs12
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/IndexConversion.hs299
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/LabeledGraph.hs2
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/Linking.hs216
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/Log.hs90
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/Message.hs67
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/PSQ.hs80
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/Package.hs29
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/Preference.hs246
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/Solver.hs124
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/Tree.hs106
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/Validate.hs311
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/Var.hs24
-rw-r--r--cabal/cabal-install/Distribution/Solver/Modular/WeightedPSQ.hs11
-rw-r--r--cabal/cabal-install/Distribution/Solver/Types/ComponentDeps.hs4
-rw-r--r--cabal/cabal-install/Distribution/Solver/Types/ConstraintSource.hs8
-rw-r--r--cabal/cabal-install/Distribution/Solver/Types/Flag.hs6
-rw-r--r--cabal/cabal-install/Distribution/Solver/Types/InstSolverPackage.hs14
-rw-r--r--cabal/cabal-install/Distribution/Solver/Types/OptionalStanza.hs6
-rw-r--r--cabal/cabal-install/Distribution/Solver/Types/PackageConstraint.hs168
-rw-r--r--cabal/cabal-install/Distribution/Solver/Types/PackageIndex.hs21
-rw-r--r--cabal/cabal-install/Distribution/Solver/Types/PackagePath.hs72
-rw-r--r--cabal/cabal-install/Distribution/Solver/Types/PkgConfigDb.hs2
-rw-r--r--cabal/cabal-install/Distribution/Solver/Types/Progress.hs12
-rw-r--r--cabal/cabal-install/Distribution/Solver/Types/Settings.hs5
-rw-r--r--cabal/cabal-install/Distribution/Solver/Types/Variable.hs2
-rw-r--r--cabal/cabal-install/LICENSE2
-rw-r--r--cabal/cabal-install/Main.hs1149
-rwxr-xr-xcabal/cabal-install/bootstrap.sh54
-rw-r--r--cabal/cabal-install/cabal-install.cabal870
-rw-r--r--cabal/cabal-install/changelog170
-rw-r--r--cabal/cabal-install/main/Main.hs1229
-rw-r--r--cabal/cabal-install/tests/IntegrationTests.hs325
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes2-external.sh9
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes2-internal.sh9
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes2/Includes2.cabal41
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes2/exe/Main.hs3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes2/exe/exe.cabal12
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes2/mylib/Database.hsig3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes2/mylib/Mine.hs4
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes2/mylib/mylib.cabal13
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes2/mysql/Database/MySQL.hs3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes2/mysql/mysql.cabal12
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes2/postgresql/Database/PostgreSQL.hs3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes2/postgresql/postgresql.cabal12
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes2/src/App.hs7
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes2/src/src.cabal15
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes3-external.sh9
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes3-internal.sh9
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes3/Includes3.cabal23
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes3/exe/Main.hs4
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes3/exe/Setup.hs2
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes3/exe/exe.cabal12
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes3/indef/Foo.hs6
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes3/indef/indef.cabal11
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes3/sigs/Data/Map.hsig5
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/backpack/includes3/sigs/sigs.cabal11
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/common.sh28
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/custom-setup/Cabal-99998/Cabal.cabal8
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/custom-setup/Cabal-99998/CabalMessage.hs3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/custom-setup/Cabal-99999/Cabal.cabal8
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/custom-setup/Cabal-99999/CabalMessage.hs3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/custom-setup/custom-setup-without-cabal/custom-setup-without-cabal.cabal9
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/custom-setup/custom-setup/custom-setup.cabal9
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/custom-setup/custom_setup_without_Cabal_doesnt_allow_Cabal_import.sh12
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/custom-setup/custom_setup_without_Cabal_doesnt_require_Cabal.sh11
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/custom-setup/installs_Cabal_as_setup_dep.sh15
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/custom-setup/new_build_requires_Cabal_1_20.sh9
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/custom/custom_dep.sh22
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/custom/plain.sh15
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/custom/plain/Setup.hs3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/custom/segfault.sh10
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/exec/adds_sandbox_bin_directory_to_path.out1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/exec/adds_sandbox_bin_directory_to_path.sh10
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/exec/auto_configures_on_exec.out4
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/exec/auto_configures_on_exec.sh2
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/exec/can_run_executables_installed_in_sandbox.out1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/exec/can_run_executables_installed_in_sandbox.sh9
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/exec/configures_cabal_to_use_sandbox.sh14
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/exec/configures_ghc_to_use_sandbox.sh13
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/exec/exit_with_failure_without_args.err1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/exec/exit_with_failure_without_args.sh3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/exec/runs_given_command.out1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/exec/runs_given_command.sh3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/freeze/disable_benchmarks_freezes_bench_deps.sh3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/freeze/disable_tests_freezes_test_deps.sh3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/freeze/does_not_freeze_nondeps.sh5
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/freeze/does_not_freeze_self.sh3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/freeze/dry_run_does_not_create_config.sh3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/freeze/enable_benchmarks_freezes_bench_deps.sh4
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/freeze/enable_tests_freezes_test_deps.sh3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/freeze/freezes_direct_dependencies.sh3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/freeze/freezes_transitive_dependencies.sh3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/freeze/runs_without_error.sh2
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/internal-libs/internal_lib_basic.sh5
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/internal-libs/internal_lib_shadow.sh6
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/internal-libs/new_build.sh3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/internal-libs/p/Foo.hs2
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/internal-libs/p/p.cabal23
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/internal-libs/p/p/P.hs2
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/internal-libs/p/q/Q.hs2
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/internal-libs/q/Q.hs2
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/internal-libs/q/q.cabal12
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/manpage/outputs_manpage.sh11
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/multiple-source/finds_second_source_of_multiple_source.sh11
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/new-build/BuildToolsPath.sh3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/new-build/BuildToolsPath/A.hs5
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/new-build/BuildToolsPath/build-tools-path.cabal25
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/new-build/T3460.sh3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/new-build/T3978.err1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/new-build/T3978.sh3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/new-build/T3978/q/q.cabal7
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/new-build/T4017.sh3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/new-build/T4017/p/p.cabal7
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/new-build/executable/a.cabal15
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/new-build/external_build_tools.sh3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/new-build/monitor_cabal_files.sh8
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/regression/t2755.sh6
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/regression/t3199.sh12
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/regression/t3827.sh4
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/regression/t3827/p/p.cabal8
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/regression/t3827/q/q.cabal8
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/sandbox-reinstalls/reinstall-modified-source.sh16
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/sandbox-sources/fail_removing_source_thats_not_registered.err3
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/sandbox-sources/fail_removing_source_thats_not_registered.sh10
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/sandbox-sources/remove_nonexistent_source.sh22
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/sandbox-sources/report_success_removing_source.out6
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/sandbox-sources/report_success_removing_source.sh11
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/user-config/cabal-config182
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/user-config/common.sh9
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/user-config/doesnt_overwrite_without_f.err1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/user-config/doesnt_overwrite_without_f.sh5
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/user-config/overwrites_with_f.out2
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/user-config/overwrites_with_f.sh9
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/user-config/runs_without_error.out1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/user-config/runs_without_error.sh7
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/user-config/uses_CABAL_CONFIG.out1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests/user-config/uses_CABAL_CONFIG.sh5
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2.hs1420
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/all-disabled/cabal.project1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/all-disabled/p.cabal23
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/benchmarks-disabled/cabal.project1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/benchmarks-disabled/p.cabal15
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/benchmarks-disabled/q/q.cabal10
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/complex/cabal.project1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/complex/q/Q.hs (renamed from cabal/cabal-install/tests/IntegrationTests/sandbox-sources/q/LICENSE)0
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/complex/q/q.cabal22
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/empty-pkg/cabal.project1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/empty-pkg/p.cabal5
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/empty/cabal.project1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/empty/foo.hs (renamed from cabal/cabal-install/tests/IntegrationTests/sandbox-sources/p/LICENSE)0
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/exes-disabled/cabal.project1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/exes-disabled/p/p.cabal9
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/exes-disabled/q/q.cabal9
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/libs-disabled/cabal.project1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/libs-disabled/p/p.cabal9
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/libs-disabled/q/q.cabal9
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/multiple-exes/cabal.project1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/multiple-exes/p.cabal12
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/multiple-libs/cabal.project1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/multiple-libs/p/p.cabal8
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/multiple-libs/q/q.cabal8
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/multiple-tests/cabal.project1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/multiple-tests/p.cabal14
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/simple/P.hs (renamed from cabal/cabal-install/tests/IntegrationTests/multiple-source/q/LICENSE)0
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/simple/cabal.project1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/simple/p.cabal12
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/simple/q/QQ.hs (renamed from cabal/cabal-install/tests/IntegrationTests/multiple-source/p/LICENSE)0
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/simple/q/q.cabal12
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/test-only/p.cabal9
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/tests-disabled/cabal.project1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/tests-disabled/p.cabal15
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/tests-disabled/q/q.cabal10
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/variety/cabal.project1
-rw-r--r--cabal/cabal-install/tests/IntegrationTests2/targets/variety/p.cabal27
-rw-r--r--cabal/cabal-install/tests/MemoryUsageTests.hs15
-rw-r--r--cabal/cabal-install/tests/SolverQuickCheck.hs2
-rw-r--r--cabal/cabal-install/tests/UnitTests.hs12
-rw-r--r--cabal/cabal-install/tests/UnitTests/Distribution/Client/ArbitraryInstances.hs1
-rw-r--r--cabal/cabal-install/tests/UnitTests/Distribution/Client/FileMonitor.hs15
-rw-r--r--cabal/cabal-install/tests/UnitTests/Distribution/Client/Glob.hs4
-rw-r--r--cabal/cabal-install/tests/UnitTests/Distribution/Client/InstallPlan.hs5
-rw-r--r--cabal/cabal-install/tests/UnitTests/Distribution/Client/ProjectConfig.hs406
-rw-r--r--cabal/cabal-install/tests/UnitTests/Distribution/Client/Sandbox/Timestamp.hs4
-rw-r--r--cabal/cabal-install/tests/UnitTests/Distribution/Client/Store.hs181
-rw-r--r--cabal/cabal-install/tests/UnitTests/Distribution/Client/Tar.hs4
-rw-r--r--cabal/cabal-install/tests/UnitTests/Distribution/Client/Targets.hs117
-rw-r--r--cabal/cabal-install/tests/UnitTests/Distribution/Solver/Modular/Builder.hs20
-rw-r--r--cabal/cabal-install/tests/UnitTests/Distribution/Solver/Modular/DSL.hs326
-rw-r--r--cabal/cabal-install/tests/UnitTests/Distribution/Solver/Modular/DSL/TestCaseUtils.hs248
-rw-r--r--cabal/cabal-install/tests/UnitTests/Distribution/Solver/Modular/MemoryUsage.hs97
-rw-r--r--cabal/cabal-install/tests/UnitTests/Distribution/Solver/Modular/PSQ.hs22
-rw-r--r--cabal/cabal-install/tests/UnitTests/Distribution/Solver/Modular/QuickCheck.hs225
-rw-r--r--cabal/cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs773
-rw-r--r--cabal/cabal-testsuite/LICENSE2
-rw-r--r--cabal/cabal-testsuite/PackageTests.hs329
-rw-r--r--cabal/cabal-testsuite/PackageTests/AllowNewer/AllowNewer.cabal2
-rw-r--r--cabal/cabal-testsuite/PackageTests/AllowNewer/Setup.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/AllowNewer/cabal.project (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/executable/cabal.project)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/AllowNewer/cabal.test.hs28
-rw-r--r--cabal/cabal-testsuite/PackageTests/AllowNewer/src/Foo.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/AllowOlder/AllowOlder.cabal2
-rw-r--r--cabal/cabal-testsuite/PackageTests/AllowOlder/Setup.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/AllowOlder/cabal.project (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/BuildToolsPath/cabal.project)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/AllowOlder/cabal.test.hs28
-rw-r--r--cabal/cabal-testsuite/PackageTests/Ambiguity/setup-package-import.cabal.out28
-rw-r--r--cabal/cabal-testsuite/PackageTests/Ambiguity/setup-package-import.out25
-rw-r--r--cabal/cabal-testsuite/PackageTests/Ambiguity/setup-package-import.test.hs11
-rw-r--r--cabal/cabal-testsuite/PackageTests/Ambiguity/setup-reexport.cabal.out38
-rw-r--r--cabal/cabal-testsuite/PackageTests/Ambiguity/setup-reexport.out34
-rw-r--r--cabal/cabal-testsuite/PackageTests/Ambiguity/setup-reexport.test.hs12
-rw-r--r--cabal/cabal-testsuite/PackageTests/AutogenModules/Package/Check.hs51
-rw-r--r--cabal/cabal-testsuite/PackageTests/AutogenModules/Package/setup.cabal.out22
-rw-r--r--cabal/cabal-testsuite/PackageTests/AutogenModules/Package/setup.out21
-rw-r--r--cabal/cabal-testsuite/PackageTests/AutogenModules/Package/setup.test.hs49
-rw-r--r--cabal/cabal-testsuite/PackageTests/AutogenModules/SrcDist/AutogenModules.cabal (renamed from cabal/cabal-testsuite/PackageTests/AutogenModules/SrcDist/my.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/AutogenModules/SrcDist/Check.hs104
-rw-r--r--cabal/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.cabal.out11
-rw-r--r--cabal/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.out9
-rw-r--r--cabal/cabal-testsuite/PackageTests/AutogenModules/SrcDist/setup.test.hs105
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Fail1/Fail1.cabal17
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Fail1/setup.cabal.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Fail1/setup.out7
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Fail1/setup.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Fail2/Fail2.cabal11
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Fail2/setup.cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Fail2/setup.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Fail2/setup.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Fail3/Fail3.cabal17
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Fail3/Main.hs (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/executable/Main.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Fail3/UnfilledSig.hsig1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Fail3/setup.cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Fail3/setup.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Fail3/setup.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes1/setup.cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes1/setup.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes1/setup.test.hs8
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/Includes2.cabal.fail (renamed from cabal/cabal-testsuite/PackageTests/Backpack/Includes2/fail.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-external-target.out9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-external-target.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-external.out43
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-external.test.hs9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal-target.out9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal-target.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.out43
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.test.hs9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/cabal.external.project (renamed from cabal/cabal-install/tests/IntegrationTests/backpack/includes2/cabal.project.external)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/cabal.internal.project (renamed from cabal/cabal-install/tests/IntegrationTests/custom/segfault/cabal.project)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.cabal.out120
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.out105
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.test.hs17
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal-fail.cabal.out16
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal-fail.out15
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal-fail.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.cabal.out46
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.out45
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/setup-internal.test.hs7
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.out110
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs16
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/Includes3.cabal2
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-external.out26
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-external.test.hs9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.out28
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.test.hs9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/cabal.external.project (renamed from cabal/cabal-install/tests/IntegrationTests/backpack/includes3/cabal.project.external)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/cabal.internal.project (renamed from cabal/cabal-install/tests/IntegrationTests/backpack/includes3/cabal.project.internal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/indef/indef.cabal1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-explicit.out32
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-explicit.test.hs7
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-fail.cabal.out24
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-fail.out22
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-fail.test.hs13
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.cabal.out83
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.out78
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.test.hs22
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.cabal.out45
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.out44
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/setup-internal.test.hs9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes3/sigs/sigs.cabal1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes4/setup.cabal.out40
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes4/setup.out39
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes4/setup.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes5/setup.cabal.out10
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes5/setup.out9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Includes5/setup.test.hs8
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Indef2/Indef2.cabal16
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Indef2/setup.cabal.out10
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Indef2/setup.out9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Indef2/setup.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.cabal.out24
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.out22
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Reexport1/setup.test.hs8
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Reexport2/Asdf.hsig1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Reexport2/Reexport2.cabal10
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Reexport2/cabal.out10
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Reexport2/cabal.project (renamed from cabal/cabal-install/tests/IntegrationTests/backpack/includes2/cabal.project.internal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Reexport2/cabal.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Reexport2/setup.cabal.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Reexport2/setup.out3
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/Reexport2/setup.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/T4447/A.hs (renamed from cabal/cabal-install/tests/IntegrationTests/regression/t2755/A.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/T4447/Main.hs2
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/T4447/T4447.cabal17
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/T4447/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/T4447/foo-indef/A.hsig1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/T4447/foo-indef/B.hs (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/T3460/sub-package-B/B.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/T4447/setup.cabal.out10
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/T4447/setup.out9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/T4447/setup.test.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/T4754/P.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/T4754/Sig.hsig1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/T4754/p.cabal15
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/T4754/pexe/PExe.hs2
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/T4754/setup.cabal.out13
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/T4754/setup.out12
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/T4754/setup.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/TemplateHaskell/A.hsig1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/TemplateHaskell/M.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/TemplateHaskell/bkpth.cabal14
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/TemplateHaskell/setup.cabal.out10
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/TemplateHaskell/setup.out9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Backpack/TemplateHaskell/setup.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/BenchmarkExeV10/setup.cabal.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/BenchmarkExeV10/setup.out7
-rw-r--r--cabal/cabal-testsuite/PackageTests/BenchmarkExeV10/setup.test.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/BenchmarkOptions/setup.cabal.out20
-rw-r--r--cabal/cabal-testsuite/PackageTests/BenchmarkOptions/setup.out15
-rw-r--r--cabal/cabal-testsuite/PackageTests/BenchmarkOptions/setup.test.hs9
-rw-r--r--cabal/cabal-testsuite/PackageTests/BenchmarkStanza/Check.hs29
-rw-r--r--cabal/cabal-testsuite/PackageTests/BenchmarkStanza/my.cabal3
-rw-r--r--cabal/cabal-testsuite/PackageTests/BenchmarkStanza/setup.cabal.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/BenchmarkStanza/setup.out3
-rw-r--r--cabal/cabal-testsuite/PackageTests/BenchmarkStanza/setup.test.hs27
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/DepCycle/DepCycle.cabal12
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/DepCycle/cabal.out7
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/DepCycle/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/DepCycle/cabal.test.hs7
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/DepCycle/setup.cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/DepCycle/setup.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/DepCycle/setup.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary0/setup.cabal.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary0/setup.out3
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary0/setup.test.hs8
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary1/cabal.out10
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary1/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary1/cabal.test.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary1/setup.cabal.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary1/setup.out7
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary1/setup.test.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary2/setup.cabal.out22
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary2/setup.out20
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary2/setup.test.hs9
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary3/setup.cabal.out22
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary3/setup.out20
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary3/setup.test.hs11
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary4/MyLibrary.hs10
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary4/my.cabal23
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary4/programs/lemon.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary4/to-install/MyLibrary.hs10
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary4/to-install/my.cabal18
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/SameDepsAllRound/setup.cabal.out10
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/SameDepsAllRound/setup.out9
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/SameDepsAllRound/setup.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/TargetSpecificDeps1/setup.cabal.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/TargetSpecificDeps1/setup.out7
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/TargetSpecificDeps1/setup.test.hs11
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/TargetSpecificDeps2/setup.cabal.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/TargetSpecificDeps2/setup.out7
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/TargetSpecificDeps2/setup.test.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/TargetSpecificDeps3/setup.cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/TargetSpecificDeps3/setup.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildDeps/TargetSpecificDeps3/setup.test.hs11
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargetErrors/setup.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargetErrors/setup.test.hs10
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackage/Main.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackage/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackage/pkg.cabal8
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackage/repo/pkg-1.0/pkg.cabal8
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackage/repo/pkg-2.0/pkg.cabal8
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackage/use-local-version-of-package.out19
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackage/use-local-version-of-package.test.hs15
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackageForSetup/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackageForSetup/pkg/Main.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackageForSetup/pkg/Setup.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackageForSetup/pkg/pkg.cabal12
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackageForSetup/repo/setup-dep-1.0/Module.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackageForSetup/repo/setup-dep-1.0/setup-dep.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackageForSetup/setup-dep/Module.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackageForSetup/setup-dep/setup-dep.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackageForSetup/use-local-package-as-setup-dep.out13
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackageForSetup/use-local-package-as-setup-dep.test.hs25
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildToolDepends/cabal.project2
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildToolDepends/client/Hello.hs8
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildToolDepends/client/client.cabal13
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildToolDepends/pre-proc/MyCustomPreprocessor.hs (renamed from cabal/cabal-testsuite/PackageTests/BuildToolsPath/MyCustomPreprocessor.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildToolDepends/pre-proc/pre-proc.cabal17
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildToolDepends/setup.out12
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildToolDepends/setup.test.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildToolDependsInternalMissing/Foo.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildToolDependsInternalMissing/setup.cabal.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildToolDependsInternalMissing/setup.out3
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildToolDependsInternalMissing/setup.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildToolDependsInternalMissing/tool-depends-missing.cabal13
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/External/cabal.out12
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/External/cabal.project (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/external_build_tools/cabal.project)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/External/cabal.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/External/client/Hello.hs (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/external_build_tools/client/Hello.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/External/client/client.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/external_build_tools/client/client.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/External/happy/MyCustomPreprocessor.hs (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/external_build_tools/happy/MyCustomPreprocessor.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/External/happy/happy.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/external_build_tools/happy/happy.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/Foreign/A.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/Foreign/build-tools-path-foreign.cabal20
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/Foreign/hello/Hello.hs (renamed from cabal/cabal-testsuite/PackageTests/BuildToolsPath/hello/Hello.hs)0
-rwxr-xr-xcabal/cabal-testsuite/PackageTests/BuildTools/Foreign/my-foreign-preprocessor3
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/Foreign/setup.cabal.out10
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/Foreign/setup.out9
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/Foreign/setup.test.hs15
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/Internal/A.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/Internal/MyCustomPreprocessor.hs (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/BuildToolsPath/MyCustomPreprocessor.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/Internal/cabal.out16
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/Internal/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/Internal/cabal.test.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/Internal/foo.cabal25
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/Internal/hello/Hello.hs (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/BuildToolsPath/hello/Hello.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/Internal/setup.cabal.out12
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/Internal/setup.out11
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildTools/Internal/setup.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildToolsPath/A.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildToolsPath/build-tools-path.cabal25
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildableField/setup.cabal.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildableField/setup.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/BuildableField/setup.test.hs8
-rw-r--r--cabal/cabal-testsuite/PackageTests/CMain/setup.cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/CMain/setup.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/CMain/setup.test.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/COnlyMain/foo.c6
-rw-r--r--cabal/cabal-testsuite/PackageTests/COnlyMain/my.cabal10
-rw-r--r--cabal/cabal-testsuite/PackageTests/COnlyMain/setup.cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/COnlyMain/setup.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/COnlyMain/setup.test.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/CaretOperator/Check.hs34
-rw-r--r--cabal/cabal-testsuite/PackageTests/CaretOperator/my.cabal4
-rw-r--r--cabal/cabal-testsuite/PackageTests/CaretOperator/setup.out2
-rw-r--r--cabal/cabal-testsuite/PackageTests/CaretOperator/setup.test.hs30
-rw-r--r--cabal/cabal-testsuite/PackageTests/Configure/setup.cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Configure/setup.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/Configure/setup.test.hs8
-rw-r--r--cabal/cabal-testsuite/PackageTests/ConfigureComponent/Exe/setup.cabal.out20
-rw-r--r--cabal/cabal-testsuite/PackageTests/ConfigureComponent/Exe/setup.out12
-rw-r--r--cabal/cabal-testsuite/PackageTests/ConfigureComponent/Exe/setup.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/ConfigureComponent/SubLib/setup-explicit-fail.out13
-rw-r--r--cabal/cabal-testsuite/PackageTests/ConfigureComponent/SubLib/setup-explicit-fail.test.hs11
-rw-r--r--cabal/cabal-testsuite/PackageTests/ConfigureComponent/SubLib/setup-explicit.out20
-rw-r--r--cabal/cabal-testsuite/PackageTests/ConfigureComponent/SubLib/setup-explicit.test.hs10
-rw-r--r--cabal/cabal-testsuite/PackageTests/ConfigureComponent/SubLib/setup.out20
-rw-r--r--cabal/cabal-testsuite/PackageTests/ConfigureComponent/SubLib/setup.test.hs11
-rw-r--r--cabal/cabal-testsuite/PackageTests/ConfigureComponent/Test/Test.cabal1
-rw-r--r--cabal/cabal-testsuite/PackageTests/ConfigureComponent/Test/setup.out29
-rw-r--r--cabal/cabal-testsuite/PackageTests/ConfigureComponent/Test/setup.test.hs11
-rw-r--r--cabal/cabal-testsuite/PackageTests/CopyComponent/Exe/myprog.cabal2
-rw-r--r--cabal/cabal-testsuite/PackageTests/CopyComponent/Exe/setup.cabal.out9
-rw-r--r--cabal/cabal-testsuite/PackageTests/CopyComponent/Exe/setup.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/CopyComponent/Exe/setup.test.hs7
-rw-r--r--cabal/cabal-testsuite/PackageTests/CopyComponent/Lib/p.cabal1
-rw-r--r--cabal/cabal-testsuite/PackageTests/CopyComponent/Lib/setup.cabal.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/CopyComponent/Lib/setup.out7
-rw-r--r--cabal/cabal-testsuite/PackageTests/CopyComponent/Lib/setup.test.hs7
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomDep/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomDep/cabal.test.hs10
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomDep/client/B.hs (renamed from cabal/cabal-install/tests/IntegrationTests/custom/custom_dep/client/B.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomDep/client/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/sandbox-sources/p/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomDep/client/client.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/custom/custom_dep/client/client.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomDep/custom/A.hs (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/T3460/sub-package-A/A.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomDep/custom/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/regression/t3199/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomDep/custom/custom.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/custom/custom_dep/custom/custom.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomDep/sandbox.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomDep/sandbox.test.hs16
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomPlain/A.hs (renamed from cabal/cabal-install/tests/IntegrationTests/custom/plain/A.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomPlain/Setup.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomPlain/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomPlain/cabal.test.hs9
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomPlain/plain.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/custom/plain/plain.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomPlain/setup.cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomPlain/setup.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomPlain/setup.test.hs10
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomPreProcess/setup.cabal.out12
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomPreProcess/setup.out11
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomPreProcess/setup.test.hs7
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomSegfault/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/custom/segfault/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomSegfault/cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomSegfault/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomSegfault/cabal.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomSegfault/plain.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/custom/segfault/plain.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomWithoutCabal/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/custom-setup/custom-setup-without-cabal/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomWithoutCabal/cabal.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomWithoutCabal/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomWithoutCabal/cabal.test.hs8
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomWithoutCabal/custom-setup-without-cabal.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomWithoutCabalDefaultMain/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/custom-setup/custom-setup-without-cabal-defaultMain/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomWithoutCabalDefaultMain/cabal.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomWithoutCabalDefaultMain/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomWithoutCabalDefaultMain/cabal.test.hs16
-rw-r--r--cabal/cabal-testsuite/PackageTests/CustomWithoutCabalDefaultMain/custom-setup-without-cabal-defaultMain.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/custom-setup/custom-setup-without-cabal-defaultMain/custom-setup-without-cabal-defaultMain.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/DeterministicAr/Check.hs85
-rw-r--r--cabal/cabal-testsuite/PackageTests/DeterministicAr/setup-default-ar.cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/DeterministicAr/setup-default-ar.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/DeterministicAr/setup-default-ar.test.hs13
-rw-r--r--cabal/cabal-testsuite/PackageTests/DeterministicAr/setup-old-ar-without-at-args.cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/DeterministicAr/setup-old-ar-without-at-args.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/DeterministicAr/setup-old-ar-without-at-args.test.hs13
-rw-r--r--cabal/cabal-testsuite/PackageTests/DuplicateModuleName/DuplicateModuleName.cabal2
-rw-r--r--cabal/cabal-testsuite/PackageTests/DuplicateModuleName/setup.cabal.out30
-rw-r--r--cabal/cabal-testsuite/PackageTests/DuplicateModuleName/setup.out21
-rw-r--r--cabal/cabal-testsuite/PackageTests/DuplicateModuleName/setup.test.hs12
-rw-r--r--cabal/cabal-testsuite/PackageTests/EmptyLib/setup.cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/EmptyLib/setup.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/EmptyLib/setup.test.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/Foo.hs (renamed from cabal/cabal-install/tests/IntegrationTests/exec/Foo.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/My.hs (renamed from cabal/cabal-install/tests/IntegrationTests/exec/My.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/T4049/UseLib.c9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/T4049/csrc/MyForeignLibWrapper.c23
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/T4049/my-foreign-lib.cabal19
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/T4049/sandbox.out12
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/T4049/sandbox.test.hs20
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/T4049/src/MyForeignLib/Hello.hs10
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/T4049/src/MyForeignLib/SomeBindings.hsc10
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/cabal.out10
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/cabal.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/legacy-autoconfigure.out1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/legacy-autoconfigure.test.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/legacy-no-args.out2
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/legacy-no-args.test.hs2
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/legacy.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/legacy.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/my.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/exec/my.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/sandbox-ghc-pkg.out16
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/sandbox-ghc-pkg.test.hs12
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/sandbox-hc-pkg.out16
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/sandbox-hc-pkg.test.hs25
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/sandbox-path.out16
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/sandbox-path.test.hs8
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/sandbox.out16
-rw-r--r--cabal/cabal-testsuite/PackageTests/Exec/sandbox.test.hs7
-rw-r--r--cabal/cabal-testsuite/PackageTests/ExecModern/Foo.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/ExecModern/My.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/ExecModern/cabal.out10
-rw-r--r--cabal/cabal-testsuite/PackageTests/ExecModern/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/ExecModern/cabal.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/ExecModern/my.cabal15
-rw-r--r--cabal/cabal-testsuite/PackageTests/ForeignLibs/Check.hs55
-rw-r--r--cabal/cabal-testsuite/PackageTests/ForeignLibs/my-foreign-lib.cabal14
-rw-r--r--cabal/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs84
-rw-r--r--cabal/cabal-testsuite/PackageTests/Freeze/disable-benchmarks.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/Freeze/disable-benchmarks.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Freeze/disable-tests.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/Freeze/disable-tests.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Freeze/dry-run.out2
-rw-r--r--cabal/cabal-testsuite/PackageTests/Freeze/dry-run.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Freeze/enable-benchmarks.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/Freeze/enable-benchmarks.test.hs7
-rw-r--r--cabal/cabal-testsuite/PackageTests/Freeze/enable-tests.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/Freeze/enable-tests.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Freeze/freeze.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/Freeze/freeze.test.hs10
-rw-r--r--cabal/cabal-testsuite/PackageTests/Freeze/my.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/freeze/my.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Freeze/repo/criterion-1.1.4.0/criterion.cabal8
-rw-r--r--cabal/cabal-testsuite/PackageTests/Freeze/repo/test-framework-0.8.1.1/test-framework.cabal8
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/setup.cabal.out2
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/setup.out3
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectory/setup.test.hs10
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/setup.cabal.out2
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/setup.out3
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryGhcVersion/setup.test.hs10
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/setup.cabal.out2
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/setup.out3
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/SameDirectoryVersion/setup.test.hs10
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/setup.cabal.out2
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/setup.out3
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/Symlink/setup.test.hs11
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/setup.cabal.out2
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/setup.out3
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkGhcVersion/setup.test.hs11
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/setup.cabal.out2
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/setup.out3
-rw-r--r--cabal/cabal-testsuite/PackageTests/GhcPkgGuess/SymlinkVersion/setup.test.hs11
-rw-r--r--cabal/cabal-testsuite/PackageTests/Haddock/setup.cabal.out7
-rw-r--r--cabal/cabal-testsuite/PackageTests/Haddock/setup.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Haddock/setup.test.hs11
-rw-r--r--cabal/cabal-testsuite/PackageTests/HaddockNewline/setup.cabal.out7
-rw-r--r--cabal/cabal-testsuite/PackageTests/HaddockNewline/setup.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/HaddockNewline/setup.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/Executable/foo.cabal1
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/Executable/setup-static.cabal.out36
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/Executable/setup-static.out34
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/Executable/setup-static.test.hs53
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/Library/setup.cabal.out23
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/Library/setup.out21
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/Library/setup.test.hs10
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/cabal-per-package.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/cabal-per-package.test.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/cabal.out16
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/cabal.project (renamed from cabal/cabal-install/tests/IntegrationTests/internal-libs/cabal.project)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/cabal.test.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/p/p.cabal1
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/sandbox-shadow.out18
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/sandbox-shadow.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/sandbox.out17
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/sandbox.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/setup-gen-pkg-config.cabal.out26
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/setup-gen-pkg-config.out24
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/setup-gen-pkg-config.test.hs24
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/setup-gen-script.cabal.out26
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/setup-gen-script.out24
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/setup-gen-script.test.hs15
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/setup-per-component.out29
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/setup-per-component.test.hs10
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/setup.cabal.out32
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/setup.out30
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalLibraries/setup.test.hs12
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildDependsBad/Foo.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildDependsBad/Main.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildDependsBad/build-depends-bad-version.cabal17
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildDependsBad/setup.cabal.out10
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildDependsBad/setup.out3
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildDependsBad/setup.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/Foo.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/Main.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/build-depends-extra-version.cabal17
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.cabal.out16
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.out15
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildDependsExtra/setup.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/Foo.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/Main.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/build-tool-depends-bad-version.cabal18
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/setup.cabal.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/setup.out3
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/setup.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/Foo.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/Main.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/build-tool-depends-extra-version.cabal18
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/setup.cabal.out16
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/setup.out15
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/setup.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/Foo.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/Main.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/build-tools-bad-version.cabal18
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/setup.cabal.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/setup.out3
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/setup.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/Foo.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/Main.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/build-tools-extra-version.cabal18
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/setup.cabal.out16
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/setup.out15
-rw-r--r--cabal/cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/setup.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Macros/macros.cabal2
-rw-r--r--cabal/cabal-testsuite/PackageTests/Macros/setup.cabal.out14
-rw-r--r--cabal/cabal-testsuite/PackageTests/Macros/setup.out13
-rw-r--r--cabal/cabal-testsuite/PackageTests/Macros/setup.test.hs7
-rw-r--r--cabal/cabal-testsuite/PackageTests/Manpage/cabal.out1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Manpage/cabal.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdBench/MultipleBenchmarks/Bar.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdBench/MultipleBenchmarks/Foo.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdBench/MultipleBenchmarks/MultipleBenchmarks.cabal17
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdBench/MultipleBenchmarks/cabal.out27
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdBench/MultipleBenchmarks/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdBench/MultipleBenchmarks/cabal.test.hs10
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdExec/GhcInvocation/Main.hs2
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdExec/GhcInvocation/cabal.out9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdExec/GhcInvocation/cabal.project2
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdExec/GhcInvocation/cabal.test.hs17
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdExec/GhcInvocation/inplace-dep/InplaceDep.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdExec/GhcInvocation/inplace-dep/inplace-dep.cabal10
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdExec/RunExe/Main.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdExec/RunExe/RunExe.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdExec/RunExe/cabal.out9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdExec/RunExe/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdExec/RunExe/cabal.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/bar/Main.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/bar/bar.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/cabal.out19
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/cabal.project3
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/cabal.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/foo/LibFoo.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/foo/Main.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/foo/data/hello.txt1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/foo/foo.cabal19
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/ExeAndLib/ExeAndLib.cabal14
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/ExeAndLib/Main.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/ExeAndLib/cabal.out10
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/ExeAndLib/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/ExeAndLib/cabal.test.hs8
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/ExitCodePropagation/ExitCodePropagation.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/ExitCodePropagation/Main.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/ExitCodePropagation/cabal.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/ExitCodePropagation/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/ExitCodePropagation/cabal.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/MultipleExes/Bar.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/MultipleExes/Foo.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/MultipleExes/MultipleExes.cabal15
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/MultipleExes/cabal.out21
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/MultipleExes/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/MultipleExes/cabal.test.hs11
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/MultiplePackages/bar/Main1.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/MultiplePackages/bar/Main2.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/MultiplePackages/bar/bar.cabal14
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/MultiplePackages/cabal.out37
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/MultiplePackages/cabal.project4
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/MultiplePackages/cabal.test.hs15
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/MultiplePackages/foo/Main1.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/MultiplePackages/foo/foo.cabal10
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/Single/Main.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/Single/Single.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/Single/cabal.out19
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/Single/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CmdRun/Single/cabal.test.hs14
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/LocalPackageWithCustomSetup/Setup.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/LocalPackageWithCustomSetup/build-local-package-with-custom-setup.out2
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/LocalPackageWithCustomSetup/build-local-package-with-custom-setup.test.hs11
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/LocalPackageWithCustomSetup/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/LocalPackageWithCustomSetup/pkg.cabal10
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/LocalPackageWithCustomSetup/repo/setup-dep-2.0/SetupDep.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/LocalPackageWithCustomSetup/repo/setup-dep-2.0/setup-dep.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/Main.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs15
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/pkg.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/repo/remote-pkg-2.0/RemotePkg.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/repo/remote-pkg-2.0/Setup.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/repo/remote-pkg-2.0/remote-pkg.cabal12
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/repo/remote-setup-dep-3.0/RemoteSetupDep.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/repo/remote-setup-dep-3.0/remote-setup-dep.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/MonitorCabalFiles/cabal.out20
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/MonitorCabalFiles/cabal.project (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/monitor_cabal_files/cabal.project)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/MonitorCabalFiles/cabal.test.hs8
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/MonitorCabalFiles/p/P.hs (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/monitor_cabal_files/p/P.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/MonitorCabalFiles/p/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/regression/t2755/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/MonitorCabalFiles/p/p.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/monitor_cabal_files/p/p.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/MonitorCabalFiles/q/Main.hs (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/monitor_cabal_files/q/Main.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/MonitorCabalFiles/q/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/monitor_cabal_files/q/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/MonitorCabalFiles/q/q-broken.cabal.in (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/monitor_cabal_files/q/q-broken.cabal.in)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/MonitorCabalFiles/q/q-fixed.cabal.in (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/monitor_cabal_files/q/q-fixed.cabal.in)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3460/C.hs (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/T3460/C.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3460/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/monitor_cabal_files/p/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3460/T3460.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/T3460/T3460.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3460/cabal.out0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3460/cabal.project (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/T3460/cabal.project)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3460/cabal.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3460/sub-package-A/A.hs (renamed from cabal/cabal-install/tests/IntegrationTests/custom/custom_dep/custom/A.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3460/sub-package-A/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/executable/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3460/sub-package-A/sub-package-A.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/T3460/sub-package-A/sub-package-A.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3460/sub-package-B/B.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3460/sub-package-B/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/T3460/sub-package-B/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3460/sub-package-B/sub-package-B.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/T3460/sub-package-B/sub-package-B.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3827/cabal.out12
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3827/cabal.project (renamed from cabal/cabal-install/tests/IntegrationTests/regression/t3827/cabal.project)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3827/cabal.test.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3827/p/P.hs (renamed from cabal/cabal-install/tests/IntegrationTests/regression/t3827/p/P.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3827/p/p.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3827/q/Main.hs (renamed from cabal/cabal-install/tests/IntegrationTests/regression/t3827/q/Main.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3827/q/q.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3978/cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3978/cabal.project (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/T4017/cabal.project)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3978/cabal.test.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3978/p/p.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/T3978/p/p.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T3978/q/q.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/T4017/q/q.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4017/cabal.out12
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4017/cabal.project (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/T3978/cabal.project)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4017/cabal.test.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4017/p/p.cabal8
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4017/q/q.cabal8
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4375/A.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4375/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/T3460/sub-package-A/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4375/a.cabal11
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4375/cabal.out17
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4375/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4375/cabal.test.hs11
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4375/repo/old-locale-1.0.0.7/System/Locale.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4375/repo/old-locale-1.0.0.7/old-locale.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4375/repo/old-time-1.1.0.3/System/Time.hs2
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4375/repo/old-time-1.1.0.3/old-time.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4405/cabal.out14
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4405/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4405/cabal.test.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4405/p/P.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4405/p/PTest.hs (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/executable/Test.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4405/p/p.cabal15
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4405/q/Q.hs2
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4405/q/q.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4450/A.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4450/Main.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4450/Setup.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4450/T4450.cabal17
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4450/cabal.out0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4450/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4450/cabal.test.hs7
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4450/dep/Dep.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4450/dep/dep.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4477/Main.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4477/T4477.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4477/cabal.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4477/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewBuild/T4477/cabal.test.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewConfigure/LocalConfigOverwrite/NewConfigure.cabal11
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewConfigure/LocalConfigOverwrite/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/new-build/T3460/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewConfigure/LocalConfigOverwrite/cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewConfigure/LocalConfigOverwrite/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewConfigure/LocalConfigOverwrite/cabal.project.local0
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewConfigure/LocalConfigOverwrite/cabal.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewFreeze/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewFreeze/my-local-package.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewFreeze/new_freeze.out29
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewFreeze/new_freeze.test.hs49
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewFreeze/repo/my-build-tool-dep-1.0/my-build-tool-dep.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewFreeze/repo/my-build-tool-dep-2.0/my-build-tool-dep.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewFreeze/repo/my-build-tool-dep-3.0/my-build-tool-dep.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/NewFreeze/repo/my-library-dep-1.0/my-library-dep.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Options.hs19
-rw-r--r--cabal/cabal-testsuite/PackageTests/OrderFlags/setup.cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/OrderFlags/setup.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/OrderFlags/setup.test.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/Outdated/cabal.config1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Outdated/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Outdated/cabal.project.freeze1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Outdated/my.cabal15
-rw-r--r--cabal/cabal-testsuite/PackageTests/Outdated/outdated.out16
-rw-r--r--cabal/cabal-testsuite/PackageTests/Outdated/outdated.test.hs26
-rw-r--r--cabal/cabal-testsuite/PackageTests/Outdated/outdated_freeze.out20
-rw-r--r--cabal/cabal-testsuite/PackageTests/Outdated/outdated_freeze.test.hs18
-rw-r--r--cabal/cabal-testsuite/PackageTests/Outdated/repo/base-3.0.3.1/base.cabal154
-rw-r--r--cabal/cabal-testsuite/PackageTests/Outdated/repo/base-3.0.3.2/base.cabal160
-rw-r--r--cabal/cabal-testsuite/PackageTests/Outdated/repo/base-4.0.0.0/base.cabal174
-rw-r--r--cabal/cabal-testsuite/PackageTests/Outdated/repo/template-haskell-2.3.0.0/template-haskell.cabal22
-rw-r--r--cabal/cabal-testsuite/PackageTests/Outdated/repo/template-haskell-2.3.0.1/template-haskell.cabal22
-rw-r--r--cabal/cabal-testsuite/PackageTests/Outdated/repo/template-haskell-2.4.0.0/template-haskell.cabal32
-rw-r--r--cabal/cabal-testsuite/PackageTests/PackageTester.hs832
-rw-r--r--cabal/cabal-testsuite/PackageTests/PathsModule/Executable/setup.cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/PathsModule/Executable/setup.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/PathsModule/Executable/setup.test.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/PathsModule/Library/setup.cabal.out6
-rw-r--r--cabal/cabal-testsuite/PackageTests/PathsModule/Library/setup.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/PathsModule/Library/setup.test.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/PreProcess/setup.cabal.out12
-rw-r--r--cabal/cabal-testsuite/PackageTests/PreProcess/setup.out11
-rw-r--r--cabal/cabal-testsuite/PackageTests/PreProcess/setup.test.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/PreProcessExtraSources/setup.cabal.out12
-rw-r--r--cabal/cabal-testsuite/PackageTests/PreProcessExtraSources/setup.out11
-rw-r--r--cabal/cabal-testsuite/PackageTests/PreProcessExtraSources/setup.test.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/dynamic/Exe.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/dynamic/Lib.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/dynamic/QQ.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/dynamic/my.cabal15
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/dynamic/setup.cabal.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/dynamic/setup.out7
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/dynamic/setup.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/profiling/Exe.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/profiling/Lib.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/profiling/QQ.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/profiling/my.cabal15
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/profiling/setup.cabal.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/profiling/setup.out7
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/profiling/setup.test.hs7
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/vanilla/Exe.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/vanilla/Lib.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/vanilla/QQ.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/vanilla/my.cabal15
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/vanilla/setup.cabal.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/vanilla/setup.out7
-rw-r--r--cabal/cabal-testsuite/PackageTests/QuasiQuotes/vanilla/setup.test.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/p/fail-ambiguous.cabal10
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/p/fail-missing.cabal10
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/p/fail-other.cabal12
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/p/p.cabal1
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/p/p.cabal.fail-ambiguous11
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/p/p.cabal.fail-missing11
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/p/p.cabal.fail-other13
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/setup-fail-ambiguous.cabal.out25
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/setup-fail-ambiguous.out23
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/setup-fail-ambiguous.test.hs9
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/setup-fail-missing.cabal.out10
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/setup-fail-missing.out9
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/setup-fail-missing.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/setup-fail-other.cabal.out10
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/setup-fail-other.out9
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/setup-fail-other.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/setup.cabal.out16
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/setup.out14
-rw-r--r--cabal/cabal-testsuite/PackageTests/ReexportedModules/setup.test.hs7
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T2755/A.hs1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T2755/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/multiple-source/q/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T2755/setup.cabal.out5
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T2755/setup.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T2755/setup.test.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T2755/test-t2755.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/regression/t2755/test-t2755.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T2971/q/q.cabal4
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T2971/setup.cabal.out17
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T2971/setup.out15
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T2971/setup.test.hs10
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T2971a/T2971a.cabal1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T2971a/setup.cabal.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T2971a/setup.out7
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T2971a/setup.test.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3199/Cabal/Cabal.cabal8
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3199/Main.hs (renamed from cabal/cabal-install/tests/IntegrationTests/regression/t3199/Main.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3199/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/multiple-source/p/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3199/sandbox.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3199/sandbox.test.hs11
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3199/test-3199.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/regression/t3199/test-3199.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3294/setup.cabal.out13
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3294/setup.out12
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3294/setup.test.hs14
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3436/Cabal-1.2/Cabal.cabal8
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3436/Cabal-1.2/CabalMessage.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3436/Cabal-2.0/Cabal.cabal8
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3436/Cabal-2.0/CabalMessage.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3436/cabal.out9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3436/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3436/cabal.test.hs8
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3436/custom-setup/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/custom-setup/custom-setup/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3436/custom-setup/custom-setup.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3436/sandbox.out22
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3436/sandbox.test.hs21
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3847/setup.cabal.out4
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3847/setup.out3
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3847/setup.test.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3932/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/custom-setup/custom-setup-old-cabal/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3932/cabal.out2
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3932/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3932/cabal.test.hs12
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3932/custom-setup-old-cabal.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/custom-setup/custom-setup-old-cabal/custom-setup-old-cabal.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T3932/repo/Cabal-1.18.0.0/Cabal.cabal6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4025/setup.cabal.out9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4025/setup.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4025/setup.test.hs13
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4154/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4154/install-time-with-constraint.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4154/install-time-with-constraint.test.hs15
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4154/repo/Cabal-99999/Cabal.cabal7
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4154/time.cabal10
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4202/cabal.out26
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4202/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4202/cabal.test.hs12
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4202/p/p.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4202/q/Q.hs2
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4202/q/q.cabal9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4270/Lib.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4270/T4270.cabal20
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4270/Test.hs17
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4270/setup.cabal.out18
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4270/setup.out13
-rw-r--r--cabal/cabal-testsuite/PackageTests/Regression/T4270/setup.test.hs10
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/MultipleSources/cabal.out12
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/MultipleSources/cabal.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/MultipleSources/p/LICENSE0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/MultipleSources/p/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/custom/custom_dep/custom/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/MultipleSources/p/p.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/sandbox-sources/p/p.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/MultipleSources/q/LICENSE0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/MultipleSources/q/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/custom/custom_dep/client/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/MultipleSources/q/q.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/sandbox-sources/q/q.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/Reinstall/p/Main.hs (renamed from cabal/cabal-install/tests/IntegrationTests/sandbox-reinstalls/p/Main.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/Reinstall/p/p.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/sandbox-reinstalls/p/p.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/Reinstall/q/Q.hs (renamed from cabal/cabal-install/tests/IntegrationTests/sandbox-reinstalls/q/Q.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/Reinstall/q/Q.hs.in24
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/Reinstall/q/q.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/sandbox-reinstalls/q/q.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/Reinstall/sandbox.out17
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/Reinstall/sandbox.test.hs9
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/Sources/p/LICENSE0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/Sources/p/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/backpack/includes3/sigs/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/Sources/p/p.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/multiple-source/p/p.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/Sources/q/LICENSE0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/Sources/q/Setup.hs (renamed from cabal/cabal-install/tests/IntegrationTests/backpack/includes3/indef/Setup.hs)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/Sources/q/q.cabal (renamed from cabal/cabal-install/tests/IntegrationTests/multiple-source/q/q.cabal)0
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/Sources/sandbox.out15
-rw-r--r--cabal/cabal-testsuite/PackageTests/Sandbox/Sources/sandbox.test.hs7
-rw-r--r--cabal/cabal-testsuite/PackageTests/TemplateHaskell/dynamic/setup.cabal.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/TemplateHaskell/dynamic/setup.out7
-rw-r--r--cabal/cabal-testsuite/PackageTests/TemplateHaskell/dynamic/setup.test.hs6
-rw-r--r--cabal/cabal-testsuite/PackageTests/TemplateHaskell/profiling/setup.cabal.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/TemplateHaskell/profiling/setup.out7
-rw-r--r--cabal/cabal-testsuite/PackageTests/TemplateHaskell/profiling/setup.test.hs7
-rw-r--r--cabal/cabal-testsuite/PackageTests/TemplateHaskell/vanilla/setup.cabal.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/TemplateHaskell/vanilla/setup.out7
-rw-r--r--cabal/cabal-testsuite/PackageTests/TemplateHaskell/vanilla/setup.test.hs3
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestNameCollision/child/child.cabal1
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestNameCollision/setup.cabal.out28
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestNameCollision/setup.out22
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestNameCollision/setup.test.hs11
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestOptions/setup.cabal.out24
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestOptions/setup.out19
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestOptions/setup.test.hs9
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestStanza/Check.hs28
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestStanza/my.cabal5
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestStanza/setup.cabal.out3
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestStanza/setup.out2
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestStanza/setup.test.hs23
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/Check.hs129
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal.out26
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal.project1
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal.test.hs4
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/setup-no-markup.cabal.out20
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/setup-no-markup.out16
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/setup-no-markup.test.hs16
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/setup-no-tix.cabal.out20
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/setup-no-tix.out15
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/setup-no-tix.test.hs27
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/setup-with-hpc.multitest.hs98
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/setup-with-hpc.out0
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/setup.cabal.out25
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/setup.out18
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/setup.test.hs7
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/LibV09/setup-deadlock.cabal.out18
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/LibV09/setup-deadlock.out14
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/LibV09/setup-deadlock.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/LibV09/setup.cabal.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/LibV09/setup.out7
-rw-r--r--cabal/cabal-testsuite/PackageTests/TestSuiteTests/LibV09/setup.test.hs5
-rw-r--r--cabal/cabal-testsuite/PackageTests/Tests.hs750
-rw-r--r--cabal/cabal-testsuite/PackageTests/UniqueIPID/setup.cabal.out12
-rw-r--r--cabal/cabal-testsuite/PackageTests/UniqueIPID/setup.out10
-rw-r--r--cabal/cabal-testsuite/PackageTests/UniqueIPID/setup.test.hs16
-rw-r--r--cabal/cabal-testsuite/PackageTests/UserConfig/cabal.out8
-rw-r--r--cabal/cabal-testsuite/PackageTests/UserConfig/cabal.test.hs13
-rw-r--r--cabal/cabal-testsuite/README.md363
-rw-r--r--cabal/cabal-testsuite/Test/Cabal/CheckArMetadata.hs88
-rw-r--r--cabal/cabal-testsuite/Test/Cabal/Monad.hs659
-rw-r--r--cabal/cabal-testsuite/Test/Cabal/Plan.hs87
-rw-r--r--cabal/cabal-testsuite/Test/Cabal/Prelude.hs927
-rw-r--r--cabal/cabal-testsuite/Test/Cabal/Run.hs72
-rw-r--r--cabal/cabal-testsuite/Test/Cabal/Script.hs104
-rw-r--r--cabal/cabal-testsuite/Test/Cabal/Server.hs437
-rw-r--r--cabal/cabal-testsuite/Test/Cabal/Workdir.hs30
-rw-r--r--cabal/cabal-testsuite/cabal-testsuite.cabal355
-rw-r--r--cabal/cabal-testsuite/main/cabal-tests.hs300
-rw-r--r--cabal/cabal-testsuite/tests/Setup.hs4
-rw-r--r--cabal/cabal-testsuite/tests/fail.out1
-rw-r--r--cabal/cabal-testsuite/tests/fail.test.hs21
-rw-r--r--cabal/cabal-testsuite/tests/ok.test.hs2
-rw-r--r--cabal/cabal-testsuite/tests/tests.cabal4
-rw-r--r--cabal/cabal.project11
-rw-r--r--cabal/cabal.project.meta1
-rw-r--r--cabal/cabal.project.travis9
-rw-r--r--cabal/generics-sop-lens.hs103
-rw-r--r--cabal/solver-benchmarks/HackageBenchmark.hs320
-rw-r--r--cabal/solver-benchmarks/LICENSE31
-rw-r--r--cabal/solver-benchmarks/README.md17
-rw-r--r--cabal/solver-benchmarks/main/hackage-benchmark.hs4
-rw-r--r--cabal/solver-benchmarks/solver-benchmarks.cabal60
-rw-r--r--cabal/solver-benchmarks/tests/HackageBenchmarkTest.hs89
-rw-r--r--cabal/stack.yaml45
-rw-r--r--cabal/travis-common.sh22
-rwxr-xr-xcabal/travis-deploy.sh2
-rwxr-xr-xcabal/travis-install.sh15
-rwxr-xr-xcabal/travis-meta.sh9
-rwxr-xr-xcabal/travis-script.sh166
-rw-r--r--cabal/travis/README.md82
-rw-r--r--cabal/travis/binaries/.travis.yml33
-rw-r--r--cabal/travis/binaries/travis-cleanup.sh8
-rwxr-xr-xcabal/travis/binaries/travis-test.sh42
-rw-r--r--cabal/travis/id_rsa27
-rw-r--r--cabal/travis/id_rsa.pub1
-rwxr-xr-xcabal/travis/upload.sh94
-rwxr-xr-xcabal/update-cabal-files.sh1
-rw-r--r--hackage-security/.travis.yml145
-rw-r--r--hackage-security/cabal.project15
-rw-r--r--hackage-security/hackage-repo-tool/hackage-repo-tool.cabal8
-rw-r--r--hackage-security/hackage-root-tool/hackage-root-tool.cabal2
-rw-r--r--hackage-security/hackage-security-http-client/hackage-security-http-client.cabal2
-rw-r--r--hackage-security/hackage-security-http-client/src/Hackage/Security/Client/Repository/HttpLib/HttpClient.hs30
-rw-r--r--hackage-security/hackage-security/hackage-security.cabal23
-rw-r--r--hackage-security/hackage-security/src/Text/JSON/Canonical.hs8
-rw-r--r--hackage-security/hackage-security/tests/TestSuite.hs18
-rw-r--r--hackage-security/stack.yaml15
-rw-r--r--hackport.cabal14
1382 files changed, 44886 insertions, 19993 deletions
diff --git a/HackPort/GlobalFlags.hs b/HackPort/GlobalFlags.hs
index 0a4b284..9fc364c 100644
--- a/HackPort/GlobalFlags.hs
+++ b/HackPort/GlobalFlags.hs
@@ -6,6 +6,7 @@ module HackPort.GlobalFlags
import qualified Distribution.Verbosity as DV
import qualified Distribution.Simple.Setup as DSS
+import qualified Distribution.Client.Config as DCC
import qualified Distribution.Client.GlobalFlags as DCG
import qualified Distribution.Client.Types as DCT
import qualified Distribution.Utils.NubList as DUN
@@ -32,7 +33,7 @@ defaultGlobalFlags =
}
defaultRemoteRepo :: DCT.RemoteRepo
-defaultRemoteRepo = (DCT.emptyRemoteRepo name) { DCT.remoteRepoURI = uri }
+defaultRemoteRepo = DCC.addInfoForKnownRepos $ (DCT.emptyRemoteRepo name) { DCT.remoteRepoURI = uri }
where
Just uri = NU.parseURI "https://hackage.haskell.org/"
name = "hackage.haskell.org"
diff --git a/Main.hs b/Main.hs
index 7e8324d..ee98ef7 100644
--- a/Main.hs
+++ b/Main.hs
@@ -21,8 +21,9 @@ import qualified Distribution.Package as Cabal
import Distribution.Verbosity (Verbosity, normal)
import Distribution.Text (display, simpleParse)
-import Distribution.Client.Types
-import Distribution.Client.Update
+import qualified Distribution.Client.Setup as CabalInstall
+import qualified Distribution.Client.Types as CabalInstall
+import qualified Distribution.Client.Update as CabalInstall
import qualified Distribution.Client.IndexUtils as CabalInstall
import qualified Distribution.Solver.Types.SourcePackage as CabalInstall
@@ -94,7 +95,7 @@ listAction flags extraArgs globalFlags = do
let verbosity = fromFlag (listVerbosity flags)
H.withHackPortContext verbosity globalFlags $ \repoContext -> do
overlayPath <- getOverlayPath verbosity (fromFlag $ H.globalPathToOverlay globalFlags)
- index <- fmap packageIndex (CabalInstall.getSourcePackages verbosity repoContext)
+ index <- fmap CabalInstall.packageIndex (CabalInstall.getSourcePackages verbosity repoContext)
overlay <- Overlay.loadLazy overlayPath
let pkgs | null extraArgs = CabalInstall.allPackages index
| otherwise = concatMap (concatMap snd . CabalInstall.searchByNameSubstring index) extraArgs
@@ -221,7 +222,11 @@ updateAction flags extraArgs globalFlags = do
let verbosity = fromFlag (updateVerbosity flags)
H.withHackPortContext verbosity globalFlags $ \repoContext ->
- update verbosity repoContext
+ -- TODO: parse user's flags as cabal-iinstall does.
+ -- Currently I'm lazy to adapt new flag and user:
+ -- defaultUpdateFlags
+ let updateFlags = commandDefaultFlags CabalInstall.updateCommand
+ in CabalInstall.update verbosity updateFlags repoContext
-----------------------------------------------------------------------
-- Status
@@ -378,7 +383,7 @@ globalCommand = CommandUI {
++ "\n"
++ "Advanced usage:\n"
++ concat [ " " ++ pname ++ " " ++ x ++ "\n"
- | x <- ["update", "make-ebuild <ebuild.name> <CATEGORY>"]],
+ | x <- ["update", "make-ebuild <CATEGORY> <ebuild.name>"]],
commandNotes = Nothing,
commandUsage = \pname -> "Usage: " ++ pname ++ " [GLOBAL FLAGS] [COMMAND [FLAGS]]\n",
diff --git a/Merge.hs b/Merge.hs
index aa22003..a2bf6bf 100644
--- a/Merge.hs
+++ b/Merge.hs
@@ -156,6 +156,9 @@ merge verbosity repoContext args overlayPath users_cabal_flags = do
first_just_of :: [Maybe a] -> Maybe a
first_just_of = msum
+-- used to be FlagAssignment in Cabal but now it's an opaque type
+type CabalFlags = [(Cabal.FlagName, Bool)]
+
mergeGenericPackageDescription :: Verbosity -> FilePath -> Portage.Category -> Cabal.GenericPackageDescription -> Bool -> Maybe String -> IO ()
mergeGenericPackageDescription verbosity overlayPath cat pkgGenericDesc fetch users_cabal_flags = do
overlay <- Overlay.loadLazy overlayPath
@@ -166,7 +169,7 @@ mergeGenericPackageDescription verbosity overlayPath cat pkgGenericDesc fetch us
let requested_cabal_flags = first_just_of [users_cabal_flags, EM.cabal_flags existing_meta]
-- accepts things, like: "cabal_flag:iuse_name", "+cabal_flag", "-cabal_flag"
- read_fas :: Maybe String -> (Cabal.FlagAssignment, [(String, String)])
+ read_fas :: Maybe String -> (CabalFlags, [(String, String)])
read_fas Nothing = ([], [])
read_fas (Just user_fas_s) = (user_fas, user_renames)
where user_fas = [ (cf, b)
@@ -194,7 +197,7 @@ mergeGenericPackageDescription verbosity overlayPath cat pkgGenericDesc fetch us
(user_specified_fas, cf_to_iuse_rename) = read_fas requested_cabal_flags
debug verbosity "searching for minimal suitable ghc version"
- (compiler_info, ghc_packages, pkgDesc0, _flags, pix) <- case GHCCore.minimumGHCVersionToBuildPackage pkgGenericDesc user_specified_fas of
+ (compiler_info, ghc_packages, pkgDesc0, _flags, pix) <- case GHCCore.minimumGHCVersionToBuildPackage pkgGenericDesc (Cabal.mkFlagAssignment user_specified_fas) of
Just v -> return v
Nothing -> let pn = display merged_cabal_pkg_name
cn = display cat
@@ -210,7 +213,7 @@ mergeGenericPackageDescription verbosity overlayPath cat pkgGenericDesc fetch us
pkgDesc = pkgDesc0 { Cabal.buildDepends = accepted_deps }
cabal_flag_descs = Cabal.genPackageFlags pkgGenericDesc
all_flags = map Cabal.flagName cabal_flag_descs
- make_fas :: [Cabal.Flag] -> [Cabal.FlagAssignment]
+ make_fas :: [Cabal.Flag] -> [CabalFlags]
make_fas [] = [[]]
make_fas (f:rest) = [ (fn, is_enabled) : fas
| fas <- make_fas rest
@@ -220,10 +223,10 @@ mergeGenericPackageDescription verbosity overlayPath cat pkgGenericDesc fetch us
(\b -> [b])
users_choice
]
- all_possible_flag_assignments :: [Cabal.FlagAssignment]
+ all_possible_flag_assignments :: [CabalFlags]
all_possible_flag_assignments = make_fas cabal_flag_descs
- pp_fa :: Cabal.FlagAssignment -> String
+ pp_fa :: CabalFlags -> String
pp_fa fa = L.intercalate ", " [ (if b then '+' else '-') : f
| (cabal_f, b) <- fa
, let f = Cabal.unFlagName cabal_f
@@ -237,10 +240,12 @@ mergeGenericPackageDescription verbosity overlayPath cat pkgGenericDesc fetch us
Just ein -> ein
-- key idea is to generate all possible list of flags
- deps1 :: [(Cabal.FlagAssignment, Merge.EDep)]
- deps1 = [ (f `updateFa` fr, cabal_to_emerge_dep pkgDesc_filtered_bdeps)
+ deps1 :: [(CabalFlags, Merge.EDep)]
+ deps1 = [ ( f `updateFa` Cabal.unFlagAssignment fr
+ , cabal_to_emerge_dep pkgDesc_filtered_bdeps)
| f <- all_possible_flag_assignments
- , Right (pkgDesc1,fr) <- [GHCCore.finalizePackageDescription f
+ -- TODO: move from 'finalizePackageDescription' to 'finalizePD'
+ , Right (pkgDesc1,fr) <- [GHCCore.finalizePackageDescription (Cabal.mkFlagAssignment f)
(GHCCore.dependencySatisfiable pix)
GHCCore.platform
compiler_info
@@ -253,7 +258,7 @@ mergeGenericPackageDescription verbosity overlayPath cat pkgGenericDesc fetch us
, let pkgDesc_filtered_bdeps = pkgDesc1 { Cabal.buildDepends = ad }
]
where
- updateFa :: Cabal.FlagAssignment -> Cabal.FlagAssignment -> Cabal.FlagAssignment
+ updateFa :: CabalFlags -> CabalFlags -> CabalFlags
updateFa [] _ = []
updateFa (x:xs) y = case lookup (fst x) y of
-- TODO: when does this code get triggered?
@@ -270,7 +275,7 @@ mergeGenericPackageDescription verbosity overlayPath cat pkgGenericDesc fetch us
-- if flag(foo)
-- ghc-options: -O2
(irrelevant_flags, deps1') = L.foldl' drop_irrelevant ([], deps1) active_flags
- where drop_irrelevant :: ([Cabal.FlagName], [(Cabal.FlagAssignment, Merge.EDep)]) -> Cabal.FlagName -> ([Cabal.FlagName], [(Cabal.FlagAssignment, Merge.EDep)])
+ where drop_irrelevant :: ([Cabal.FlagName], [(CabalFlags, Merge.EDep)]) -> Cabal.FlagName -> ([Cabal.FlagName], [(CabalFlags, Merge.EDep)])
drop_irrelevant (ifs, ds) f =
case fenabled_ds' == fdisabled_ds' of
True -> (f:ifs, fenabled_ds')
@@ -278,10 +283,10 @@ mergeGenericPackageDescription verbosity overlayPath cat pkgGenericDesc fetch us
where (fenabled_ds', fdisabled_ds') = ( L.sort $ map drop_f fenabled_ds
, L.sort $ map drop_f fdisabled_ds
)
- drop_f :: (Cabal.FlagAssignment, Merge.EDep) -> (Cabal.FlagAssignment, Merge.EDep)
+ drop_f :: (CabalFlags, Merge.EDep) -> (CabalFlags, Merge.EDep)
drop_f (fas, d) = (filter ((f /=) . fst) fas, d)
(fenabled_ds, fdisabled_ds) = L.partition is_fe ds
- is_fe :: (Cabal.FlagAssignment, Merge.EDep) -> Bool
+ is_fe :: (CabalFlags, Merge.EDep) -> Bool
is_fe (fas, _d) =
case lookup f fas of
Just v -> v
@@ -293,7 +298,7 @@ mergeGenericPackageDescription verbosity overlayPath cat pkgGenericDesc fetch us
]
-- and finally prettify all deps:
- leave_only_dynamic_fa :: Cabal.FlagAssignment -> Cabal.FlagAssignment
+ leave_only_dynamic_fa :: CabalFlags -> CabalFlags
leave_only_dynamic_fa fa = filter (\(fn, _) -> all (fn /=) irrelevant_flags) $ fa L.\\ common_fa
-- build roughly balanced complete dependency tree instead of skewed one
@@ -310,12 +315,12 @@ mergeGenericPackageDescription verbosity overlayPath cat pkgGenericDesc fetch us
tdeps :: Merge.EDep
tdeps = bimerge $ map set_fa_to_ed deps1'
- set_fa_to_ed :: (Cabal.FlagAssignment, Merge.EDep) -> Merge.EDep
+ set_fa_to_ed :: (CabalFlags, Merge.EDep) -> Merge.EDep
set_fa_to_ed (fa, ed) = ed { Merge.rdep = liftFlags (leave_only_dynamic_fa fa) $ Merge.rdep ed
, Merge.dep = liftFlags (leave_only_dynamic_fa fa) $ Merge.dep ed
}
- liftFlags :: Cabal.FlagAssignment -> Portage.Dependency -> Portage.Dependency
+ liftFlags :: CabalFlags -> Portage.Dependency -> Portage.Dependency
liftFlags fs e = let k = foldr (\(y,b) x -> Portage.mkUseDependency (b, Portage.Use . cfn_to_iuse . Cabal.unFlagName $ y) . x)
id fs
in k e
@@ -355,7 +360,7 @@ mergeGenericPackageDescription verbosity overlayPath cat pkgGenericDesc fetch us
map ('\t':) conf_args
-- returns list USE-parameters to './setup configure'
- selected_flags :: ([Cabal.FlagName], Cabal.FlagAssignment) -> [String]
+ selected_flags :: ([Cabal.FlagName], CabalFlags) -> [String]
selected_flags ([], []) = []
selected_flags (active_fns, users_fas) = map snd (L.sortBy (compare `on` fst) flag_pairs)
where flag_pairs :: [(String, String)]
diff --git a/Merge/Dependencies.hs b/Merge/Dependencies.hs
index 1f6afc9..807b3c9 100644
--- a/Merge/Dependencies.hs
+++ b/Merge/Dependencies.hs
@@ -14,6 +14,8 @@ import qualified Distribution.Package as Cabal
import qualified Distribution.PackageDescription as Cabal
import qualified Distribution.Version as Cabal
import qualified Distribution.Text as Cabal
+import qualified Distribution.Types.LegacyExeDependency as Cabal
+import qualified Distribution.Types.PkgconfigDependency as Cabal
import qualified Distribution.Compiler as Cabal
diff --git a/Portage/Cabal.hs b/Portage/Cabal.hs
index ff02f5a..7f17d27 100644
--- a/Portage/Cabal.hs
+++ b/Portage/Cabal.hs
@@ -1,26 +1,14 @@
module Portage.Cabal
- ( fromOverlay
- , convertLicense
+ ( convertLicense
, partition_depends
) where
import qualified Data.List as L
-import qualified Data.Map as Map
-import qualified Distribution.Simple.PackageIndex as Cabal
import qualified Distribution.License as Cabal
import qualified Distribution.Package as Cabal
import qualified Distribution.Text as Cabal
-import qualified Portage.Overlay as Portage
-
-fromOverlay :: Portage.Overlay -> Cabal.PackageIndex Portage.ExistingEbuild
-fromOverlay overlay = Cabal.fromList $
- [ ebuild
- | (_pn, ebuilds) <- Map.toAscList (Portage.overlayMap overlay)
- , ebuild <- ebuilds
- ]
-
-- map the cabal license type to the gentoo license string format
convertLicense :: Cabal.License -> Either String String
convertLicense l =
diff --git a/cabal/.mailmap b/cabal/.mailmap
index 6bb714a..f4f867c 100644
--- a/cabal/.mailmap
+++ b/cabal/.mailmap
@@ -7,12 +7,12 @@
Adam Langley <agl@imperialviolet.org>
Alistair Bailey <alistair@abayley.org> alistair <alistair@abayley.org>
Alson Kemp <alson@alsonkemp.com> alson <alson@alsonkemp.com>
-Andy Craze <accraze@gmail.com>
Andres Löh <andres.loeh@gmail.com>
Andres Löh <andres.loeh@gmail.com> <andres@cs.uu.nl>
Andres Löh <andres.loeh@gmail.com> <andres@well-typed.com>
Andres Löh <andres.loeh@gmail.com> <ksgithub@andres-loeh.de>
Andres Löh <andres.loeh@gmail.com> <mail@andres-loeh.de>
+Andy Craze <accraze@gmail.com>
Audrey Tang <audreyt@audreyt.org> audreyt <audreyt@audreyt.org>
Austin Seipp <aseipp@pobox.com>
Austin Seipp <aseipp@pobox.com> <aseipp@well-typed.com>
@@ -30,10 +30,12 @@ Bram Schuur <bramschuur@gmail.com>
Brendan Hay <brendan.g.hay@gmail.com> <brendanhay@users.noreply.github.com>
Brent Yorgey <byorgey@gmail.com> <byorgey@cis.upenn.edu>
Brian Smith <brianlsmith@gmail.com> brianlsmith <brianlsmith@gmail.com>
+Daniel Wagner <daniel@wagner-home.com> <dmwit@galois.com>
David Himmelstrup <lemmih@gmail.com>
David Luposchainsky <dluposchainsky@gmail.com> <quchen@users.noreply.github.com>
David Waern <davve@dtek.chalmers.se> David Waern <unknown>
Dennis Gosnell <cdep.illabout@gmail.com>
+Don Stewart <dons00@gmail.com> <dons@galois.com>
Duncan Coutts <duncan@community.haskell.org>
Duncan Coutts <duncan@community.haskell.org> <Duncan Coutts duncan@community.haskell.org>
Duncan Coutts <duncan@community.haskell.org> <duncan.coutts@worc.ox.ac.uk>
@@ -44,6 +46,7 @@ Duncan Coutts <duncan@community.haskell.org> unknown <unkn
Edward Z. Yang <ezyang@cs.stanford.edu> <ezyang@mit.edu>
Einar Karttunen <ekarttun@cs.helsinki.fi>
Federico Mastellone <fmaste@users.noreply.github.com>
+Francesco Gazzetta <francygazz@gmail.com> <fgaz@users.noreply.github.com>
Ganesh Sittampalam <ganesh.sittampalam@credit-suisse.com> <ganesh@earth.li>
Geoff Nixon <geoff-codes@users.noreply.github.com> <geoff.nixon@aol.com>
Gershom Bazerman <gershomb@gmail.com>
@@ -70,16 +73,20 @@ Jens Petersen <juhpetersen@gmail.com> <petersen@red
Jeremy Shaw <jeremy.shaw@linspireinc.com>
Jeremy Shaw <jeremy.shaw@linspireinc.com> <jeremy@n-heptane.com>
Jim Burton <jim@sdf-eu.org>
+Joel Bitrauser <jo.da@posteo.de> <bitrauser@users.noreply.github.com>
+Joel Bitrauser <jo.da@posteo.de> Bitrauser <jo.da@posteo.de>
Joe Quinn <headprogrammingczar@gmail.com>
Joel Stanley <intractable@gmail.com>
Joeri van Eekelen <tchakkazulu@gmail.com>
John D. Ramsdell <ramsdell@mitre.org>
John Dias <dias@eecs.harvard.edu> dias <dias@eecs.harvard.edu>
+John Ericson <Ericson2314@yahoo.com> <Ericson2314@Yahoo.con>
+John Ericson <Ericson2314@yahoo.com> <jericson@galois.com>
Josh Hoyt <josh.hoyt@galois.com>
Judah Jacobson <judah.jacobson@gmail.com>
Jürgen Nicklisch-Franken <jnf@arcor.de>
-Ken Bateman <novadenizen@gmail.com>
Keegan McAllister <mcallister.keegan@gmail.com> mcallister.keegan <mcallister.keegan@gmail.com>
+Ken Bateman <novadenizen@gmail.com>
Kido Takahiro <shelarcy@gmail.com>
Krasimir Angelov <kr.angelov@gmail.com>
Krasimir Angelov <kr.angelov@gmail.com> ka2_mail <ka2_mail@yahoo.com>
@@ -91,6 +98,7 @@ Malcolm Wallace <Malcolm.Wallace@me.com> Malcolm.Walla
Mark Weber <marco-oweber@gmx.de> marco-oweber <marco-oweber@gmx.de>
Martin Sjögren <msjogren@gmail.com> md9ms <md9ms@mdstud.chalmers.se>
Mikhail Glushenkov <mikhail.glushenkov@gmail.com> <c05mgv@cs.umu.se>
+Mikhail Glushenkov <mikhail.glushenkov@gmail.com> <mikhail@scrive.com>
Mikhail Glushenkov <mikhail.glushenkov@gmail.com> <the.dead.shall.rise@gmail.com>
Neil Mitchell <ndmitchell@gmail.com> Neil Mitchell <unknown>
Niklas Broberg <niklas.broberg@gmail.com> <d00nibro@chalmers.se>
@@ -98,8 +106,11 @@ Niklas Broberg <niklas.broberg@gmail.com> <git@nand.wak
Peter Higley <phigley@gmail.com>
Peter Simons <simons@cryp.to>
Peter Trško <peter.trsko@gmail.com> Peter Trsko <peter.trsko@ixperta.com>
+Philipp Schumann <philipp.schumann@gmail.com> metaleap <philipp.schumann@gmail.com>
Philipp Schuster <pschuster@uni-koblenz.de>
Randy Polen <randen@users.noreply.github.com>
+Robert Henderson <rob@robjhen.com> <rob at robjhen dot com>
+Robert Henderson <rob@robjhen.com> <robjhen@users.noreply.github.com>
Ryan Scott <ryan.gl.scott@gmail.com> <ryan.gl.scott@ku.edu>
Samuel Gélineau <gelisam+github@gmail.com>
Sergei Trofimovich <slyfox@community.haskell.org> <slyfox@gentoo.org>
diff --git a/cabal/.travis.yml b/cabal/.travis.yml
index 770a53b..d5a5831 100644
--- a/cabal/.travis.yml
+++ b/cabal/.travis.yml
@@ -2,6 +2,8 @@
# We specify language: c, so it doesn't default to e.g. ruby
language: c
+dist: trusty
+
sudo: false
# Remember to add release branches
@@ -9,6 +11,7 @@ sudo: false
branches:
only:
- master
+ - "2.0"
- "1.24"
- "1.22"
- "1.20"
@@ -17,56 +20,68 @@ branches:
# The following enables several GHC versions to be tested; often it's enough to
# test only against the last release in a major GHC version. Feel free to omit
# lines listings versions you don't need/want testing for.
+#
+# NB: If you test the same GHC version/OS combo multiple times with
+# SCRIPT=script (e.g., see PARSEC=YES below), you MUST supply a
+# TAGSUFFIX to help travis/upload.sh disambiguate the matrix entry.
matrix:
include:
- - env: GHCVER=8.0.1 SCRIPT=meta BUILDER=none
+ - env: GHCVER=8.2.1 SCRIPT=meta BUILDER=none
os: linux
sudo: required
# These don't have -dyn/-prof whitelisted yet, so we have to
# do the old-style installation
- - env: GHCVER=7.4.2 SCRIPT=script CABAL_LIB_ONLY=YES
+ - env: GHCVER=7.4.2 SCRIPT=script CABAL_LIB_ONLY=YES TEST_OTHER_VERSIONS=YES
os: linux
sudo: required
- env: GHCVER=7.6.3 SCRIPT=script
os: linux
sudo: required
- - env: GHCVER=7.8.4 SCRIPT=script
+ - env: GHCVER=7.8.4 SCRIPT=script USE_GOLD=YES
os: linux
sudo: required
# Ugh, we'd like to drop 'sudo: required' and use the
# apt plugin for the next two
# but the GCE instance we get has more memory, which makes
# a big difference
- - env: GHCVER=7.10.3 SCRIPT=script
+ - env: GHCVER=7.10.3 SCRIPT=script USE_GOLD=YES
os: linux
sudo: required
- - env: GHCVER=8.0.1 SCRIPT=script DEPLOY_DOCS=YES TEST_OTHER_VERSIONS=YES
+ - env: GHCVER=8.0.2 SCRIPT=script DEPLOY_DOCS=YES USE_GOLD=YES TEST_SOLVER_BENCHMARKS=YES
sudo: required
os: linux
- - env: GHCVER=8.0.1 SCRIPT=solver-debug-flags
+
+ - env: GHCVER=8.0.2 SCRIPT=solver-debug-flags USE_GOLD=YES
sudo: required
os: linux
- - env: GHCVER=8.0.1 SCRIPT=script PARSEC=YES TEST_OTHER_VERSIONS=YES
+ - env: GHCVER=8.0.2 SCRIPT=script DEBUG_EXPENSIVE_ASSERTIONS=YES TAGSUFFIX="-fdebug-expensive-assertions" USE_GOLD=YES
os: linux
sudo: required
- - env: GHCVER=8.0.1 SCRIPT=bootstrap
+ - env: GHCVER=8.0.2 SCRIPT=bootstrap USE_GOLD=YES
sudo: required
os: linux
+ - env: GHCVER=8.2.2 SCRIPT=bootstrap USE_GOLD=YES
+ sudo: required
+ os: linux
+ - env: GHCVER=8.2.1 SCRIPT=script
+ os: linux
+ sudo: required
# We axed GHC 7.6 and earlier because it's not worth the trouble to
# make older GHC work with clang's cpp. See
# https://ghc.haskell.org/trac/ghc/ticket/8493
- env: GHCVER=7.8.4 SCRIPT=script
os: osx
+ # Keep this synced with travis/upload.sh
osx_image: xcode6.4 # We need 10.10
# TODO: We might want to specify OSX version
# https://docs.travis-ci.com/user/osx-ci-environment/#OS-X-Version
- env: GHCVER=7.10.3 SCRIPT=script
os: osx
- - env: GHCVER=8.0.1 SCRIPT=script
+ - env: GHCVER=8.0.2 SCRIPT=script
os: osx
- - env: GHCVER=8.0.1 SCRIPT=bootstrap
+ - env: GHCVER=8.0.2 SCRIPT=bootstrap
os: osx
- env: GHCVER=via-stack SCRIPT=stack STACKAGE_RESOLVER=lts
@@ -90,17 +105,14 @@ before_install:
- export PATH=$HOME/bin:$PATH
- export PATH=$HOME/.cabal/bin:$PATH
- export PATH=$HOME/.local/bin:$PATH
- - export PATH=/opt/cabal/1.24/bin:$PATH
+ - export PATH=/opt/cabal/2.0/bin:$PATH
- export PATH=/opt/happy/1.19.5/bin:$PATH
- export PATH=/opt/alex/3.1.7/bin:$PATH
+ - if [ "$USE_GOLD" = "YES" ]; then sudo update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 20; fi
+ - if [ "$USE_GOLD" = "YES" ]; then sudo update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.bfd" 10; fi
+ - ld -v
- ./travis-install.sh
- # Set up deployment to the haskell/cabal-website repo.
- # NB: these commands MUST be in .travis.yml, otherwise the secret key can be
- # leaked! See https://github.com/travis-ci/travis.rb/issues/423.
- # umask to get the permissions to be 400.
- - if [ "x$TRAVIS_REPO_SLUG" = "xhaskell/cabal" -a "x$TRAVIS_PULL_REQUEST" = "xfalse" -a "x$TRAVIS_BRANCH" = "xmaster" -a "x$DEPLOY_DOCS" = "xYES" ]; then (umask 377 && openssl aes-256-cbc -K $encrypted_edaf6551664d_key -iv $encrypted_edaf6551664d_iv -in id_rsa_cabal_website.aes256.enc -out ~/.ssh/id_rsa -d); fi
-
install:
# We intentionally do not install anything before trying to build Cabal because
# it should build with each supported GHC version out-of-the-box.
@@ -110,7 +122,8 @@ install:
# ./dist/setup/setup here instead of cabal-install to avoid breakage when the
# build config format changed.
script:
- - ./travis-${SCRIPT}.sh
+ - rm -rf dist-newstyle
+ - ./travis-${SCRIPT}.sh -j2
cache:
directories:
@@ -130,10 +143,16 @@ cache:
before_cache:
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index*
+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index*
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
# Deploy Haddocks to the haskell/cabal-website repo.
after_success:
+ # Set up deployment to the haskell/cabal-website repo.
+ # NB: these commands MUST be in .travis.yml, otherwise the secret key can be
+ # leaked! See https://github.com/travis-ci/travis.rb/issues/423.
+ # umask to get the permissions to be 600.
+ - if [ "x$TRAVIS_REPO_SLUG" = "xhaskell/cabal" -a "x$TRAVIS_PULL_REQUEST" = "xfalse" -a "x$TRAVIS_BRANCH" = "xmaster" -a "x$DEPLOY_DOCS" = "xYES" ]; then (umask 177 && openssl aes-256-cbc -K $encrypted_edaf6551664d_key -iv $encrypted_edaf6551664d_iv -in id_rsa_cabal_website.aes256.enc -out ~/.ssh/id_rsa -d); fi
- ./travis-deploy.sh
notifications:
diff --git a/cabal/AUTHORS b/cabal/AUTHORS
index 121b7f9..d98324e 100644
--- a/cabal/AUTHORS
+++ b/cabal/AUTHORS
@@ -6,10 +6,13 @@ Adam Langley <agl@imperialviolet.org>
Adam Sandberg Eriksson <adam@sandbergericsson.se>
Alan Zimmerman <alan.zimm@gmail.com>
Albert Krewinkel <tarleb@moltkeplatz.de>
+Alex Biehl <alexbiehl@gmail.com>
Alexander Kjeldaas <alexander.kjeldaas@gmail.com>
Alexander Vershilov <alexander.vershilov@gmail.com>
+Alexei Pastuchov <alexei.pastuchov@telecolumbus.de>
Alistair Bailey <alistair@abayley.org>
Alson Kemp <alson@alsonkemp.com>
+Amir Mohammad Saied <amirsaied@gmail.com>
Anders Kaseorg <andersk@mit.edu>
Andrea Vezzosi <sanzhiyan@gmail.com>
Andres Löh <andres.loeh@gmail.com>
@@ -24,6 +27,7 @@ Arian van Putten <aeroboy94@gmail.com>
Arun Tejasvi Chaganty <arunchaganty@gmail.com>
Atze Dijkstra <atze@cs.uu.nl>
Audrey Tang <audreyt@audreyt.org>
+Auke Booij <auke@tulcod.com>
Austin Seipp <aseipp@pobox.com>
Bardur Arantsson <bardur@scientician.net>
Bartosz Nitka <bnitka@fb.com>
@@ -51,10 +55,12 @@ Chris Wong <lambda.fairy@gmail.com>
Christiaan Baaij <christiaan.baaij@gmail.com>
Clemens Fruhwirth <clemens@endorphin.org>
Clint Adams <clint@debian.org>
+Colin Wahl <colin.t.wahl@gmail.com>
Conal Elliott <conal@conal.net>
Curtis Gagliardi <curtis@curtis.io>
Dan Burton <danburton.email@gmail.com>
Daniel Buckmaster <dan.buckmaster@gmail.com>
+Daniel Gröber <dxld@darkboxed.org>
Daniel Trstenjak <daniel.trstenjak@gmail.com>
Daniel Velkov <norcobg@gmail.com>
Daniel Wagner <daniel@wagner-home.com>
@@ -71,8 +77,9 @@ Dennis Gosnell <cdep.illabout@gmail.com>
Dino Morelli <dino@ui3.info>
Dmitry Astapov <dastapov@gmail.com>
Dominic Steinitz <dominic@steinitz.org>
-Don Stewart <dons@galois.com>
+Don Stewart <dons00@gmail.com>
Doug Beardsley <mightybyte@gmail.com>
+Douglas Wilson <douglas.wilson@gmail.com>
Duncan Coutts <duncan@community.haskell.org>
Echo Nolan <echo@echonolan.net>
Edsko de Vries <edsko@well-typed.com>
@@ -89,6 +96,7 @@ Eyal Lotem <eyal.lotem@gmail.com>
Fabián Orccón <fabian.orccon@pucp.pe>
Federico Mastellone <fmaste@users.noreply.github.com>
Florian Hartwig <florian.j.hartwig@gmail.com>
+Francesco Gazzetta <francygazz@gmail.com>
Franz Thoma <franz.thoma@tngtech.com>
Fujimura Daisuke <me@fujimuradaisuke.com>
Gabor Greif <ggreif@gmail.com>
@@ -115,6 +123,7 @@ Ilya Smelkov <triplepointfive@gmail.com>
Isaac Potoczny-Jones <ijones@syntaxpolice.org>
Isamu Mogi <saturday6c@gmail.com>
Iustin Pop <iusty@k1024.org>
+Ivan Lazar Miljenovic <Ivan.Miljenovic@gmail.com>
Iñaki García Etxebarria <garetxe@gmail.com>
JP Moresmau <jp@moresmau.fr>
Jacco Krijnen <jaccokrijnen@gmail.com>
@@ -127,12 +136,14 @@ Jeremy Shaw <jeremy.shaw@linspireinc.com>
Jim Burton <jim@sdf-eu.org>
Joachim Breitner <mail@joachim-breitner.de>
Joe Quinn <headprogrammingczar@gmail.com>
+Joel Bitrauser <jo.da@posteo.de>
Joel Stanley <intractable@gmail.com>
Joeri van Eekelen <tchakkazulu@gmail.com>
Johan Tibell <johan.tibell@gmail.com>
John Chee <cheecheeo@gmail.com>
John D. Ramsdell <ramsdell@mitre.org>
John Dias <dias@eecs.harvard.edu>
+John Ericson <Ericson2314@Yahoo.com>
John Ericson <Ericson2314@yahoo.com>
John Lato <jwlato@tsurucapital.com>
John Wiegley <johnw@fpcomplete.com>
@@ -184,6 +195,7 @@ Mikhail Glushenkov <mikhail.glushenkov@gmail.com>
Misty De Meo <mistydemeo@gmail.com>
Miëtek Bak <mietek@bak.io>
Mohit Agarwal <mohit@sdf.org>
+Moritz Angermann <moritz.angermann@gmail.com>
Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Nathan Howell <nhowell@alphaheavy.com>
Neil Mitchell <ndmitchell@gmail.com>
@@ -201,6 +213,7 @@ Paolo Capriotti <p.capriotti@gmail.com>
Paolo G. Giarrusso <p.giarrusso@gmail.com>
Paolo Losi <paolo.losi@gmail.com>
Paolo Martini <paolo@nemail.it>
+Patrick Chilton <chpatrick@gmail.com>
Patrick Premont <ppremont@cognimeta.com>
Patryk Zadarnowski <pat@jantar.org>
Pepe Iborra <mnislaih@gmail.com>
@@ -210,13 +223,16 @@ Peter Selinger <selinger@mathstat.dal.ca>
Peter Simons <simons@cryp.to>
Peter Trško <peter.trsko@gmail.com>
Phil Ruffwind <rf@rufflewind.com>
+Philipp Schumann <philipp.schumann@gmail.com>
Philipp Schuster <pschuster@uni-koblenz.de>
+Pranit Bauva <pranit.bauva@gmail.com>
Prayag Verma <prayag.verma@gmail.com>
Randy Polen <randen@users.noreply.github.com>
Reid Barton <rwbarton@gmail.com>
Richard Eisenberg <eir@cis.upenn.edu>
Ricky Elrod <ricky@elrod.me>
Robert Collins <robertc@robertcollins.net>
+Robert Henderson <rob@robjhen.com>
Roberto Zunino <zunrob@users.sf.net>
Robin Green <greenrd@greenrd.org>
Robin KAY <komadori@gekkou.co.uk>
@@ -241,8 +257,10 @@ Simon Meier <iridcode@gmail.com>
Simon Peyton Jones <simonpj@microsoft.com>
Spencer Janssen <sjanssen@cse.unl.edu>
Stephen Blackheath <stephen.blackheath@ipwnstudios.com>
+Stuart Popejoy <spopejoy@panix.com>
Sven Panne <sven.panne@aedion.de>
Sönke Hahn <shahn@joyridelabs.de>
+Tamar Christina <tamar@zhox.com>
Taru Karttunen <taruti@taruti.net>
Thomas Dziedzic <gostrc@gmail.com>
Thomas M. DuBuisson <thomas.dubuisson@gmail.com>
diff --git a/cabal/Cabal/Cabal.cabal b/cabal/Cabal/Cabal.cabal
index 9a1e219..17b2b74 100644
--- a/cabal/Cabal/Cabal.cabal
+++ b/cabal/Cabal/Cabal.cabal
@@ -1,6 +1,6 @@
name: Cabal
-version: 1.25.0.0
-copyright: 2003-2016, Cabal Development Team (see AUTHORS file)
+version: 2.1.0.0
+copyright: 2003-2017, Cabal Development Team (see AUTHORS file)
license: BSD3
license-file: LICENSE
author: Cabal Development Team <cabal-devel@haskell.org>
@@ -32,6 +32,15 @@ extra-source-files:
-- Generated with 'misc/gen-extra-source-files.sh'
-- Do NOT edit this section manually; instead, run the script.
-- BEGIN gen-extra-source-files
+ tests/ParserTests/regressions/Octree-0.5.cabal
+ tests/ParserTests/regressions/elif.cabal
+ tests/ParserTests/regressions/elif2.cabal
+ tests/ParserTests/regressions/encoding-0.8.cabal
+ tests/ParserTests/regressions/generics-sop.cabal
+ tests/ParserTests/regressions/haddock-api-2.18.1-check.cabal
+ tests/ParserTests/regressions/issue-774.cabal
+ tests/ParserTests/regressions/nothing-unicode.cabal
+ tests/ParserTests/regressions/shake.cabal
tests/ParserTests/warnings/bom.cabal
tests/ParserTests/warnings/bool.cabal
tests/ParserTests/warnings/deprecatedfield.cabal
@@ -64,11 +73,6 @@ flag old-directory
description: Use directory < 1.2 and old-time
default: False
-flag parsec
- description: Use parsec parser
- default: False
- manual: True
-
flag parsec-struct-diff
description: Use StructDiff in parsec tests. Affects only parsec tests.
default: False
@@ -83,15 +87,15 @@ library
deepseq >= 1.3 && < 1.5,
filepath >= 1.3 && < 1.5,
pretty >= 1.1 && < 1.2,
- process >= 1.1.0.1 && < 1.5,
- time >= 1.4 && < 1.7
+ process >= 1.1.0.1 && < 1.7,
+ time >= 1.4 && < 1.9
if flag(old-directory)
build-depends: directory >= 1.1 && < 1.2, old-time >= 1 && < 1.2,
process >= 1.0.1.1 && < 1.1.0.2
else
- build-depends: directory >= 1.2 && < 1.3,
- process >= 1.1.0.2 && < 1.5
+ build-depends: directory >= 1.2 && < 1.4,
+ process >= 1.1.0.2 && < 1.7
if flag(bundled-binary-generic)
build-depends: binary >= 0.5 && < 0.7
@@ -108,7 +112,7 @@ library
if os(windows)
build-depends:
- Win32 >= 2.2 && < 2.4
+ Win32 >= 2.2 && < 2.7
ghc-options: -Wall -fno-ignore-asserts -fwarn-tabs
if impl(ghc >= 8.0)
@@ -120,10 +124,13 @@ library
Distribution.Backpack.Configure
Distribution.Backpack.ComponentsGraph
Distribution.Backpack.ConfiguredComponent
+ Distribution.Backpack.DescribeUnitId
Distribution.Backpack.FullUnitId
Distribution.Backpack.LinkedComponent
Distribution.Backpack.ModSubst
Distribution.Backpack.ModuleShape
+ Distribution.Backpack.PreModuleShape
+ Distribution.Utils.IOData
Distribution.Utils.LogProgress
Distribution.Utils.MapAccum
Distribution.Compat.CreatePipe
@@ -131,6 +138,8 @@ library
Distribution.Compat.Exception
Distribution.Compat.Graph
Distribution.Compat.Internal.TempFile
+ Distribution.Compat.Map.Strict
+ Distribution.Compat.Newtype
Distribution.Compat.Prelude.Internal
Distribution.Compat.ReadP
Distribution.Compat.Semigroup
@@ -143,7 +152,6 @@ library
Distribution.Make
Distribution.ModuleName
Distribution.Package
- Distribution.Package.TextClass
Distribution.PackageDescription
Distribution.PackageDescription.Check
Distribution.PackageDescription.Configuration
@@ -160,6 +168,7 @@ library
Distribution.Simple.Build.PathsModule
Distribution.Simple.BuildPaths
Distribution.Simple.BuildTarget
+ Distribution.Simple.BuildToolDepends
Distribution.Simple.CCompiler
Distribution.Simple.Command
Distribution.Simple.Compiler
@@ -167,6 +176,7 @@ library
Distribution.Simple.GHC
Distribution.Simple.GHCJS
Distribution.Simple.Haddock
+ Distribution.Simple.Doctest
Distribution.Simple.HaskellSuite
Distribution.Simple.Hpc
Distribution.Simple.Install
@@ -187,6 +197,7 @@ library
Distribution.Simple.Program.Hpc
Distribution.Simple.Program.Internal
Distribution.Simple.Program.Ld
+ Distribution.Simple.Program.ResponseFile
Distribution.Simple.Program.Run
Distribution.Simple.Program.Script
Distribution.Simple.Program.Strip
@@ -204,26 +215,47 @@ library
Distribution.System
Distribution.TestSuite
Distribution.Text
+ Distribution.Pretty
+ Distribution.Types.AbiHash
+ Distribution.Types.AnnotatedId
Distribution.Types.Benchmark
Distribution.Types.BenchmarkInterface
Distribution.Types.BenchmarkType
Distribution.Types.BuildInfo
Distribution.Types.BuildType
+ Distribution.Types.ComponentInclude
+ Distribution.Types.Dependency
+ Distribution.Types.ExeDependency
+ Distribution.Types.LegacyExeDependency
+ Distribution.Types.PkgconfigDependency
+ Distribution.Types.DependencyMap
+ Distribution.Types.ComponentId
+ Distribution.Types.MungedPackageId
+ Distribution.Types.PackageId
+ Distribution.Types.UnitId
Distribution.Types.Executable
+ Distribution.Types.ExecutableScope
Distribution.Types.Library
Distribution.Types.ForeignLib
Distribution.Types.ForeignLibType
Distribution.Types.ForeignLibOption
+ Distribution.Types.Module
Distribution.Types.ModuleReexport
Distribution.Types.ModuleRenaming
+ Distribution.Types.ComponentName
+ Distribution.Types.MungedPackageName
+ Distribution.Types.PackageName
+ Distribution.Types.PkgconfigName
+ Distribution.Types.UnqualComponentName
Distribution.Types.IncludeRenaming
Distribution.Types.Mixin
Distribution.Types.SetupBuildInfo
Distribution.Types.TestSuite
Distribution.Types.TestSuiteInterface
Distribution.Types.TestType
- Distribution.Types.ComponentName
Distribution.Types.GenericPackageDescription
+ Distribution.Types.Condition
+ Distribution.Types.CondTree
Distribution.Types.HookedBuildInfo
Distribution.Types.PackageDescription
Distribution.Types.SourceRepo
@@ -232,35 +264,57 @@ library
Distribution.Types.LocalBuildInfo
Distribution.Types.ComponentRequestedSpec
Distribution.Types.TargetInfo
+ Distribution.Types.Version
+ Distribution.Types.VersionRange
+ Distribution.Types.VersionInterval
+ Distribution.Utils.Generic
Distribution.Utils.NubList
Distribution.Utils.ShortText
Distribution.Utils.Progress
- Distribution.Utils.BinaryWithFingerprint
Distribution.Verbosity
Distribution.Version
Language.Haskell.Extension
Distribution.Compat.Binary
- if flag(parsec)
- cpp-options: -DCABAL_PARSEC
- build-depends:
- transformers,
- parsec >= 3.1.9 && <3.2
- build-tools:
- alex >=3.1.4 && <3.3
- exposed-modules:
- Distribution.Compat.Parsec
- Distribution.PackageDescription.Parsec
- Distribution.PackageDescription.Parsec.FieldDescr
- Distribution.Parsec.Class
- Distribution.Parsec.ConfVar
- Distribution.Parsec.Lexer
- Distribution.Parsec.LexerMonad
- Distribution.Parsec.Parser
- Distribution.Parsec.Types.Common
- Distribution.Parsec.Types.Field
- Distribution.Parsec.Types.FieldDescr
- Distribution.Parsec.Types.ParseResult
+ -- Parsec parser relatedmodules
+ build-depends:
+ transformers,
+ mtl >= 2.1 && <2.3,
+ parsec >= 3.1.9 && <3.2
+ exposed-modules:
+ Distribution.Compat.Parsec
+ Distribution.FieldGrammar
+ Distribution.FieldGrammar.Class
+ Distribution.FieldGrammar.Parsec
+ Distribution.FieldGrammar.Pretty
+ Distribution.PackageDescription.FieldGrammar
+ Distribution.PackageDescription.Parsec
+ Distribution.PackageDescription.Quirks
+ Distribution.Parsec.Class
+ Distribution.Parsec.Common
+ Distribution.Parsec.ConfVar
+ Distribution.Parsec.Field
+ Distribution.Parsec.Lexer
+ Distribution.Parsec.LexerMonad
+ Distribution.Parsec.Newtypes
+ Distribution.Parsec.ParseResult
+ Distribution.Parsec.Parser
+
+ -- Lens functionality
+ exposed-modules:
+ Distribution.Compat.Lens
+ Distribution.Types.Lens
+ Distribution.Types.Benchmark.Lens
+ Distribution.Types.BuildInfo.Lens
+ Distribution.Types.Executable.Lens
+ Distribution.Types.ForeignLib.Lens
+ Distribution.Types.GenericPackageDescription.Lens
+ Distribution.Types.Library.Lens
+ Distribution.Types.PackageDescription.Lens
+ Distribution.Types.PackageId.Lens
+ Distribution.Types.SetupBuildInfo.Lens
+ Distribution.Types.SourceRepo.Lens
+ Distribution.Types.TestSuite.Lens
other-modules:
Distribution.Backpack.PreExistingComponent
@@ -335,6 +389,7 @@ test-suite unit-tests
UnitTests.Distribution.Simple.Program.Internal
UnitTests.Distribution.Simple.Utils
UnitTests.Distribution.System
+ UnitTests.Distribution.Utils.Generic
UnitTests.Distribution.Utils.NubList
UnitTests.Distribution.Utils.ShortText
UnitTests.Distribution.Version
@@ -342,26 +397,27 @@ test-suite unit-tests
build-depends:
array,
base,
+ bytestring,
containers,
directory,
filepath,
+ integer-logarithms >= 1.0.2 && <1.1,
tasty,
tasty-hunit,
tasty-quickcheck,
tagged,
+ text,
pretty,
- QuickCheck >= 2.7 && < 2.10,
+ QuickCheck >= 2.7 && < 2.11,
Cabal
ghc-options: -Wall
default-language: Haskell2010
test-suite parser-tests
- if !flag(parsec)
- buildable: False
-
type: exitcode-stdio-1.0
hs-source-dirs: tests
main-is: ParserTests.hs
+ build-depends: containers
build-depends:
base,
bytestring,
@@ -369,20 +425,40 @@ test-suite parser-tests
tasty,
tasty-hunit,
tasty-quickcheck,
+ tasty-golden >=2.3.1.1 && <2.4,
+ Diff >=0.3.4 && <0.4,
Cabal
ghc-options: -Wall
default-language: Haskell2010
-test-suite parser-hackage-tests
- if !flag(parsec)
- buildable: False
+test-suite check-tests
+ type: exitcode-stdio-1.0
+ hs-source-dirs: tests
+ main-is: CheckTests.hs
+ build-depends:
+ base,
+ bytestring,
+ filepath,
+ tasty,
+ tasty-golden >=2.3.1.1 && <2.4,
+ Diff >=0.3.4 && <0.4,
+ Cabal
+ ghc-options: -Wall
+ default-language: Haskell2010
+test-suite parser-hackage-tests
type: exitcode-stdio-1.0
main-is: ParserHackageTests.hs
+ -- TODO: need to get 01-index.tar on appveyor
+ if os(windows)
+ buildable: False
+
hs-source-dirs: tests
build-depends:
base,
+ base-orphans == 0.6.*,
+ base-compat >=0.9.3 && <0.10,
containers,
tar >=0.5 && <0.6,
bytestring,
@@ -392,7 +468,7 @@ test-suite parser-hackage-tests
if flag(parsec-struct-diff)
build-depends:
- generics-sop ==0.2.*,
+ generics-sop >= 0.3.1.0 && <0.4,
these >=0.7.1 && <0.8,
singleton-bool >=0.1.1.0 && <0.2,
keys
diff --git a/cabal/Cabal/Distribution/Backpack.hs b/cabal/Cabal/Distribution/Backpack.hs
index aadb48f..8185174 100644
--- a/cabal/Cabal/Distribution/Backpack.hs
+++ b/cabal/Cabal/Distribution/Backpack.hs
@@ -46,8 +46,10 @@ import qualified Text.PrettyPrint as Disp
import Text.PrettyPrint (hcat)
import Distribution.ModuleName
-import Distribution.Package
import Distribution.Text
+import Distribution.Types.ComponentId
+import Distribution.Types.UnitId
+import Distribution.Types.Module
import Distribution.Utils.Base62
import qualified Data.Map as Map
diff --git a/cabal/Cabal/Distribution/Backpack/ComponentsGraph.hs b/cabal/Cabal/Distribution/Backpack/ComponentsGraph.hs
index 1489fcc..9b03638 100644
--- a/cabal/Cabal/Distribution/Backpack/ComponentsGraph.hs
+++ b/cabal/Cabal/Distribution/Backpack/ComponentsGraph.hs
@@ -1,18 +1,23 @@
-- | See <https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst>
-
module Distribution.Backpack.ComponentsGraph (
ComponentsGraph,
- dispComponentsGraph,
- toComponentsGraph,
+ ComponentsWithDeps,
+ mkComponentsGraph,
+ componentsGraphToList,
+ dispComponentsWithDeps,
componentCycleMsg
) where
+import Prelude ()
+import Distribution.Compat.Prelude
+
import Distribution.Package
import Distribution.PackageDescription as PD hiding (Flag)
+import Distribution.Simple.BuildToolDepends
import Distribution.Simple.LocalBuildInfo
import Distribution.Types.ComponentRequestedSpec
-import Distribution.Simple.Utils
-import Distribution.Compat.Graph (Node(..))
+import Distribution.Types.UnqualComponentName
+import Distribution.Compat.Graph (Graph, Node(..))
import qualified Distribution.Compat.Graph as Graph
import Distribution.Text
@@ -23,38 +28,42 @@ import Text.PrettyPrint
-- Components graph
------------------------------------------------------------------------------
--- | A components graph is a source level graph tracking the
--- dependencies between components in a package.
-type ComponentsGraph = [(Component, [ComponentName])]
+-- | A graph of source-level components by their source-level
+-- dependencies
+--
+type ComponentsGraph = Graph (Node ComponentName Component)
+
+-- | A list of components associated with the source level
+-- dependencies between them.
+--
+type ComponentsWithDeps = [(Component, [ComponentName])]
--- | Pretty-print a 'ComponentsGraph'.
-dispComponentsGraph :: ComponentsGraph -> Doc
-dispComponentsGraph graph =
+-- | Pretty-print 'ComponentsWithDeps'.
+--
+dispComponentsWithDeps :: ComponentsWithDeps -> Doc
+dispComponentsWithDeps graph =
vcat [ hang (text "component" <+> disp (componentName c)) 4
(vcat [ text "dependency" <+> disp cdep | cdep <- cdeps ])
| (c, cdeps) <- graph ]
--- | Given the package description and a 'PackageDescription' (used
--- to determine if a package name is internal or not), create a graph of
--- dependencies between the components. This is NOT necessarily the
--- build order (although it is in the absence of Backpack.)
-toComponentsGraph :: ComponentRequestedSpec
+-- | Create a 'Graph' of 'Component', or report a cycle if there is a
+-- problem.
+--
+mkComponentsGraph :: ComponentRequestedSpec
-> PackageDescription
-> Either [ComponentName] ComponentsGraph
-toComponentsGraph enabled pkg_descr =
- let g = Graph.fromList [ N c (componentName c) (componentDeps c)
+mkComponentsGraph enabled pkg_descr =
+ let g = Graph.fromDistinctList
+ [ N c (componentName c) (componentDeps c)
| c <- pkgBuildableComponents pkg_descr
, componentEnabled enabled c ]
in case Graph.cycles g of
- [] -> Right (map (\(N c _ cs) -> (c, cs)) (Graph.revTopSort g))
+ [] -> Right g
ccycles -> Left [ componentName c | N c _ _ <- concat ccycles ]
where
-- The dependencies for the given component
componentDeps component =
- [ CExeName toolname
- | LegacyExeDependency name _ <- buildTools bi
- , let toolname = mkUnqualComponentName name
- , toolname `elem` map exeName (executables pkg_descr) ]
+ (CExeName <$> getAllInternalToolDependencies pkg_descr bi)
++ [ if pkgname == packageName pkg_descr
then CLibName
@@ -68,6 +77,17 @@ toComponentsGraph enabled pkg_descr =
conv Nothing = packageNameToUnqualComponentName $ packageName pkg_descr
conv (Just s) = s
+-- | Given the package description and a 'PackageDescription' (used
+-- to determine if a package name is internal or not), sort the
+-- components in dependency order (fewest dependencies first). This is
+-- NOT necessarily the build order (although it is in the absence of
+-- Backpack.)
+--
+componentsGraphToList :: ComponentsGraph
+ -> ComponentsWithDeps
+componentsGraphToList =
+ map (\(N c _ cs) -> (c, cs)) . Graph.revTopSort
+
-- | Error message when there is a cycle; takes the SCC of components.
componentCycleMsg :: [ComponentName] -> Doc
componentCycleMsg cnames =
diff --git a/cabal/Cabal/Distribution/Backpack/Configure.hs b/cabal/Cabal/Distribution/Backpack/Configure.hs
index 71da11e..597bf82 100644
--- a/cabal/Cabal/Distribution/Backpack/Configure.hs
+++ b/cabal/Cabal/Distribution/Backpack/Configure.hs
@@ -25,6 +25,7 @@ import Distribution.Backpack.ConfiguredComponent
import Distribution.Backpack.LinkedComponent
import Distribution.Backpack.ReadyComponent
import Distribution.Backpack.ComponentsGraph
+import Distribution.Backpack.Id
import Distribution.Simple.Compiler hiding (Flag)
import Distribution.Package
@@ -37,11 +38,12 @@ import Distribution.PackageDescription as PD hiding (Flag)
import Distribution.ModuleName
import Distribution.Simple.Setup as Setup
import Distribution.Simple.LocalBuildInfo
+import Distribution.Types.AnnotatedId
import Distribution.Types.ComponentRequestedSpec
+import Distribution.Types.ComponentInclude
import Distribution.Verbosity
import qualified Distribution.Compat.Graph as Graph
import Distribution.Compat.Graph (Graph, IsNode(..))
-import Distribution.Utils.Progress
import Distribution.Utils.LogProgress
import Data.Either
@@ -49,7 +51,6 @@ import Data.Either
import qualified Data.Set as Set
import qualified Data.Map as Map
import Distribution.Text
- ( display )
import Text.PrettyPrint
------------------------------------------------------------------------------
@@ -60,6 +61,7 @@ configureComponentLocalBuildInfos
:: Verbosity
-> Bool -- use_external_internal_deps
-> ComponentRequestedSpec
+ -> Bool -- deterministic
-> Flag String -- configIPID
-> Flag ComponentId -- configCID
-> PackageDescription
@@ -70,22 +72,28 @@ configureComponentLocalBuildInfos
-> Compiler
-> LogProgress ([ComponentLocalBuildInfo], InstalledPackageIndex)
configureComponentLocalBuildInfos
- verbosity use_external_internal_deps enabled ipid_flag cid_flag pkg_descr
+ verbosity use_external_internal_deps enabled deterministic ipid_flag cid_flag pkg_descr
prePkgDeps flagAssignment instantiate_with installedPackageSet comp = do
-- NB: In single component mode, this returns a *single* component.
-- In this graph, the graph is NOT closed.
- graph0 <- case toComponentsGraph enabled pkg_descr of
- Left ccycle -> failProgress (componentCycleMsg ccycle)
- Right comps -> return comps
+ graph0 <- case mkComponentsGraph enabled pkg_descr of
+ Left ccycle -> dieProgress (componentCycleMsg ccycle)
+ Right g -> return (componentsGraphToList g)
infoProgress $ hang (text "Source component graph:") 4
- (dispComponentsGraph graph0)
+ (dispComponentsWithDeps graph0)
- let conf_pkg_map = Map.fromList
- [(pc_pkgname pkg, (pc_cid pkg, pc_pkgid pkg))
+ let conf_pkg_map = Map.fromListWith Map.union
+ [(pc_pkgname pkg,
+ Map.singleton (pc_compname pkg)
+ (AnnotatedId {
+ ann_id = pc_cid pkg,
+ ann_pid = packageId pkg,
+ ann_cname = pc_compname pkg
+ }))
| pkg <- prePkgDeps]
- graph1 = toConfiguredComponents use_external_internal_deps
+ graph1 <- toConfiguredComponents use_external_internal_deps
flagAssignment
- ipid_flag cid_flag pkg_descr
+ deterministic ipid_flag cid_flag pkg_descr
conf_pkg_map (map fst graph0)
infoProgress $ hang (text "Configured component graph:") 4
(vcat (map dispConfiguredComponent graph1))
@@ -107,15 +115,15 @@ configureComponentLocalBuildInfos
(vcat (map dispLinkedComponent graph2))
let pid_map = Map.fromList $
- [ (pc_uid pkg, pc_pkgid pkg)
+ [ (pc_uid pkg, pc_munged_id pkg)
| pkg <- prePkgDeps] ++
- [ (Installed.installedUnitId pkg, Installed.sourcePackageId pkg)
+ [ (Installed.installedUnitId pkg, mungedId pkg)
| (_, Module uid _) <- instantiate_with
, Just pkg <- [PackageIndex.lookupUnitId
installedPackageSet (unDefUnitId uid)] ]
subst = Map.fromList instantiate_with
graph3 = toReadyComponents pid_map subst graph2
- graph4 = Graph.revTopSort (Graph.fromList graph3)
+ graph4 = Graph.revTopSort (Graph.fromDistinctList graph3)
infoProgress $ hang (text "Ready component graph:") 4
(vcat (map dispReadyComponent graph4))
@@ -145,11 +153,11 @@ toComponentLocalBuildInfos
-- they are not related to what we are building. This was true
-- in the old configure code.
external_graph :: Graph (Either InstalledPackageInfo ReadyComponent)
- external_graph = Graph.fromList
+ external_graph = Graph.fromDistinctList
. map Left
$ PackageIndex.allPackages installedPackageSet
internal_graph :: Graph (Either InstalledPackageInfo ReadyComponent)
- internal_graph = Graph.fromList
+ internal_graph = Graph.fromDistinctList
. map Right
$ graph
combined_graph = Graph.unionRight external_graph internal_graph
@@ -167,12 +175,12 @@ toComponentLocalBuildInfos
-- the include paths and everything should be.
--
packageDependsIndex = PackageIndex.fromList (lefts local_graph)
- fullIndex = Graph.fromList local_graph
+ fullIndex = Graph.fromDistinctList local_graph
case Graph.broken fullIndex of
[] -> return ()
broken ->
-- TODO: ppr this
- failProgress . text $
+ dieProgress . text $
"The following packages are broken because other"
++ " packages they depend on are missing. These broken "
++ "packages must be rebuilt before they can be used.\n"
@@ -204,24 +212,24 @@ toComponentLocalBuildInfos
-- TODO: This is probably wrong for Backpack
let pseudoTopPkg :: InstalledPackageInfo
pseudoTopPkg = emptyInstalledPackageInfo {
- Installed.installedUnitId =
- mkLegacyUnitId (packageId pkg_descr),
+ Installed.installedUnitId = mkLegacyUnitId (packageId pkg_descr),
Installed.sourcePackageId = packageId pkg_descr,
- Installed.depends =
- map pc_uid externalPkgDeps
+ Installed.depends = map pc_uid externalPkgDeps
}
case PackageIndex.dependencyInconsistencies
. PackageIndex.insert pseudoTopPkg
$ packageDependsIndex of
[] -> return ()
inconsistencies ->
- warnProgress . text $
- "This package indirectly depends on multiple versions of the same "
- ++ "package. This is highly likely to cause a compile failure.\n"
- ++ unlines [ "package " ++ display pkg ++ " requires "
- ++ display (PackageIdentifier name ver)
- | (name, uses) <- inconsistencies
- , (pkg, ver) <- uses ]
+ warnProgress $
+ hang (text "This package indirectly depends on multiple versions of the same" <+>
+ text "package. This is very likely to cause a compile failure.") 2
+ (vcat [ text "package" <+> disp (packageName user) <+>
+ parens (disp (installedUnitId user)) <+> text "requires" <+>
+ disp inst
+ | (_dep_key, insts) <- inconsistencies
+ , (inst, users) <- insts
+ , user <- users ])
let clbis = mkLinkedComponentsLocalBuildInfo comp graph
-- forM clbis $ \(clbi,deps) -> info verbosity $ "UNIT" ++ hashUnitId (componentUnitId clbi) ++ "\n" ++ intercalate "\n" (map hashUnitId deps)
return (clbis, packageDependsIndex)
@@ -240,7 +248,7 @@ mkLinkedComponentsLocalBuildInfo comp rcs = map go rcs
isInternal x = Set.member x internalUnits
go rc =
case rc_component rc of
- CLib _ ->
+ CLib lib ->
let convModuleExport (modname', (Module uid modname))
| this_uid == unDefUnitId uid
, modname' == modname
@@ -268,6 +276,10 @@ mkLinkedComponentsLocalBuildInfo comp rcs = map go rcs
Left indefc -> [ (m, OpenModuleVar m) | m <- indefc_requires indefc ]
Right instc -> [ (m, OpenModule (DefiniteUnitId uid') m')
| (m, Module uid' m') <- instc_insts instc ]
+
+ compat_name = computeCompatPackageName (packageName rc) (libName lib)
+ compat_key = computeCompatPackageKey comp compat_name (packageVersion rc) this_uid
+
in LibComponentLocalBuildInfo {
componentPackageDeps = cpds,
componentUnitId = this_uid,
@@ -276,12 +288,12 @@ mkLinkedComponentsLocalBuildInfo comp rcs = map go rcs
componentIsIndefinite_ = is_indefinite,
componentLocalName = cname,
componentInternalDeps = internal_deps,
- componentExeDeps = map unDefUnitId (rc_internal_build_tools rc),
+ componentExeDeps = exe_deps,
componentIncludes = includes,
componentExposedModules = exports,
componentIsPublic = rc_public rc,
- componentCompatPackageKey = rc_compat_key rc comp,
- componentCompatPackageName = rc_compat_name rc
+ componentCompatPackageKey = compat_key,
+ componentCompatPackageName = compat_name
}
CFLib _ ->
FLibComponentLocalBuildInfo {
@@ -289,7 +301,7 @@ mkLinkedComponentsLocalBuildInfo comp rcs = map go rcs
componentComponentId = this_cid,
componentLocalName = cname,
componentPackageDeps = cpds,
- componentExeDeps = map unDefUnitId $ rc_internal_build_tools rc,
+ componentExeDeps = exe_deps,
componentInternalDeps = internal_deps,
componentIncludes = includes
}
@@ -299,7 +311,7 @@ mkLinkedComponentsLocalBuildInfo comp rcs = map go rcs
componentComponentId = this_cid,
componentLocalName = cname,
componentPackageDeps = cpds,
- componentExeDeps = map unDefUnitId $ rc_internal_build_tools rc,
+ componentExeDeps = exe_deps,
componentInternalDeps = internal_deps,
componentIncludes = includes
}
@@ -309,7 +321,7 @@ mkLinkedComponentsLocalBuildInfo comp rcs = map go rcs
componentComponentId = this_cid,
componentLocalName = cname,
componentPackageDeps = cpds,
- componentExeDeps = map unDefUnitId $ rc_internal_build_tools rc,
+ componentExeDeps = exe_deps,
componentInternalDeps = internal_deps,
componentIncludes = includes
}
@@ -319,7 +331,7 @@ mkLinkedComponentsLocalBuildInfo comp rcs = map go rcs
componentComponentId = this_cid,
componentLocalName = cname,
componentPackageDeps = cpds,
- componentExeDeps = map unDefUnitId $ rc_internal_build_tools rc,
+ componentExeDeps = exe_deps,
componentInternalDeps = internal_deps,
componentIncludes = includes
}
@@ -329,18 +341,17 @@ mkLinkedComponentsLocalBuildInfo comp rcs = map go rcs
this_cid = rc_cid rc
cname = componentName (rc_component rc)
cpds = rc_depends rc
+ exe_deps = map ann_id $ rc_exe_deps rc
is_indefinite =
case rc_i rc of
Left _ -> True
Right _ -> False
includes =
- case rc_i rc of
- Left indefc ->
- indefc_includes indefc
- Right instc ->
- map (\(x,y) -> (DefiniteUnitId x,y)) (instc_includes instc)
- internal_deps =
- filter isInternal (nodeNeighbors rc)
- ++ map unDefUnitId (rc_internal_build_tools rc)
-
-
+ map (\ci -> (ci_id ci, ci_renaming ci)) $
+ case rc_i rc of
+ Left indefc ->
+ indefc_includes indefc
+ Right instc ->
+ map (\ci -> ci { ci_ann_id = fmap DefiniteUnitId (ci_ann_id ci) })
+ (instc_includes instc)
+ internal_deps = filter isInternal (nodeNeighbors rc)
diff --git a/cabal/Cabal/Distribution/Backpack/ConfiguredComponent.hs b/cabal/Cabal/Distribution/Backpack/ConfiguredComponent.hs
index 1ae9b44..1d92963 100644
--- a/cabal/Cabal/Distribution/Backpack/ConfiguredComponent.hs
+++ b/cabal/Cabal/Distribution/Backpack/ConfiguredComponent.hs
@@ -2,6 +2,9 @@
-- | See <https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst>
module Distribution.Backpack.ConfiguredComponent (
ConfiguredComponent(..),
+ cc_name,
+ cc_cid,
+ cc_pkgid,
toConfiguredComponent,
toConfiguredComponents,
dispConfiguredComponent,
@@ -18,18 +21,29 @@ import Distribution.Compat.Prelude hiding ((<>))
import Distribution.Backpack.Id
+import Distribution.Types.AnnotatedId
+import Distribution.Types.Dependency
+import Distribution.Types.ExeDependency
import Distribution.Types.IncludeRenaming
+import Distribution.Types.ComponentId
+import Distribution.Types.PackageId
+import Distribution.Types.PackageName
import Distribution.Types.Mixin
+import Distribution.Types.ComponentName
+import Distribution.Types.UnqualComponentName
+import Distribution.Types.ComponentInclude
import Distribution.Package
import Distribution.PackageDescription as PD hiding (Flag)
+import Distribution.Simple.BuildToolDepends
import Distribution.Simple.Setup as Setup
import Distribution.Simple.LocalBuildInfo
import Distribution.Version
+import Distribution.Utils.LogProgress
+import Distribution.Utils.MapAccum
+import Control.Monad
import qualified Data.Set as Set
import qualified Data.Map as Map
-import Data.Traversable
- ( mapAccumL )
import Distribution.Text
import Text.PrettyPrint
@@ -37,111 +51,156 @@ import Text.PrettyPrint
-- and the 'ComponentId's of the things it depends on.
data ConfiguredComponent
= ConfiguredComponent {
- cc_cid :: ComponentId,
- -- The package this component came from.
- cc_pkgid :: PackageId,
+ -- | Unique identifier of component, plus extra useful info.
+ cc_ann_id :: AnnotatedId ComponentId,
+ -- | The fragment of syntax from the Cabal file describing this
+ -- component.
cc_component :: Component,
- cc_public :: Bool,
- -- ^ Is this the public library component of the package?
- -- (THIS is what the hole instantiation applies to.)
+ -- | Is this the public library component of the package?
+ -- (If we invoke Setup with an instantiation, this is the
+ -- component the instantiation applies to.)
-- Note that in one-component configure mode, this is
-- always True, because any component is the "public" one.)
- cc_internal_build_tools :: [ComponentId],
- -- Not resolved yet; component configuration only looks at ComponentIds.
- cc_includes :: [(ComponentId, PackageId, IncludeRenaming)]
+ cc_public :: Bool,
+ -- | Dependencies on executables from @build-tools@ and
+ -- @build-tool-depends@.
+ cc_exe_deps :: [AnnotatedId ComponentId],
+ -- | The mixins of this package, including both explicit (from
+ -- the @mixins@ field) and implicit (from @build-depends@). Not
+ -- mix-in linked yet; component configuration only looks at
+ -- 'ComponentId's.
+ cc_includes :: [ComponentInclude ComponentId IncludeRenaming]
}
+
+-- | Uniquely identifies a configured component.
+cc_cid :: ConfiguredComponent -> ComponentId
+cc_cid = ann_id . cc_ann_id
+
+-- | The package this component came from.
+cc_pkgid :: ConfiguredComponent -> PackageId
+cc_pkgid = ann_pid . cc_ann_id
+
+-- | The 'ComponentName' of a component; this uniquely identifies
+-- a fragment of syntax within a specified Cabal file describing the
+-- component.
cc_name :: ConfiguredComponent -> ComponentName
-cc_name = componentName . cc_component
+cc_name = ann_cname . cc_ann_id
+-- | Pretty-print a 'ConfiguredComponent'.
dispConfiguredComponent :: ConfiguredComponent -> Doc
dispConfiguredComponent cc =
hang (text "component" <+> disp (cc_cid cc)) 4
- (vcat [ hsep $ [ text "include", disp cid, disp incl_rn ]
- | (cid, _, incl_rn) <- cc_includes cc
+ (vcat [ hsep $ [ text "include", disp (ci_id incl), disp (ci_renaming incl) ]
+ | incl <- cc_includes cc
])
-
-- | Construct a 'ConfiguredComponent', given that the 'ComponentId'
-- and library/executable dependencies are known. The primary
-- work this does is handling implicit @backpack-include@ fields.
mkConfiguredComponent
- :: PackageId
+ :: PackageDescription
-> ComponentId
- -> [(PackageName, (ComponentId, PackageId))]
- -> [ComponentId]
+ -> [AnnotatedId ComponentId] -- lib deps
+ -> [AnnotatedId ComponentId] -- exe deps
-> Component
- -> ConfiguredComponent
-mkConfiguredComponent this_pid this_cid lib_deps exe_deps component =
- ConfiguredComponent {
- cc_cid = this_cid,
- cc_pkgid = this_pid,
- cc_component = component,
- cc_public = is_public,
- cc_internal_build_tools = exe_deps,
- cc_includes = explicit_includes ++ implicit_includes
- }
- where
- bi = componentBuildInfo component
- deps = map snd lib_deps
- deps_map = Map.fromList lib_deps
-
- -- Resolve each @backpack-include@ into the actual dependency
+ -> LogProgress ConfiguredComponent
+mkConfiguredComponent pkg_descr this_cid lib_deps exe_deps component = do
+ -- Resolve each @mixins@ into the actual dependency
-- from @lib_deps@.
- explicit_includes
- = [ (cid, pid { pkgName = name }, rns)
- | Mixin name rns <- mixins bi
- , Just (cid, pid) <- [Map.lookup name deps_map] ]
-
- -- Any @build-depends@ which is not explicitly mentioned in
- -- @backpack-include@ is converted into an "implicit" include.
- used_explicitly = Set.fromList (map (\(cid,_,_) -> cid) explicit_includes)
- implicit_includes
- = map (\(cid, pid) -> (cid, pid, defaultIncludeRenaming))
- $ filter (flip Set.notMember used_explicitly . fst) deps
+ explicit_includes <- forM (mixins bi) $ \(Mixin name rns) -> do
+ let keys = fixFakePkgName pkg_descr name
+ aid <- case Map.lookup keys deps_map of
+ Nothing ->
+ dieProgress $
+ text "Mix-in refers to non-existent package" <+>
+ quotes (disp name) $$
+ text "(did you forget to add the package to build-depends?)"
+ Just r -> return r
+ return ComponentInclude {
+ ci_ann_id = aid,
+ ci_renaming = rns,
+ ci_implicit = False
+ }
+ -- Any @build-depends@ which is not explicitly mentioned in
+ -- @backpack-include@ is converted into an "implicit" include.
+ let used_explicitly = Set.fromList (map ci_id explicit_includes)
+ implicit_includes
+ = map (\aid -> ComponentInclude {
+ ci_ann_id = aid,
+ ci_renaming = defaultIncludeRenaming,
+ ci_implicit = True
+ })
+ $ filter (flip Set.notMember used_explicitly . ann_id) lib_deps
+
+ return ConfiguredComponent {
+ cc_ann_id = AnnotatedId {
+ ann_id = this_cid,
+ ann_pid = package pkg_descr,
+ ann_cname = componentName component
+ },
+ cc_component = component,
+ cc_public = is_public,
+ cc_exe_deps = exe_deps,
+ cc_includes = explicit_includes ++ implicit_includes
+ }
+ where
+ bi = componentBuildInfo component
+ deps_map = Map.fromList [ ((packageName dep, ann_cname dep), dep)
+ | dep <- lib_deps ]
is_public = componentName component == CLibName
type ConfiguredComponentMap =
- (Map PackageName (ComponentId, PackageId), -- libraries
- Map UnqualComponentName ComponentId) -- executables
+ Map PackageName (Map ComponentName (AnnotatedId ComponentId))
--- Executable map must be different because an executable can
--- have the same name as a library. Ew.
-
--- | Given some ambient environment of package names that
--- are "in scope", looks at the 'BuildInfo' to decide
--- what the packages actually resolve to, and then builds
--- a 'ConfiguredComponent'.
toConfiguredComponent
:: PackageDescription
-> ComponentId
- -> Map PackageName (ComponentId, PackageId) -- external
-> ConfiguredComponentMap
-> Component
- -> ConfiguredComponent
-toConfiguredComponent pkg_descr this_cid
- external_lib_map (lib_map, exe_map) component =
+ -> LogProgress ConfiguredComponent
+toConfiguredComponent pkg_descr this_cid dep_map component = do
+ lib_deps <-
+ if newPackageDepsBehaviour pkg_descr
+ then forM (targetBuildDepends bi) $ \(Dependency name _) -> do
+ let (pn, cn) = fixFakePkgName pkg_descr name
+ value <- case Map.lookup cn =<< Map.lookup pn dep_map of
+ Nothing ->
+ dieProgress $
+ text "Dependency on unbuildable" <+>
+ text (showComponentName cn) <+>
+ text "from" <+> disp pn
+ Just v -> return v
+ return value
+ else return old_style_lib_deps
mkConfiguredComponent
- (package pkg_descr) this_cid
+ pkg_descr this_cid
lib_deps exe_deps component
where
bi = componentBuildInfo component
- find_it :: PackageName -> (ComponentId, PackageId)
- find_it name =
- fromMaybe (error ("toConfiguredComponent: " ++ display (packageName pkg_descr) ++
- " " ++ display name)) $
- Map.lookup name lib_map <|>
- Map.lookup name external_lib_map
- lib_deps
- | newPackageDepsBehaviour pkg_descr
- = [ (name, find_it name)
- | Dependency name _ <- targetBuildDepends bi ]
- | otherwise
- = Map.toList external_lib_map
- exe_deps = [ cid
- | LegacyExeDependency name _ <- buildTools bi
- , Just cid <- [ Map.lookup (mkUnqualComponentName name) exe_map ] ]
+ -- dep_map contains a mix of internal and external deps.
+ -- We want all the public libraries (dep_cn == CLibName)
+ -- of all external deps (dep /= pn). Note that this
+ -- excludes the public library of the current package:
+ -- this is not supported by old-style deps behavior
+ -- because it would imply a cyclic dependency for the
+ -- library itself.
+ old_style_lib_deps = [ e
+ | (pn, comp_map) <- Map.toList dep_map
+ , pn /= packageName pkg_descr
+ , (cn, e) <- Map.toList comp_map
+ , cn == CLibName ]
+ exe_deps =
+ [ exe
+ | ExeDependency pn cn _ <- getAllToolDependencies pkg_descr bi
+ -- The error suppression here is important, because in general
+ -- we won't know about external dependencies (e.g., 'happy')
+ -- which the package is attempting to use (those deps are only
+ -- fed in when cabal-install uses this codepath.)
+ -- TODO: Let cabal-install request errors here
+ , Just exe <- [Map.lookup (CExeName cn) =<< Map.lookup pn dep_map]
+ ]
-- | Also computes the 'ComponentId', and sets cc_public if necessary.
-- This is Cabal-only; cabal-install won't use this.
@@ -149,47 +208,36 @@ toConfiguredComponent'
:: Bool -- use_external_internal_deps
-> FlagAssignment
-> PackageDescription
+ -> Bool -- deterministic
-> Flag String -- configIPID (todo: remove me)
-> Flag ComponentId -- configCID
- -> Map PackageName (ComponentId, PackageId) -- external
-> ConfiguredComponentMap
-> Component
- -> ConfiguredComponent
+ -> LogProgress ConfiguredComponent
toConfiguredComponent' use_external_internal_deps flags
- pkg_descr ipid_flag cid_flag
- external_lib_map (lib_map, exe_map) component =
- let cc = toConfiguredComponent
+ pkg_descr deterministic ipid_flag cid_flag
+ dep_map component = do
+ cc <- toConfiguredComponent
pkg_descr this_cid
- external_lib_map (lib_map, exe_map) component
- in if use_external_internal_deps
- then cc { cc_public = True }
- else cc
+ dep_map component
+ return $ if use_external_internal_deps
+ then cc { cc_public = True }
+ else cc
where
- this_cid = computeComponentId ipid_flag cid_flag (package pkg_descr)
+ -- TODO: pass component names to it too!
+ this_cid = computeComponentId deterministic ipid_flag cid_flag (package pkg_descr)
(componentName component) (Just (deps, flags))
- deps = [ cid | (cid, _) <- Map.elems external_lib_map ]
+ deps = [ ann_id aid | m <- Map.elems dep_map
+ , aid <- Map.elems m ]
extendConfiguredComponentMap
:: ConfiguredComponent
-> ConfiguredComponentMap
-> ConfiguredComponentMap
-extendConfiguredComponentMap cc (lib_map, exe_map) =
- (lib_map', exe_map')
- where
- lib_map'
- = case cc_name cc of
- CLibName ->
- Map.insert (pkgName (cc_pkgid cc))
- (cc_cid cc, cc_pkgid cc) lib_map
- CSubLibName str ->
- Map.insert (unqualComponentNameToPackageName str)
- (cc_cid cc, cc_pkgid cc) lib_map
- _ -> lib_map
- exe_map'
- = case cc_name cc of
- CExeName str ->
- Map.insert str (cc_cid cc) exe_map
- _ -> exe_map
+extendConfiguredComponentMap cc =
+ Map.insertWith Map.union
+ (pkgName (cc_pkgid cc))
+ (Map.singleton (cc_name cc) (cc_ann_id cc))
-- Compute the 'ComponentId's for a graph of 'Component's. The
-- list of internal components must be topologically sorted
@@ -198,22 +246,24 @@ extendConfiguredComponentMap cc (lib_map, exe_map) =
toConfiguredComponents
:: Bool -- use_external_internal_deps
-> FlagAssignment
+ -> Bool -- deterministic
-> Flag String -- configIPID
-> Flag ComponentId -- configCID
-> PackageDescription
- -> Map PackageName (ComponentId, PackageId)
+ -> ConfiguredComponentMap
-> [Component]
- -> [ConfiguredComponent]
+ -> LogProgress [ConfiguredComponent]
toConfiguredComponents
- use_external_internal_deps flags ipid_flag cid_flag pkg_descr
- external_lib_map comps
- = snd (mapAccumL go (Map.empty, Map.empty) comps)
+ use_external_internal_deps flags deterministic ipid_flag cid_flag pkg_descr
+ dep_map comps
+ = fmap snd (mapAccumM go dep_map comps)
where
- go m component = (extendConfiguredComponentMap cc m, cc)
- where cc = toConfiguredComponent'
- use_external_internal_deps flags pkg_descr ipid_flag cid_flag
- external_lib_map m component
-
+ go m component = do
+ cc <- toConfiguredComponent'
+ use_external_internal_deps flags pkg_descr
+ deterministic ipid_flag cid_flag
+ m component
+ return (extendConfiguredComponentMap cc m, cc)
newPackageDepsBehaviourMinVersion :: Version
newPackageDepsBehaviourMinVersion = mkVersion [1,7,1]
@@ -227,3 +277,16 @@ newPackageDepsBehaviourMinVersion = mkVersion [1,7,1]
newPackageDepsBehaviour :: PackageDescription -> Bool
newPackageDepsBehaviour pkg =
specVersion pkg >= newPackageDepsBehaviourMinVersion
+
+-- | 'build-depends:' stanzas are currently ambiguous as the external packages
+-- and internal libraries are specified the same. For now, we assume internal
+-- libraries shadow, and this function disambiguates accordingly, but soon the
+-- underlying ambiguity will be addressed.
+fixFakePkgName :: PackageDescription -> PackageName -> (PackageName, ComponentName)
+fixFakePkgName pkg_descr pn =
+ if subLibName `elem` internalLibraries
+ then (packageName pkg_descr, CSubLibName subLibName)
+ else (pn, CLibName)
+ where
+ subLibName = packageNameToUnqualComponentName pn
+ internalLibraries = mapMaybe libName (allLibraries pkg_descr)
diff --git a/cabal/Cabal/Distribution/Backpack/DescribeUnitId.hs b/cabal/Cabal/Distribution/Backpack/DescribeUnitId.hs
new file mode 100644
index 0000000..8deb42a
--- /dev/null
+++ b/cabal/Cabal/Distribution/Backpack/DescribeUnitId.hs
@@ -0,0 +1,61 @@
+{-# LANGUAGE Rank2Types #-}
+{-# LANGUAGE FlexibleContexts #-}
+module Distribution.Backpack.DescribeUnitId where
+
+import Prelude ()
+import Distribution.Compat.Prelude
+
+import Distribution.Types.PackageId
+import Distribution.Types.ComponentName
+import Distribution.Compat.Stack
+import Distribution.Verbosity
+import Distribution.ModuleName
+import Distribution.Text
+import Distribution.Simple.Utils
+
+import Text.PrettyPrint
+
+-- Unit identifiers have a well defined, machine-readable format,
+-- but this format isn't very user-friendly for users. This
+-- module defines some functions for solving common rendering
+-- problems one has for displaying these.
+--
+-- There are three basic problems we tackle:
+--
+-- - Users don't want to see pkg-0.5-inplace-libname,
+-- they want to see "library 'libname' from 'pkg-0.5'"
+--
+-- - Users don't want to see the raw component identifier, which
+-- usually contains a wordy hash that doesn't matter.
+--
+-- - Users don't want to see a hash of the instantiation: they
+-- want to see the actual instantiation, and they want it in
+-- interpretable form.
+--
+
+-- | Print a Setup message stating (1) what operation we are doing,
+-- for (2) which component (with enough details to uniquely identify
+-- the build in question.)
+--
+setupMessage' :: Text a => Verbosity
+ -> String -- ^ Operation being done (capitalized), on:
+ -> PackageIdentifier -- ^ Package
+ -> ComponentName -- ^ Component name
+ -> Maybe [(ModuleName, a)] -- ^ Instantiation, if available.
+ -- Polymorphic to take
+ -- 'OpenModule' or 'Module'
+ -> IO ()
+setupMessage' verbosity msg pkgid cname mb_insts = withFrozenCallStack $ do
+ noticeDoc verbosity $
+ case mb_insts of
+ Just insts | not (null insts) ->
+ hang (msg_doc <+> text "instantiated with") 2
+ (vcat [ disp k <+> text "=" <+> disp v
+ | (k,v) <- insts ]) $$
+ for_doc
+ _ ->
+ msg_doc <+> for_doc
+
+ where
+ msg_doc = text msg <+> text (showComponentName cname)
+ for_doc = text "for" <+> disp pkgid <<>> text ".."
diff --git a/cabal/Cabal/Distribution/Backpack/FullUnitId.hs b/cabal/Cabal/Distribution/Backpack/FullUnitId.hs
index cb5e3bf..fbc0538 100644
--- a/cabal/Cabal/Distribution/Backpack/FullUnitId.hs
+++ b/cabal/Cabal/Distribution/Backpack/FullUnitId.hs
@@ -7,7 +7,7 @@ module Distribution.Backpack.FullUnitId (
) where
import Distribution.Backpack
-import Distribution.Package
+import Distribution.Types.ComponentId
import Distribution.Compat.Prelude
-- Unlike OpenUnitId, which could direct to a UnitId.
diff --git a/cabal/Cabal/Distribution/Backpack/Id.hs b/cabal/Cabal/Distribution/Backpack/Id.hs
index a299163..afe9756 100644
--- a/cabal/Cabal/Distribution/Backpack/Id.hs
+++ b/cabal/Cabal/Distribution/Backpack/Id.hs
@@ -11,12 +11,16 @@ module Distribution.Backpack.Id(
import Prelude ()
import Distribution.Compat.Prelude
+import Distribution.Types.UnqualComponentName
import Distribution.Simple.Compiler hiding (Flag)
-import Distribution.Package
import Distribution.PackageDescription as PD hiding (Flag)
import Distribution.Simple.Setup as Setup
import qualified Distribution.Simple.InstallDirs as InstallDirs
import Distribution.Simple.LocalBuildInfo
+import Distribution.Types.ComponentId
+import Distribution.Types.PackageId
+import Distribution.Types.UnitId
+import Distribution.Types.MungedPackageName
import Distribution.Utils.Base62
import Distribution.Version
@@ -27,14 +31,15 @@ import Distribution.Text
-- for a package. The intent is that cabal-install (or the user) will
-- specify a more detailed IPID via the @--ipid@ flag if necessary.
computeComponentId
- :: Flag String
+ :: Bool -- deterministic mode
+ -> Flag String
-> Flag ComponentId
-> PackageIdentifier
-> ComponentName
-- This is used by cabal-install's legacy codepath
-> Maybe ([ComponentId], FlagAssignment)
-> ComponentId
-computeComponentId mb_ipid mb_cid pid cname mb_details =
+computeComponentId deterministic mb_ipid mb_cid pid cname mb_details =
-- show is found to be faster than intercalate and then replacement of
-- special character used in intercalating. We cannot simply hash by
-- doubly concating list, as it just flatten out the nested list, so
@@ -57,7 +62,8 @@ computeComponentId mb_ipid mb_cid pid cname mb_details =
where env = packageTemplateEnv pid (mkUnitId "")
actual_base = case mb_ipid of
Flag ipid0 -> explicit_base ipid0
- NoFlag -> generated_base
+ NoFlag | deterministic -> display pid
+ | otherwise -> generated_base
in case mb_cid of
Flag cid -> cid
NoFlag -> mkComponentId $ actual_base
@@ -65,55 +71,6 @@ computeComponentId mb_ipid mb_cid pid cname mb_details =
Nothing -> ""
Just s -> "-" ++ unUnqualComponentName s)
--- | Computes the package name for a library. If this is the public
--- library, it will just be the original package name; otherwise,
--- it will be a munged package name recording the original package
--- name as well as the name of the internal library.
---
--- A lot of tooling in the Haskell ecosystem assumes that if something
--- is installed to the package database with the package name 'foo',
--- then it actually is an entry for the (only public) library in package
--- 'foo'. With internal packages, this is not necessarily true:
--- a public library as well as arbitrarily many internal libraries may
--- come from the same package. To prevent tools from getting confused
--- in this case, the package name of these internal libraries is munged
--- so that they do not conflict the public library proper. A particular
--- case where this matters is ghc-pkg: if we don't munge the package
--- name, the inplace registration will OVERRIDE a different internal
--- library.
---
--- We munge into a reserved namespace, "z-", and encode both the
--- component name and the package name of an internal library using the
--- following format:
---
--- compat-pkg-name ::= "z-" package-name "-z-" library-name
---
--- where package-name and library-name have "-" ( "z" + ) "-"
--- segments encoded by adding an extra "z".
---
--- When we have the public library, the compat-pkg-name is just the
--- package-name, no surprises there!
---
-computeCompatPackageName :: PackageName -> ComponentName -> PackageName
--- First handle the cases where we can just use the original 'PackageName'.
--- This is for the PRIMARY library, and it is non-Backpack, or the
--- indefinite package for us.
-computeCompatPackageName pkg_name CLibName = pkg_name
-computeCompatPackageName pkg_name cname
- = mkPackageName $ "z-" ++ zdashcode (display pkg_name)
- ++ (case componentNameString cname of
- Just cname_u -> "-z-" ++ zdashcode cname_str
- where cname_str = unUnqualComponentName cname_u
- Nothing -> "")
-
-zdashcode :: String -> String
-zdashcode s = go s (Nothing :: Maybe Int) []
- where go [] _ r = reverse r
- go ('-':z) (Just n) r | n > 0 = go z (Just 0) ('-':'z':r)
- go ('-':z) _ r = go z (Just 0) ('-':r)
- go ('z':z) (Just n) r = go z (Just (n+1)) ('z':r)
- go (c:z) _ r = go z Nothing (c:r)
-
-- | In GHC 8.0, the string we pass to GHC to use for symbol
-- names for a package can be an arbitrary, IPID-compatible string.
-- However, prior to GHC 8.0 there are some restrictions on what
@@ -163,7 +120,7 @@ zdashcode s = go s (Nothing :: Maybe Int) []
--
computeCompatPackageKey
:: Compiler
- -> PackageName
+ -> MungedPackageName
-> Version
-> UnitId
-> String
diff --git a/cabal/Cabal/Distribution/Backpack/LinkedComponent.hs b/cabal/Cabal/Distribution/Backpack/LinkedComponent.hs
index c379a6b..29a0a92 100644
--- a/cabal/Cabal/Distribution/Backpack/LinkedComponent.hs
+++ b/cabal/Cabal/Distribution/Backpack/LinkedComponent.hs
@@ -3,6 +3,10 @@
-- | See <https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst>
module Distribution.Backpack.LinkedComponent (
LinkedComponent(..),
+ lc_insts,
+ lc_uid,
+ lc_cid,
+ lc_pkgid,
toLinkedComponent,
toLinkedComponents,
dispLinkedComponent,
@@ -16,21 +20,25 @@ import Distribution.Compat.Prelude hiding ((<>))
import Distribution.Backpack
import Distribution.Backpack.FullUnitId
import Distribution.Backpack.ConfiguredComponent
-import Distribution.Backpack.ModSubst
import Distribution.Backpack.ModuleShape
+import Distribution.Backpack.PreModuleShape
import Distribution.Backpack.ModuleScope
import Distribution.Backpack.UnifyM
import Distribution.Backpack.MixLink
import Distribution.Utils.MapAccum
+import Distribution.Types.AnnotatedId
+import Distribution.Types.ComponentName
import Distribution.Types.ModuleRenaming
import Distribution.Types.IncludeRenaming
+import Distribution.Types.ComponentInclude
+import Distribution.Types.ComponentId
+import Distribution.Types.PackageId
import Distribution.Package
import Distribution.PackageDescription as PD hiding (Flag)
import Distribution.ModuleName
import Distribution.Simple.LocalBuildInfo
import Distribution.Verbosity
-import Distribution.Utils.Progress
import Distribution.Utils.LogProgress
import qualified Data.Set as Set
@@ -40,60 +48,73 @@ import Data.Traversable
import Distribution.Text
( Text(disp) )
import Text.PrettyPrint
+import Data.Either
--- | A linked component, we know how it is instantiated and thus how we are
--- going to build it.
+-- | A linked component is a component that has been mix-in linked, at
+-- which point we have determined how all the dependencies of the
+-- component are explicitly instantiated (in the form of an OpenUnitId).
+-- 'ConfiguredComponent' is mix-in linked into 'LinkedComponent', which
+-- is then instantiated into 'ReadyComponent'.
data LinkedComponent
= LinkedComponent {
- lc_uid :: OpenUnitId,
- lc_cid :: ComponentId,
- lc_pkgid :: PackageId,
- lc_insts :: [(ModuleName, OpenModule)],
+ -- | Uniquely identifies linked component
+ lc_ann_id :: AnnotatedId ComponentId,
+ -- | Corresponds to 'cc_component'.
lc_component :: Component,
- lc_shape :: ModuleShape,
- -- | Local buildTools dependencies
- lc_internal_build_tools :: [OpenUnitId],
+ -- | @build-tools@ and @build-tool-depends@ dependencies.
+ -- Corresponds to 'cc_exe_deps'.
+ lc_exe_deps :: [AnnotatedId OpenUnitId],
+ -- | Is this the public library of a package? Corresponds to
+ -- 'cc_public'.
lc_public :: Bool,
- lc_includes :: [(OpenUnitId, ModuleRenaming)],
- -- PackageId here is a bit dodgy, but its just for
- -- BC so it shouldn't matter.
- lc_depends :: [(OpenUnitId, PackageId)]
+ -- | Corresponds to 'cc_includes', but (1) this does not contain
+ -- includes of signature packages (packages with no exports),
+ -- and (2) the 'ModuleRenaming' for requirements (stored in
+ -- 'IncludeRenaming') has been removed, as it is reflected in
+ -- 'OpenUnitId'.)
+ lc_includes :: [ComponentInclude OpenUnitId ModuleRenaming],
+ -- | Like 'lc_includes', but this specifies includes on
+ -- signature packages which have no exports.
+ lc_sig_includes :: [ComponentInclude OpenUnitId ModuleRenaming],
+ -- | The module shape computed by mix-in linking. This is
+ -- newly computed from 'ConfiguredComponent'
+ lc_shape :: ModuleShape
}
+-- | Uniquely identifies a 'LinkedComponent'. Corresponds to
+-- 'cc_cid'.
+lc_cid :: LinkedComponent -> ComponentId
+lc_cid = ann_id . lc_ann_id
+
+-- | Corresponds to 'cc_pkgid'.
+lc_pkgid :: LinkedComponent -> PackageId
+lc_pkgid = ann_pid . lc_ann_id
+
+-- | The 'OpenUnitId' of this component in the "default" instantiation.
+-- See also 'lc_insts'. 'LinkedComponent's cannot be instantiated
+-- (e.g., there is no 'ModSubst' instance for them).
+lc_uid :: LinkedComponent -> OpenUnitId
+lc_uid lc = IndefFullUnitId (lc_cid lc) . Map.fromList $ lc_insts lc
+
+-- | The instantiation of 'lc_uid'; this always has the invariant
+-- that it is a mapping from a module name @A@ to @<A>@ (the hole A).
+lc_insts :: LinkedComponent -> [(ModuleName, OpenModule)]
+lc_insts lc = [ (req, OpenModuleVar req)
+ | req <- Set.toList (modShapeRequires (lc_shape lc)) ]
+
dispLinkedComponent :: LinkedComponent -> Doc
dispLinkedComponent lc =
hang (text "unit" <+> disp (lc_uid lc)) 4 $
- vcat [ text "include" <+> disp uid <+> disp prov_rn
- | (uid, prov_rn) <- lc_includes lc ]
- -- YARRR $+$ dispModSubst (modShapeProvides (lc_shape lc))
+ vcat [ text "include" <+> disp (ci_id incl) <+> disp (ci_renaming incl)
+ | incl <- lc_includes lc ]
+ $+$
+ vcat [ text "signature include" <+> disp (ci_id incl)
+ | incl <- lc_sig_includes lc ]
+ $+$ dispOpenModuleSubst (modShapeProvides (lc_shape lc))
instance Package LinkedComponent where
packageId = lc_pkgid
-instance ModSubst LinkedComponent where
- modSubst subst lc
- = lc {
- lc_uid = modSubst subst (lc_uid lc),
- lc_insts = modSubst subst (lc_insts lc),
- lc_shape = modSubst subst (lc_shape lc),
- lc_includes = map (\(uid, rns) -> (modSubst subst uid, rns)) (lc_includes lc),
- lc_depends = map (\(uid, pkgid) -> (modSubst subst uid, pkgid)) (lc_depends lc)
- }
-
-{-
-instance IsNode LinkedComponent where
- type Key LinkedComponent = UnitId
- nodeKey = lc_uid
- nodeNeighbors n =
- if Set.null (openUnitIdFreeHoles (lc_uid n))
- then map fst (lc_depends n)
- else ordNub (map (generalizeUnitId . fst) (lc_depends n))
--}
-
--- We can't cache these values because they need to be changed
--- when we substitute over a 'LinkedComponent'. By varying
--- these over 'UnitId', we can support old GHCs. Nice!
-
toLinkedComponent
:: Verbosity
-> FullDb
@@ -102,10 +123,9 @@ toLinkedComponent
-> ConfiguredComponent
-> LogProgress LinkedComponent
toLinkedComponent verbosity db this_pid pkg_map ConfiguredComponent {
- cc_cid = this_cid,
- cc_pkgid = pkgid,
+ cc_ann_id = aid@AnnotatedId { ann_id = this_cid },
cc_component = component,
- cc_internal_build_tools = btools,
+ cc_exe_deps = exe_deps,
cc_public = is_public,
cc_includes = cid_includes
} = do
@@ -121,108 +141,150 @@ toLinkedComponent verbosity db this_pid pkg_map ConfiguredComponent {
exposedModules lib,
reexportedModules lib)
_ -> ([], [], [])
+ src_hidden = otherModules (componentBuildInfo component)
-- Take each included ComponentId and resolve it into an
-- *unlinked* unit identity. We will use unification (relying
-- on the ModuleShape) to resolve these into linked identities.
- unlinked_includes :: [((OpenUnitId, ModuleShape), PackageId, IncludeRenaming)]
- unlinked_includes = [ (lookupUid cid, pid, rns)
- | (cid, pid, rns) <- cid_includes ]
+ unlinked_includes :: [ComponentInclude (OpenUnitId, ModuleShape) IncludeRenaming]
+ unlinked_includes = [ ComponentInclude (fmap lookupUid dep_aid) rns i
+ | ComponentInclude dep_aid rns i <- cid_includes ]
lookupUid :: ComponentId -> (OpenUnitId, ModuleShape)
lookupUid cid = fromMaybe (error "linkComponent: lookupUid")
(Map.lookup cid pkg_map)
let orErr (Right x) = return x
- orErr (Left err) = failProgress (text err)
+ orErr (Left [err]) = dieProgress err
+ orErr (Left errs) = do
+ dieProgress (vcat (intersperse (text "") -- double newline!
+ [ hang (text "-") 2 err | err <- errs]))
+
+ -- Pre-shaping
+ let pre_shape = mixLinkPreModuleShape $
+ PreModuleShape {
+ preModShapeProvides = Set.fromList (src_provs ++ src_hidden),
+ preModShapeRequires = Set.fromList src_reqs
+ } : [ renamePreModuleShape (toPreModuleShape sh) rns
+ | ComponentInclude (AnnotatedId { ann_id = (_, sh) }) rns _ <- unlinked_includes ]
+ reqs = preModShapeRequires pre_shape
+ insts = [ (req, OpenModuleVar req)
+ | req <- Set.toList reqs ]
+ this_uid = IndefFullUnitId this_cid . Map.fromList $ insts
-- OK, actually do unification
-- TODO: the unification monad might return errors, in which
-- case we have to deal. Use monadic bind for now.
- (linked_shape0 :: ModuleScope,
- linked_deps :: [(OpenUnitId, PackageId)],
- linked_includes :: [(OpenUnitId, ModuleRenaming)]) <- orErr $ runUnifyM verbosity db $ do
+ (linked_shape0 :: ModuleScope,
+ linked_includes0 :: [ComponentInclude OpenUnitId ModuleRenaming],
+ linked_sig_includes0 :: [ComponentInclude OpenUnitId ModuleRenaming])
+ <- orErr $ runUnifyM verbosity this_cid db $ do
-- The unification monad is implemented using mutable
-- references. Thus, we must convert our *pure* data
-- structures into mutable ones to perform unification.
- --
+
+ let convertMod :: (ModuleName -> ModuleSource) -> ModuleName -> UnifyM s (ModuleScopeU s)
+ convertMod from m = do
+ m_u <- convertModule (OpenModule this_uid m)
+ return (Map.singleton m [WithSource (from m) m_u], Map.empty)
+ -- Handle 'exposed-modules'
+ exposed_mod_shapes_u <- mapM (convertMod FromExposedModules) src_provs
+ -- Handle 'other-modules'
+ other_mod_shapes_u <- mapM (convertMod FromOtherModules) src_hidden
+
+ -- Handle 'signatures'
let convertReq :: ModuleName -> UnifyM s (ModuleScopeU s)
convertReq req = do
req_u <- convertModule (OpenModuleVar req)
- return (Map.empty, Map.singleton req req_u)
- -- NB: We DON'T convert locally defined modules, as in the
- -- absence of mutual recursion across packages they
- -- cannot participate in mix-in linking.
- (shapes_u, includes_u) <- fmap unzip (mapM convertInclude unlinked_includes)
- src_reqs_u <- mapM convertReq src_reqs
+ return (Map.empty, Map.singleton req [WithSource (FromSignatures req) req_u])
+ req_shapes_u <- mapM convertReq src_reqs
+
+ -- Handle 'mixins'
+ (incl_shapes_u, all_includes_u) <- fmap unzip (mapM convertInclude unlinked_includes)
+
+ failIfErrs -- Prevent error cascade
-- Mix-in link everything! mixLink is the real workhorse.
- shape_u <- foldM mixLink emptyModuleScopeU (shapes_u ++ src_reqs_u)
+ shape_u <- mixLink $ exposed_mod_shapes_u
+ ++ other_mod_shapes_u
+ ++ req_shapes_u
+ ++ incl_shapes_u
+
+ -- src_reqs_u <- mapM convertReq src_reqs
-- Read out all the final results by converting back
-- into a pure representation.
- let convertIncludeU (uid_u, pid, rns) = do
- uid <- convertUnitIdU uid_u
- return ((uid, rns), (uid, pid))
+ let convertIncludeU (ComponentInclude dep_aid rns i) = do
+ uid <- convertUnitIdU (ann_id dep_aid)
+ return (ComponentInclude {
+ ci_ann_id = dep_aid { ann_id = uid },
+ ci_renaming = rns,
+ ci_implicit = i
+ })
shape <- convertModuleScopeU shape_u
- includes_deps <- mapM convertIncludeU includes_u
- let (incls, deps) = unzip includes_deps
- return (shape, deps, incls)
-
- -- linked_shape0 is almost complete, but it doesn't contain
- -- the actual modules we export ourselves. Add them!
- let reqs = modScopeRequires linked_shape0
- -- check that there aren't pre-filled requirements...
- insts = [ (req, OpenModuleVar req)
- | req <- Set.toList reqs ]
- this_uid = IndefFullUnitId this_cid . Map.fromList $ insts
+ let (includes_u, sig_includes_u) = partitionEithers all_includes_u
+ incls <- mapM convertIncludeU includes_u
+ sig_incls <- mapM convertIncludeU sig_includes_u
+ return (shape, incls, sig_incls)
+
+ let isNotLib (CLib _) = False
+ isNotLib _ = True
+ when (not (Set.null reqs) && isNotLib component) $
+ dieProgress $
+ hang (text "Non-library component has unfilled requirements:")
+ 4 (vcat [disp req | req <- Set.toList reqs])
- -- add the local exports to the scope
- local_exports = Map.fromListWith (++) $
- [ (mod_name, [ModuleSource (packageName this_pid)
- defaultIncludeRenaming
- (OpenModule this_uid mod_name)])
- | mod_name <- src_provs ]
- -- NB: do NOT include hidden modules here: GHC 7.10's ghc-pkg
- -- won't allow it (since someone could directly synthesize
- -- an 'InstalledPackageInfo' that violates abstraction.)
- -- Though, maybe it should be relaxed?
+ -- NB: do NOT include hidden modules here: GHC 7.10's ghc-pkg
+ -- won't allow it (since someone could directly synthesize
+ -- an 'InstalledPackageInfo' that violates abstraction.)
+ -- Though, maybe it should be relaxed?
+ let src_hidden_set = Set.fromList src_hidden
linked_shape = linked_shape0 {
- modScopeProvides =
- Map.unionWith (++)
- local_exports
- (modScopeProvides linked_shape0)
- }
+ modScopeProvides =
+ -- Would rather use withoutKeys but need BC
+ Map.filterWithKey
+ (\k _ -> not (k `Set.member` src_hidden_set))
+ (modScopeProvides linked_shape0)
+ }
-- OK, compute the reexports
-- TODO: This code reports the errors for reexports one reexport at
-- a time. Better to collect them all up and report them all at
-- once.
- reexports_list <- for src_reexports $ \reex@(ModuleReexport mb_pn from to) -> do
- let err :: Doc -> LogProgress a
- err s = failProgress
- $ hang (text "Problem with module re-export" <> quotes (disp reex)
- <+> colon) 2 s
+ let hdl :: [Either Doc a] -> LogProgress [a]
+ hdl es =
+ case partitionEithers es of
+ ([], rs) -> return rs
+ (ls, _) ->
+ dieProgress $
+ hang (text "Problem with module re-exports:") 2
+ (vcat [hang (text "-") 2 l | l <- ls])
+ reexports_list <- hdl . (flip map) src_reexports $ \reex@(ModuleReexport mb_pn from to) -> do
case Map.lookup from (modScopeProvides linked_shape) of
Just cands@(x0:xs0) -> do
-- Make sure there is at least one candidate
(x, xs) <-
case mb_pn of
Just pn ->
- case filter ((pn==) . msrc_pkgname) cands of
- (x1:xs1) -> return (x1, xs1)
- _ -> err (brokenReexportMsg reex)
+ let matches_pn (FromMixins pn' _ _) = pn == pn'
+ matches_pn (FromBuildDepends pn' _) = pn == pn'
+ matches_pn (FromExposedModules _) = pn == packageName this_pid
+ matches_pn (FromOtherModules _) = pn == packageName this_pid
+ matches_pn (FromSignatures _) = pn == packageName this_pid
+ in case filter (matches_pn . getSource) cands of
+ (x1:xs1) -> return (x1, xs1)
+ _ -> Left (brokenReexportMsg reex)
Nothing -> return (x0, xs0)
-- Test that all the candidates are consistent
- case filter (\x' -> msrc_module x /= msrc_module x') xs of
+ case filter (\x' -> unWithSource x /= unWithSource x') xs of
[] -> return ()
- _ -> err $ ambiguousReexportMsg reex (x:xs)
- return (to, msrc_module x)
+ _ -> Left $ ambiguousReexportMsg reex x xs
+ return (to, unWithSource x)
_ ->
- err (brokenReexportMsg reex)
+ Left (brokenReexportMsg reex)
-- TODO: maybe check this earlier; it's syntactically obvious.
let build_reexports m (k, v)
| Map.member k m =
- failProgress $ hsep
+ dieProgress $ hsep
[ text "Module name ", disp k, text " is exported multiple times." ]
| otherwise = return (Map.insert k v m)
provs <- foldM build_reexports Map.empty $
@@ -231,22 +293,47 @@ toLinkedComponent verbosity db this_pid pkg_map ConfiguredComponent {
[ (mod_name, OpenModule this_uid mod_name) | mod_name <- src_provs ] ++
reexports_list
- let final_linked_shape = ModuleShape provs (modScopeRequires linked_shape)
+ let final_linked_shape = ModuleShape provs (Map.keysSet (modScopeRequires linked_shape))
+
+ -- See Note Note [Signature package special case]
+ let (linked_includes, linked_sig_includes)
+ | Set.null reqs = (linked_includes0 ++ linked_sig_includes0, [])
+ | otherwise = (linked_includes0, linked_sig_includes0)
return $ LinkedComponent {
- lc_uid = this_uid,
- lc_cid = this_cid,
- lc_insts = insts,
- lc_pkgid = pkgid,
+ lc_ann_id = aid,
lc_component = component,
lc_public = is_public,
-- These must be executables
- lc_internal_build_tools = map (\cid -> IndefFullUnitId cid Map.empty) btools,
+ lc_exe_deps = map (fmap (\cid -> IndefFullUnitId cid Map.empty)) exe_deps,
lc_shape = final_linked_shape,
lc_includes = linked_includes,
- lc_depends = linked_deps
+ lc_sig_includes = linked_sig_includes
}
+-- Note [Signature package special case]
+-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+-- Suppose we have p-indef, which depends on str-sig and inherits
+-- the hole from that signature package. When we instantiate p-indef,
+-- it's a bit pointless to also go ahead and build str-sig, because
+-- str-sig cannot possibly have contributed any code to the package
+-- in question. Furthermore, because the signature was inherited to
+-- p-indef, if we test matching against p-indef, we also have tested
+-- matching against p-sig. In fact, skipping p-sig is *mandatory*,
+-- because p-indef may have thinned it (so that an implementation may
+-- match p-indef but not p-sig.)
+--
+-- However, suppose that we have a package which mixes together str-sig
+-- and str-bytestring, with the intent of *checking* that str-sig is
+-- implemented by str-bytestring. Here, it's quite important to
+-- build an instantiated str-sig, since that is the only way we will
+-- actually end up testing if the matching works. Note that this
+-- admonition only applies if the package has NO requirements; if it
+-- has any requirements, we will typecheck it as an indefinite
+-- package, at which point the signature includes will be passed to
+-- GHC who will in turn actually do the checking to make sure they
+-- are instantiated correctly.
+
-- Handle mix-in linking for components. In the absence of Backpack,
-- every ComponentId gets converted into a UnitId by way of SimpleUnitId.
toLinkedComponents
@@ -263,7 +350,8 @@ toLinkedComponents verbosity db this_pid lc_map0 comps
-> ConfiguredComponent
-> LogProgress (Map ComponentId (OpenUnitId, ModuleShape), LinkedComponent)
go lc_map cc = do
- lc <- toLinkedComponent verbosity db this_pid lc_map cc
+ lc <- addProgressCtx (text "In the stanza" <+> text (componentNameStanza (cc_name cc))) $
+ toLinkedComponent verbosity db this_pid lc_map cc
return (extendLinkedComponentMap lc lc_map, lc)
type LinkedComponentMap = Map ComponentId (OpenUnitId, ModuleShape)
@@ -276,32 +364,36 @@ extendLinkedComponentMap lc m =
brokenReexportMsg :: ModuleReexport -> Doc
brokenReexportMsg (ModuleReexport (Just pn) from _to) =
- text "The package" <+> disp pn <+>
- text "does not export a module" <+> disp from
+ vcat [ text "The package" <+> quotes (disp pn)
+ , text "does not export a module" <+> quotes (disp from) ]
brokenReexportMsg (ModuleReexport Nothing from _to) =
- text "The module" <+> disp from <+>
- text "is not exported by any suitable package." <+>
- text "It occurs in neither the 'exposed-modules' of this package," <+>
- text "nor any of its 'build-depends' dependencies."
-
-ambiguousReexportMsg :: ModuleReexport -> [ModuleSource] -> Doc
-ambiguousReexportMsg (ModuleReexport mb_pn from _to) ys =
- text "The module" <+> disp from <+>
- text "is (differently) exported by more than one package" <+>
- parens (hsep (punctuate comma [displaySource y | y <- ys])) <+>
- text "making the re-export ambiguous." <+> help_msg mb_pn
+ vcat [ text "The module" <+> quotes (disp from)
+ , text "is not exported by any suitable package."
+ , text "It occurs in neither the 'exposed-modules' of this package,"
+ , text "nor any of its 'build-depends' dependencies." ]
+
+ambiguousReexportMsg :: ModuleReexport -> ModuleWithSource -> [ModuleWithSource] -> Doc
+ambiguousReexportMsg (ModuleReexport mb_pn from _to) y1 ys =
+ vcat [ text "Ambiguous reexport" <+> quotes (disp from)
+ , hang (text "It could refer to either:") 2
+ (vcat (msg : msgs))
+ , help_msg mb_pn ]
where
+ msg = text " " <+> displayModuleWithSource y1
+ msgs = [text "or" <+> displayModuleWithSource y | y <- ys]
help_msg Nothing =
- text "The ambiguity can be resolved by qualifying the" <+>
- text "re-export with a package name." <+>
- text "The syntax is 'packagename:ModuleName [as NewName]'."
+ -- TODO: This advice doesn't help if the ambiguous exports
+ -- come from a package named the same thing
+ vcat [ text "The ambiguity can be resolved by qualifying the"
+ , text "re-export with a package name."
+ , text "The syntax is 'packagename:ModuleName [as NewName]'." ]
-- Qualifying won't help that much.
help_msg (Just _) =
- text "The ambiguity can be resolved by introducing a" <+>
- text "backpack-include field to rename one of the module" <+>
- text "names differently."
- displaySource y
- | not (isDefaultIncludeRenaming (msrc_renaming y))
- = disp (msrc_pkgname y) <+> text "with renaming" <+>
- disp (includeProvidesRn (msrc_renaming y))
- | otherwise = disp (msrc_pkgname y)
+ vcat [ text "The ambiguity can be resolved by using the"
+ , text "mixins field to rename one of the module"
+ , text "names differently." ]
+ displayModuleWithSource y
+ = vcat [ quotes (disp (unWithSource y))
+ , text "brought into scope by" <+>
+ dispModuleSource (getSource y)
+ ]
diff --git a/cabal/Cabal/Distribution/Backpack/MixLink.hs b/cabal/Cabal/Distribution/Backpack/MixLink.hs
index 06e6352..6d560f3 100644
--- a/cabal/Cabal/Distribution/Backpack/MixLink.hs
+++ b/cabal/Cabal/Distribution/Backpack/MixLink.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE NondecreasingIndentation #-}
-- | See <https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst>
module Distribution.Backpack.MixLink (
mixLink,
@@ -9,13 +10,14 @@ import Distribution.Compat.Prelude hiding (mod)
import Distribution.Backpack
import Distribution.Backpack.UnifyM
import Distribution.Backpack.FullUnitId
+import Distribution.Backpack.ModuleScope
import qualified Distribution.Utils.UnionFind as UnionFind
import Distribution.ModuleName
import Distribution.Text
-import Distribution.Types.IncludeRenaming
-import Distribution.Package
+import Distribution.Types.ComponentId
+import Text.PrettyPrint
import Control.Monad
import qualified Data.Map as Map
import qualified Data.Foldable as F
@@ -24,46 +26,77 @@ import qualified Data.Foldable as F
-- Linking
-- | Given to scopes of provisions and requirements, link them together.
-mixLink :: ModuleScopeU s -> ModuleScopeU s -> UnifyM s (ModuleScopeU s)
-mixLink (provs1, reqs1) (provs2, reqs2) = do
- F.sequenceA_ (Map.intersectionWithKey linkProvision provs1 reqs2)
- F.sequenceA_ (Map.intersectionWithKey linkProvision provs2 reqs1)
- -- TODO: would be more efficient to collapse provision lists when we
- -- unify them.
- return (Map.unionWith (++) provs1 provs2,
- -- NB: NOT the difference of the unions. That implies
- -- self-unification not allowed. (But maybe requirement prov is disjoint
- -- from reqs makes this a moot point?)
- Map.union (Map.difference reqs1 provs2)
- (Map.difference reqs2 provs1))
-
-displaySource :: ModuleSourceU s -> String
-displaySource src
- | isDefaultIncludeRenaming (usrc_renaming src)
- = display (usrc_pkgname src)
- | otherwise
- = display (usrc_pkgname src) ++ " with renaming " ++ display (usrc_renaming src)
+mixLink :: [ModuleScopeU s] -> UnifyM s (ModuleScopeU s)
+mixLink scopes = do
+ let provs = Map.unionsWith (++) (map fst scopes)
+ -- Invariant: any identically named holes refer to same mutable cell
+ reqs = Map.unionsWith (++) (map snd scopes)
+ filled = Map.intersectionWithKey linkProvision provs reqs
+ F.sequenceA_ filled
+ let remaining = Map.difference reqs filled
+ return (provs, remaining)
-- | Link a list of possibly provided modules to a single
-- requirement. This applies a side-condition that all
-- of the provided modules at the same name are *actually*
-- the same module.
-linkProvision :: ModuleName -> [ModuleSourceU s] -> ModuleU s
- -> UnifyM s [ModuleSourceU s]
-linkProvision _ [] _reqs = error "linkProvision"
-linkProvision mod_name ret@(prov:provs) req = do
+linkProvision :: ModuleName
+ -> [ModuleWithSourceU s] -- provs
+ -> [ModuleWithSourceU s] -- reqs
+ -> UnifyM s [ModuleWithSourceU s]
+linkProvision mod_name ret@(prov:provs) (req:reqs) = do
+ -- TODO: coalesce all the non-unifying modules together
forM_ provs $ \prov' -> do
- let msg = "Ambiguous module " ++ display mod_name ++ " " ++
- "when trying to fill requirement. It could refer to " ++
- "a module included from " ++ displaySource prov ++ " " ++
- "or module included from " ++ displaySource prov' ++ ". " ++
- "Ambiguity occurred because "
- withContext msg (usrc_module prov) (usrc_module prov') $
- unifyModule (usrc_module prov) (usrc_module prov')
- let msg = "Could not fill requirement " ++ display mod_name ++ "because "
- withContext msg (usrc_module prov) req $
- unifyModule (usrc_module prov) req
+ -- Careful: read it out BEFORE unifying, because the
+ -- unification algorithm preemptively unifies modules
+ mod <- convertModuleU (unWithSource prov)
+ mod' <- convertModuleU (unWithSource prov')
+ r <- unify prov prov'
+ case r of
+ Just () -> return ()
+ Nothing -> do
+ addErr $
+ text "Ambiguous module" <+> quotes (disp mod_name) $$
+ text "It could refer to" <+>
+ ( text " " <+> (quotes (disp mod) $$ in_scope_by (getSource prov)) $$
+ text "or" <+> (quotes (disp mod') $$ in_scope_by (getSource prov')) ) $$
+ link_doc
+ mod <- convertModuleU (unWithSource prov)
+ req_mod <- convertModuleU (unWithSource req)
+ self_cid <- fmap unify_self_cid getUnifEnv
+ case mod of
+ OpenModule (IndefFullUnitId cid _) _
+ | cid == self_cid -> addErr $
+ text "Cannot instantiate requirement" <+> quotes (disp mod_name) <+>
+ in_scope_by (getSource req) $$
+ text "with locally defined module" <+> in_scope_by (getSource prov) $$
+ text "as this would create a cyclic dependency, which GHC does not support." $$
+ text "Try moving this module to a separate library, e.g.," $$
+ text "create a new stanza: library 'sublib'."
+ _ -> return ()
+ r <- unify prov req
+ case r of
+ Just () -> return ()
+ Nothing -> do
+ -- TODO: Record and report WHERE the bad constraint came from
+ addErr $ text "Could not instantiate requirement" <+> quotes (disp mod_name) $$
+ nest 4 (text "Expected:" <+> disp mod $$
+ text "Actual: " <+> disp req_mod) $$
+ parens (text "This can occur if an exposed module of" <+>
+ text "a libraries shares a name with another module.") $$
+ link_doc
return ret
+ where
+ unify s1 s2 = tryM $ addErrContext short_link_doc
+ $ unifyModule (unWithSource s1) (unWithSource s2)
+ in_scope_by s = text "brought into scope by" <+> dispModuleSource s
+ short_link_doc = text "While filling requirement" <+> quotes (disp mod_name)
+ link_doc = text "While filling requirements of" <+> reqs_doc
+ reqs_doc
+ | null reqs = dispModuleSource (getSource req)
+ | otherwise = ( text " " <+> dispModuleSource (getSource req) $$
+ vcat [ text "and" <+> dispModuleSource (getSource r) | r <- reqs])
+linkProvision _ _ _ = error "linkProvision"
@@ -83,9 +116,9 @@ unifyUnitId uid1_u uid2_u
(UnitIdThunkU u1, UnitIdThunkU u2)
| u1 == u2 -> return ()
| otherwise ->
- unifyFail $
- "pre-installed unit IDs " ++ display u1 ++
- " and " ++ display u2 ++ " do not match."
+ failWith $ hang (text "Couldn't match unit IDs:") 4
+ (text " " <+> disp u1 $$
+ text "and" <+> disp u2)
(UnitIdThunkU uid1, UnitIdU _ cid2 insts2)
-> unifyThunkWith cid2 insts2 uid2_u uid1 uid1_u
(UnitIdU _ cid1 insts1, UnitIdThunkU uid2)
@@ -116,9 +149,10 @@ unifyInner cid1 insts1 uid1_u cid2 insts2 uid2_u = do
when (cid1 /= cid2) $
-- TODO: if we had a package identifier, could be an
-- easier to understand error message.
- unifyFail $
- "component IDs " ++
- display cid1 ++ " and " ++ display cid2 ++ " do not match."
+ failWith $
+ hang (text "Couldn't match component IDs:") 4
+ (text " " <+> disp cid1 $$
+ text "and" <+> disp cid2)
-- The KEY STEP which makes this a Huet-style unification
-- algorithm. (Also a payoff of using union-find.)
-- We can build infinite unit IDs this way, which is necessary
@@ -140,10 +174,10 @@ unifyModule mod1_u mod2_u
(_, ModuleVarU _) -> liftST $ UnionFind.union mod2_u mod1_u
(ModuleU uid1 mod_name1, ModuleU uid2 mod_name2) -> do
when (mod_name1 /= mod_name2) $
- unifyFail $
- "module names " ++
- display mod_name1 ++ " and " ++
- display mod_name2 ++ " disagree."
+ failWith $
+ hang (text "Cannot match module names") 4 $
+ text " " <+> disp mod_name1 $$
+ text "and" <+> disp mod_name2
-- NB: this is not actually necessary (because we'll
-- detect loops eventually in 'unifyUnitId'), but it
-- seems harmless enough
diff --git a/cabal/Cabal/Distribution/Backpack/ModuleScope.hs b/cabal/Cabal/Distribution/Backpack/ModuleScope.hs
index f2477a7..8926a61 100644
--- a/cabal/Cabal/Distribution/Backpack/ModuleScope.hs
+++ b/cabal/Cabal/Distribution/Backpack/ModuleScope.hs
@@ -1,25 +1,35 @@
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE DeriveFoldable #-}
-- | See <https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst>
module Distribution.Backpack.ModuleScope (
-- * Module scopes
ModuleScope(..),
ModuleProvides,
+ ModuleRequires,
ModuleSource(..),
+ dispModuleSource,
+ WithSource(..),
+ unWithSource,
+ getSource,
+ ModuleWithSource,
emptyModuleScope,
) where
import Prelude ()
+import Distribution.Compat.Prelude
import Distribution.ModuleName
-import Distribution.Package
import Distribution.Types.IncludeRenaming
+import Distribution.Types.PackageName
+import Distribution.Types.ComponentName
import Distribution.Backpack
import Distribution.Backpack.ModSubst
+import Distribution.Text
-import Data.Map (Map)
import qualified Data.Map as Map
-import Data.Set (Set)
-import qualified Data.Set as Set
+import Text.PrettyPrint
-----------------------------------------------------------------------
@@ -58,29 +68,64 @@ import qualified Data.Set as Set
-- can influence the 'ModuleShape' via a reexport.
data ModuleScope = ModuleScope {
modScopeProvides :: ModuleProvides,
- modScopeRequires :: Set ModuleName
+ modScopeRequires :: ModuleRequires
}
+-- | An empty 'ModuleScope'.
+emptyModuleScope :: ModuleScope
+emptyModuleScope = ModuleScope Map.empty Map.empty
+
-- | Every 'Module' in scope at a 'ModuleName' is annotated with
-- the 'PackageName' it comes from.
-type ModuleProvides = Map ModuleName [ModuleSource]
-data ModuleSource =
- ModuleSource {
- -- We don't have line numbers, but if we did the
- -- package name and renaming could be associated
- -- with that as well
- msrc_pkgname :: PackageName,
- msrc_renaming :: IncludeRenaming,
- msrc_module :: OpenModule
- }
+type ModuleProvides = Map ModuleName [ModuleWithSource]
+-- | INVARIANT: entries for ModuleName m, have msrc_module is OpenModuleVar m
+type ModuleRequires = Map ModuleName [ModuleWithSource]
+-- TODO: consider newtping the two types above.
-instance ModSubst ModuleScope where
- modSubst subst (ModuleScope provs reqs)
- = ModuleScope (modSubst subst provs) (modSubst subst reqs)
+-- | Description of where a module participating in mixin linking came
+-- from.
+data ModuleSource
+ = FromMixins PackageName ComponentName IncludeRenaming
+ | FromBuildDepends PackageName ComponentName
+ | FromExposedModules ModuleName
+ | FromOtherModules ModuleName
+ | FromSignatures ModuleName
+-- We don't have line numbers, but if we did, we'd want to record that
+-- too
--- | An empty 'ModuleScope'.
-emptyModuleScope :: ModuleScope
-emptyModuleScope = ModuleScope Map.empty Set.empty
+-- TODO: Deduplicate this with Distribution.Backpack.UnifyM.ci_msg
+dispModuleSource :: ModuleSource -> Doc
+dispModuleSource (FromMixins pn cn incls)
+ = text "mixins:" <+> dispComponent pn cn <+> disp incls
+dispModuleSource (FromBuildDepends pn cn)
+ = text "build-depends:" <+> dispComponent pn cn
+dispModuleSource (FromExposedModules m)
+ = text "exposed-modules:" <+> disp m
+dispModuleSource (FromOtherModules m)
+ = text "other-modules:" <+> disp m
+dispModuleSource (FromSignatures m)
+ = text "signatures:" <+> disp m
+
+-- Dependency
+dispComponent :: PackageName -> ComponentName -> Doc
+dispComponent pn cn =
+ -- NB: This syntax isn't quite the source syntax, but it
+ -- should be clear enough. To do source syntax, we'd
+ -- need to know what the package we're linking is.
+ case cn of
+ CLibName -> disp pn
+ CSubLibName ucn -> disp pn <<>> colon <<>> disp ucn
+ -- Case below shouldn't happen
+ _ -> disp pn <+> parens (disp cn)
+
+-- | An 'OpenModule', annotated with where it came from in a Cabal file.
+data WithSource a = WithSource ModuleSource a
+ deriving (Functor, Foldable, Traversable)
+unWithSource :: WithSource a -> a
+unWithSource (WithSource _ x) = x
+getSource :: WithSource a -> ModuleSource
+getSource (WithSource s _) = s
+type ModuleWithSource = WithSource OpenModule
-instance ModSubst ModuleSource where
- modSubst subst src = src { msrc_module = modSubst subst (msrc_module src) }
+instance ModSubst a => ModSubst (WithSource a) where
+ modSubst subst (WithSource s m) = WithSource s (modSubst subst m)
diff --git a/cabal/Cabal/Distribution/Backpack/PreExistingComponent.hs b/cabal/Cabal/Distribution/Backpack/PreExistingComponent.hs
index 099481b..b1ed962 100644
--- a/cabal/Cabal/Distribution/Backpack/PreExistingComponent.hs
+++ b/cabal/Cabal/Distribution/Backpack/PreExistingComponent.hs
@@ -5,12 +5,19 @@ module Distribution.Backpack.PreExistingComponent (
) where
import Prelude ()
+import Distribution.Compat.Prelude
import Distribution.Backpack.ModuleShape
import Distribution.Backpack
+import Distribution.Types.ComponentId
+import Distribution.Types.MungedPackageId
+import Distribution.Types.PackageId
+import Distribution.Types.UnitId
+import Distribution.Types.ComponentName
+import Distribution.Types.PackageName
+import Distribution.Package
import qualified Data.Map as Map
-import Distribution.Package
import qualified Distribution.InstalledPackageInfo as Installed
import Distribution.InstalledPackageInfo (InstalledPackageInfo)
@@ -18,13 +25,14 @@ import Distribution.InstalledPackageInfo (InstalledPackageInfo)
-- we don't need to know how to build.
data PreExistingComponent
= PreExistingComponent {
- -- | The 'PackageName' that, when we see it in 'PackageDescription',
- -- we should map this to. This may DISAGREE with 'pc_pkgid' for
- -- internal dependencies: e.g., an internal component @lib@
- -- may be munged to @z-pkg-z-lib@, but we still want to use
- -- it when we see @lib@ in @build-depends@
+ -- | The actual name of the package. This may DISAGREE with 'pc_pkgid'
+ -- for internal dependencies: e.g., an internal component @lib@ may be
+ -- munged to @z-pkg-z-lib@, but we still want to use it when we see
+ -- @lib@ in @build-depends@
pc_pkgname :: PackageName,
- pc_pkgid :: PackageId,
+ -- | The actual name of the component.
+ pc_compname :: ComponentName,
+ pc_munged_id :: MungedPackageId,
pc_uid :: UnitId,
pc_cid :: ComponentId,
pc_open_uid :: OpenUnitId,
@@ -34,11 +42,12 @@ data PreExistingComponent
-- | Convert an 'InstalledPackageInfo' into a 'PreExistingComponent',
-- which was brought into scope under the 'PackageName' (important for
-- a package qualified reference.)
-ipiToPreExistingComponent :: (PackageName, InstalledPackageInfo) -> PreExistingComponent
-ipiToPreExistingComponent (pn, ipi) =
+ipiToPreExistingComponent :: InstalledPackageInfo -> PreExistingComponent
+ipiToPreExistingComponent ipi =
PreExistingComponent {
- pc_pkgname = pn,
- pc_pkgid = Installed.sourcePackageId ipi,
+ pc_pkgname = packageName ipi,
+ pc_compname = libraryComponentName $ Installed.sourceLibName ipi,
+ pc_munged_id = mungedId ipi,
pc_uid = Installed.installedUnitId ipi,
pc_cid = Installed.installedComponentId ipi,
pc_open_uid =
@@ -47,3 +56,12 @@ ipiToPreExistingComponent (pn, ipi) =
pc_shape = shapeInstalledPackage ipi
}
+instance HasMungedPackageId PreExistingComponent where
+ mungedId = pc_munged_id
+
+instance Package PreExistingComponent where
+ packageId pec = PackageIdentifier (pc_pkgname pec) v
+ where MungedPackageId _ v = pc_munged_id pec
+
+instance HasUnitId PreExistingComponent where
+ installedUnitId = pc_uid
diff --git a/cabal/Cabal/Distribution/Backpack/PreModuleShape.hs b/cabal/Cabal/Distribution/Backpack/PreModuleShape.hs
new file mode 100644
index 0000000..177e637
--- /dev/null
+++ b/cabal/Cabal/Distribution/Backpack/PreModuleShape.hs
@@ -0,0 +1,45 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+
+module Distribution.Backpack.PreModuleShape (
+ PreModuleShape(..),
+ toPreModuleShape,
+ renamePreModuleShape,
+ mixLinkPreModuleShape,
+) where
+
+import Prelude ()
+import Distribution.Compat.Prelude
+
+import Data.Set (Set)
+import qualified Data.Set as Set
+import qualified Data.Map as Map
+
+import Distribution.Backpack.ModuleShape
+import Distribution.Types.IncludeRenaming
+import Distribution.Types.ModuleRenaming
+import Distribution.ModuleName
+
+data PreModuleShape = PreModuleShape {
+ preModShapeProvides :: Set ModuleName,
+ preModShapeRequires :: Set ModuleName
+ }
+ deriving (Eq, Show, Generic)
+
+toPreModuleShape :: ModuleShape -> PreModuleShape
+toPreModuleShape (ModuleShape provs reqs) = PreModuleShape (Map.keysSet provs) reqs
+
+renamePreModuleShape :: PreModuleShape -> IncludeRenaming -> PreModuleShape
+renamePreModuleShape (PreModuleShape provs reqs) (IncludeRenaming prov_rn req_rn) =
+ PreModuleShape
+ (Set.fromList (mapMaybe prov_fn (Set.toList provs)))
+ (Set.map req_fn reqs)
+ where
+ prov_fn = interpModuleRenaming prov_rn
+ req_fn k = fromMaybe k (interpModuleRenaming req_rn k)
+
+mixLinkPreModuleShape :: [PreModuleShape] -> PreModuleShape
+mixLinkPreModuleShape shapes = PreModuleShape provs (Set.difference reqs provs)
+ where
+ provs = Set.unions (map preModShapeProvides shapes)
+ reqs = Set.unions (map preModShapeRequires shapes)
diff --git a/cabal/Cabal/Distribution/Backpack/ReadyComponent.hs b/cabal/Cabal/Distribution/Backpack/ReadyComponent.hs
index bd9e8b7..db09121 100644
--- a/cabal/Cabal/Distribution/Backpack/ReadyComponent.hs
+++ b/cabal/Cabal/Distribution/Backpack/ReadyComponent.hs
@@ -5,8 +5,9 @@ module Distribution.Backpack.ReadyComponent (
ReadyComponent(..),
InstantiatedComponent(..),
IndefiniteComponent(..),
- rc_compat_name,
- rc_compat_key,
+ rc_depends,
+ rc_uid,
+ rc_pkgid,
dispReadyComponent,
toReadyComponents,
) where
@@ -15,18 +16,26 @@ import Prelude ()
import Distribution.Compat.Prelude hiding ((<>))
import Distribution.Backpack
-import Distribution.Backpack.Id
import Distribution.Backpack.LinkedComponent
import Distribution.Backpack.ModuleShape
+import Distribution.Types.AnnotatedId
import Distribution.Types.ModuleRenaming
import Distribution.Types.Component
+import Distribution.Types.ComponentInclude
+import Distribution.Types.ComponentId
+import Distribution.Types.ComponentName
+import Distribution.Types.PackageId
+import Distribution.Types.UnitId
import Distribution.Compat.Graph (IsNode(..))
+import Distribution.Types.Module
+import Distribution.Types.MungedPackageId
+import Distribution.Types.MungedPackageName
+import Distribution.Types.Library
import Distribution.ModuleName
import Distribution.Package
import Distribution.Simple.Utils
-import Distribution.Simple.Compiler
import qualified Control.Applicative as A
import qualified Data.Traversable as T
@@ -38,44 +47,112 @@ import qualified Data.Map as Map
import Distribution.Version
import Distribution.Text
--- | An instantiated component is simply a linked component which
--- may have a fully instantiated 'UnitId'. When we do mix-in linking,
--- we only do each component in its most general form; instantiation
--- then takes all of the fully instantiated components and recursively
--- discovers what other instantiated components we need to build
--- before we can build them.
+-- | A 'ReadyComponent' is one that we can actually generate build
+-- products for. We have a ready component for the typecheck-only
+-- products of every indefinite package, as well as a ready component
+-- for every way these packages can be fully instantiated.
--
+data ReadyComponent
+ = ReadyComponent {
+ rc_ann_id :: AnnotatedId UnitId,
+ -- | The 'OpenUnitId' for this package. At the moment, this
+ -- is used in only one case, which is to determine if an
+ -- export is of a module from this library (indefinite
+ -- libraries record these exports as 'OpenModule');
+ -- 'rc_open_uid' can be conveniently used to test for
+ -- equality, whereas 'UnitId' cannot always be used in this
+ -- case.
+ rc_open_uid :: OpenUnitId,
+ -- | Corresponds to 'lc_cid'. Invariant: if 'rc_open_uid'
+ -- records a 'ComponentId', it coincides with this one.
+ rc_cid :: ComponentId,
+ -- | Corresponds to 'lc_component'.
+ rc_component :: Component,
+ -- | Corresponds to 'lc_exe_deps'.
+ -- Build-tools don't participate in mix-in linking.
+ -- (but what if they could?)
+ rc_exe_deps :: [AnnotatedId UnitId],
+ -- | Corresponds to 'lc_public'.
+ rc_public :: Bool,
+ -- | Extra metadata depending on whether or not this is an
+ -- indefinite library (typechecked only) or an instantiated
+ -- component (can be compiled).
+ rc_i :: Either IndefiniteComponent InstantiatedComponent
+ }
+
+-- | The final, string 'UnitId' that will uniquely identify
+-- the compilation products of this component.
+rc_uid :: ReadyComponent -> UnitId
+rc_uid = ann_id . rc_ann_id
+
+-- | Corresponds to 'lc_pkgid'.
+rc_pkgid :: ReadyComponent -> PackageId
+rc_pkgid = ann_pid . rc_ann_id
+-- | An 'InstantiatedComponent' is a library which is fully instantiated
+-- (or, possibly, has no requirements at all.)
data InstantiatedComponent
= InstantiatedComponent {
+ -- | How this library was instantiated.
instc_insts :: [(ModuleName, Module)],
+ -- | Dependencies induced by 'instc_insts'. These are recorded
+ -- here because there isn't a convenient way otherwise to get
+ -- the 'PackageId' we need to fill 'componentPackageDeps' as needed.
+ instc_insts_deps :: [(UnitId, MungedPackageId)],
+ -- | The modules exported/reexported by this library.
instc_provides :: Map ModuleName Module,
- instc_includes :: [(DefUnitId, ModuleRenaming)]
+ -- | The dependencies which need to be passed to the compiler
+ -- to bring modules into scope. These always refer to installed
+ -- fully instantiated libraries.
+ instc_includes :: [ComponentInclude DefUnitId ModuleRenaming]
}
+-- | An 'IndefiniteComponent' is a library with requirements
+-- which we will typecheck only.
data IndefiniteComponent
= IndefiniteComponent {
+ -- | The requirements of the library.
indefc_requires :: [ModuleName],
+ -- | The modules exported/reexported by this library.
indefc_provides :: Map ModuleName OpenModule,
- indefc_includes :: [(OpenUnitId, ModuleRenaming)]
+ -- | The dependencies which need to be passed to the compiler
+ -- to bring modules into scope. These are 'OpenUnitId' because
+ -- these may refer to partially instantiated libraries.
+ indefc_includes :: [ComponentInclude OpenUnitId ModuleRenaming]
}
-data ReadyComponent
- = ReadyComponent {
- rc_uid :: UnitId,
- rc_open_uid :: OpenUnitId,
- rc_cid :: ComponentId,
- rc_pkgid :: PackageId,
- rc_component :: Component,
- -- build-tools don't participate in mix-in linking.
- -- (but what if they cold?)
- rc_internal_build_tools :: [DefUnitId],
- rc_public :: Bool,
- -- PackageId here is a bit dodgy, but its just for
- -- BC so it shouldn't matter.
- rc_depends :: [(UnitId, PackageId)],
- rc_i :: Either IndefiniteComponent InstantiatedComponent
- }
+-- | Compute the dependencies of a 'ReadyComponent' that should
+-- be recorded in the @depends@ field of 'InstalledPackageInfo'.
+rc_depends :: ReadyComponent -> [(UnitId, MungedPackageId)]
+rc_depends rc = ordNub $
+ case rc_i rc of
+ Left indefc ->
+ map (\ci -> (abstractUnitId $ ci_id ci, toMungedPackageId ci))
+ (indefc_includes indefc)
+ Right instc ->
+ map (\ci -> (unDefUnitId $ ci_id ci, toMungedPackageId ci))
+ (instc_includes instc)
+ ++ instc_insts_deps instc
+ where
+ toMungedPackageId :: Text id => ComponentInclude id rn -> MungedPackageId
+ toMungedPackageId ci =
+ computeCompatPackageId
+ (ci_pkgid ci)
+ (case ci_cname ci of
+ CLibName -> Nothing
+ CSubLibName uqn -> Just uqn
+ _ -> error $ display (rc_cid rc) ++
+ " depends on non-library " ++ display (ci_id ci))
+
+-- | Get the 'MungedPackageId' of a 'ReadyComponent' IF it is
+-- a library.
+rc_munged_id :: ReadyComponent -> MungedPackageId
+rc_munged_id rc =
+ computeCompatPackageId
+ (rc_pkgid rc)
+ (case rc_component rc of
+ CLib lib -> libName lib
+ _ -> error "rc_munged_id: not library")
instance Package ReadyComponent where
packageId = rc_pkgid
@@ -93,22 +170,8 @@ instance IsNode ReadyComponent where
| otherwise
-> [newSimpleUnitId (rc_cid rc)]
_ -> []) ++
- ordNub (map fst (rc_depends rc))
-
-rc_compat_name :: ReadyComponent -> PackageName
-rc_compat_name ReadyComponent{
- rc_pkgid = PackageIdentifier pkg_name _,
- rc_component = component
- }
- = computeCompatPackageName pkg_name (componentName component)
-
-rc_compat_key :: ReadyComponent -> Compiler -> String
-rc_compat_key rc@ReadyComponent {
- rc_pkgid = PackageIdentifier _ pkg_ver,
- rc_uid = uid
- } comp -- TODO: A wart. But the alternative is to store
- -- the Compiler in the LinkedComponent
- = computeCompatPackageKey comp (rc_compat_name rc) pkg_ver uid
+ ordNub (map fst (rc_depends rc)) ++
+ map ann_id (rc_exe_deps rc)
dispReadyComponent :: ReadyComponent -> Doc
dispReadyComponent rc =
@@ -162,7 +225,7 @@ instance Monad InstM where
-- instantiated components are given 'HashedUnitId'.
--
toReadyComponents
- :: Map UnitId PackageId
+ :: Map UnitId MungedPackageId
-> Map ModuleName Module -- subst for the public component
-> [LinkedComponent]
-> [ReadyComponent]
@@ -194,14 +257,13 @@ toReadyComponents pid_map subst0 comps
-> InstM (Maybe ReadyComponent)
instantiateComponent uid cid insts
| Just lc <- Map.lookup cid cmap = do
- deps <- forM (lc_depends lc) $ \(x, y) -> do
- x' <- substUnitId insts x
- return (x', y)
provides <- T.mapM (substModule insts) (modShapeProvides (lc_shape lc))
- includes <- forM (lc_includes lc) $ \(x, y) -> do
- x' <- substUnitId insts x
- return (x', y)
- build_tools <- mapM (substUnitId insts) (lc_internal_build_tools lc)
+ -- NB: lc_sig_includes is omitted here, because we don't
+ -- need them to build
+ includes <- forM (lc_includes lc) $ \ci -> do
+ uid' <- substUnitId insts (ci_id ci)
+ return ci { ci_ann_id = fmap (const uid') (ci_ann_id ci) }
+ exe_deps <- mapM (substExeDep insts) (lc_exe_deps lc)
s <- InstM $ \s -> (s, s)
let getDep (Module dep_def_uid _)
| let dep_uid = unDefUnitId dep_def_uid
@@ -209,31 +271,31 @@ toReadyComponents pid_map subst0 comps
= [(dep_uid,
fromMaybe err_pid $
Map.lookup dep_uid pid_map A.<|>
- fmap rc_pkgid (join (Map.lookup dep_uid s)))]
+ fmap rc_munged_id (join (Map.lookup dep_uid s)))]
where
- err_pid =
- PackageIdentifier
- (mkPackageName "nonexistent-package-this-is-a-cabal-bug")
+ err_pid = MungedPackageId
+ (mkMungedPackageName "nonexistent-package-this-is-a-cabal-bug")
(mkVersion [0])
instc = InstantiatedComponent {
instc_insts = Map.toList insts,
+ instc_insts_deps = concatMap getDep (Map.elems insts),
instc_provides = provides,
instc_includes = includes
+ -- NB: there is no dependency on the
+ -- indefinite version of this instantiated package here,
+ -- as (1) it doesn't go in depends in the
+ -- IPI: it's not a run time dep, and (2)
+ -- we don't have to tell GHC about it, it
+ -- will match up the ComponentId
+ -- automatically
}
return $ Just ReadyComponent {
- rc_uid = uid,
+ rc_ann_id = (lc_ann_id lc) { ann_id = uid },
rc_open_uid = DefiniteUnitId (unsafeMkDefUnitId uid),
rc_cid = lc_cid lc,
- rc_pkgid = lc_pkgid lc,
rc_component = lc_component lc,
- rc_internal_build_tools = build_tools,
+ rc_exe_deps = exe_deps,
rc_public = lc_public lc,
- rc_depends = ordNub $
- -- NB: don't put the dep on the indef
- -- package here, since we DO NOT want
- -- to put it in 'depends' in the IPI
- map (\(x,y) -> (unDefUnitId x, y)) deps ++
- concatMap getDep (Map.elems insts),
rc_i = Right instc
}
| otherwise = return Nothing
@@ -259,6 +321,12 @@ toReadyComponents pid_map subst0 comps
uid' <- substUnitId subst uid
return (Module uid' mod_name)
+ substExeDep :: Map ModuleName Module
+ -> AnnotatedId OpenUnitId -> InstM (AnnotatedId UnitId)
+ substExeDep insts exe_aid = do
+ exe_uid' <- substUnitId insts (ann_id exe_aid)
+ return exe_aid { ann_id = unDefUnitId exe_uid' }
+
indefiniteUnitId :: ComponentId -> InstM UnitId
indefiniteUnitId cid = do
let uid = newSimpleUnitId cid
@@ -268,22 +336,20 @@ toReadyComponents pid_map subst0 comps
indefiniteComponent :: UnitId -> ComponentId -> InstM (Maybe ReadyComponent)
indefiniteComponent uid cid
| Just lc <- Map.lookup cid cmap = do
- -- TODO: Goofy
- build_tools <- mapM (substUnitId Map.empty) (lc_internal_build_tools lc)
+ exe_deps <- mapM (substExeDep Map.empty) (lc_exe_deps lc)
let indefc = IndefiniteComponent {
indefc_requires = map fst (lc_insts lc),
indefc_provides = modShapeProvides (lc_shape lc),
- indefc_includes = lc_includes lc
+ indefc_includes = lc_includes lc ++ lc_sig_includes lc
}
return $ Just ReadyComponent {
- rc_uid = uid,
+ rc_ann_id = (lc_ann_id lc) { ann_id = uid },
+ rc_cid = lc_cid lc,
rc_open_uid = lc_uid lc,
- rc_cid = lc_cid lc,
- rc_pkgid = lc_pkgid lc,
rc_component = lc_component lc,
- rc_internal_build_tools = build_tools,
+ -- It's always fully built
+ rc_exe_deps = exe_deps,
rc_public = lc_public lc,
- rc_depends = ordNub (map (\(x,y) -> (abstractUnitId x, y)) (lc_depends lc)),
rc_i = Left indefc
}
| otherwise = return Nothing
diff --git a/cabal/Cabal/Distribution/Backpack/UnifyM.hs b/cabal/Cabal/Distribution/Backpack/UnifyM.hs
index b8cee90..97fc391 100644
--- a/cabal/Cabal/Distribution/Backpack/UnifyM.hs
+++ b/cabal/Cabal/Distribution/Backpack/UnifyM.hs
@@ -1,11 +1,16 @@
{-# LANGUAGE Rank2Types #-}
+{-# LANGUAGE ScopedTypeVariables #-}
-- | See <https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst>
module Distribution.Backpack.UnifyM (
-- * Unification monad
UnifyM,
runUnifyM,
- unifyFail,
- withContext,
+ failWith,
+ addErr,
+ failIfErrs,
+ tryM,
+ addErrContext,
+ addErrContextM,
liftST,
UnifEnv(..),
@@ -30,7 +35,7 @@ module Distribution.Backpack.UnifyM (
emptyModuleScopeU,
convertModuleScopeU,
- ModuleSourceU(..),
+ ModuleWithSourceU,
convertInclude,
convertModuleProvides,
@@ -53,33 +58,61 @@ import Distribution.Package
import Distribution.PackageDescription
import Distribution.Text
import Distribution.Types.IncludeRenaming
+import Distribution.Types.ComponentInclude
+import Distribution.Types.AnnotatedId
+import Distribution.Types.ComponentName
import Distribution.Verbosity
import Data.STRef
+import Data.Traversable
import Control.Monad.ST
-import Control.Monad
import qualified Data.Map as Map
import qualified Data.Set as Set
import Data.IntMap (IntMap)
import qualified Data.IntMap as IntMap
import qualified Data.Traversable as T
+import Text.PrettyPrint
-- TODO: more detailed trace output on high verbosity would probably
-- be appreciated by users debugging unification errors. Collect
-- some good examples!
+data ErrMsg = ErrMsg {
+ err_msg :: Doc,
+ err_ctx :: [Doc]
+ }
+type MsgDoc = Doc
+
+renderErrMsg :: ErrMsg -> MsgDoc
+renderErrMsg ErrMsg { err_msg = msg, err_ctx = ctx } =
+ msg $$ vcat ctx
+
-- | The unification monad, this monad encapsulates imperative
-- unification.
-newtype UnifyM s a = UnifyM { unUnifyM :: UnifEnv s -> ST s (Either String a) }
+newtype UnifyM s a = UnifyM { unUnifyM :: UnifEnv s -> ST s (Maybe a) }
-- | Run a computation in the unification monad.
-runUnifyM :: Verbosity -> FullDb -> (forall s. UnifyM s a) -> Either String a
-runUnifyM verbosity db m
+runUnifyM :: Verbosity -> ComponentId -> FullDb -> (forall s. UnifyM s a) -> Either [MsgDoc] a
+runUnifyM verbosity self_cid db m
= runST $ do i <- newSTRef 0
hmap <- newSTRef Map.empty
- unUnifyM m (UnifEnv i hmap verbosity Nothing db)
+ errs <- newSTRef []
+ mb_r <- unUnifyM m UnifEnv {
+ unify_uniq = i,
+ unify_reqs = hmap,
+ unify_self_cid = self_cid,
+ unify_verbosity = verbosity,
+ unify_ctx = [],
+ unify_db = db,
+ unify_errs = errs }
+ final_errs <- readSTRef errs
+ case mb_r of
+ Just x | null final_errs -> return (Right x)
+ _ -> return (Left (map renderErrMsg (reverse final_errs)))
-- NB: GHC 7.6 throws a hissy fit if you pattern match on 'm'.
+type ErrCtx s = MsgDoc
+
-- | The unification environment.
data UnifEnv s = UnifEnv {
-- | A supply of unique integers to label 'UnitIdU'
@@ -91,12 +124,19 @@ data UnifEnv s = UnifEnv {
-- the requirement at the same module name to fill it.
-- This mapping grows monotonically.
unify_reqs :: UnifRef s (Map ModuleName (ModuleU s)),
+ -- | Component id of the unit we're linking. We use this
+ -- to detect if we fill a requirement with a local module,
+ -- which in principle should be OK but is not currently
+ -- supported by GHC.
+ unify_self_cid :: ComponentId,
-- | How verbose the error message should be
unify_verbosity :: Verbosity,
-- | The error reporting context
- unify_ctx :: Maybe (String, ModuleU s, ModuleU s),
+ unify_ctx :: [ErrCtx s],
-- | The package index for expanding unit identifiers
- unify_db :: FullDb
+ unify_db :: FullDb,
+ -- | Accumulated errors
+ unify_errs :: UnifRef s [ErrMsg]
}
instance Functor (UnifyM s) where
@@ -107,31 +147,64 @@ instance Applicative (UnifyM s) where
UnifyM f <*> UnifyM x = UnifyM $ \r -> do
f' <- f r
case f' of
- Left err -> return (Left err)
- Right f'' -> do
+ Nothing -> return Nothing
+ Just f'' -> do
x' <- x r
case x' of
- Left err -> return (Left err)
- Right x'' -> return (Right (f'' x''))
+ Nothing -> return Nothing
+ Just x'' -> return (Just (f'' x''))
instance Monad (UnifyM s) where
return = pure
UnifyM m >>= f = UnifyM $ \r -> do
x <- m r
case x of
- Left err -> return (Left err)
- Right x' -> unUnifyM (f x') r
+ Nothing -> return Nothing
+ Just x' -> unUnifyM (f x') r
-- | Lift a computation from 'ST' monad to 'UnifyM' monad.
-- Internal use only.
liftST :: ST s a -> UnifyM s a
-liftST m = UnifyM $ \_ -> fmap Right m
+liftST m = UnifyM $ \_ -> fmap Just m
+
+addErr :: MsgDoc -> UnifyM s ()
+addErr msg = do
+ env <- getUnifEnv
+ let err = ErrMsg {
+ err_msg = msg,
+ err_ctx = unify_ctx env
+ }
+ liftST $ modifySTRef (unify_errs env) (\errs -> err:errs)
+
+failWith :: MsgDoc -> UnifyM s a
+failWith msg = do
+ addErr msg
+ failM
+
+failM :: UnifyM s a
+failM = UnifyM $ \_ -> return Nothing
+
+failIfErrs :: UnifyM s ()
+failIfErrs = do
+ env <- getUnifEnv
+ errs <- liftST $ readSTRef (unify_errs env)
+ when (not (null errs)) failM
+
+tryM :: UnifyM s a -> UnifyM s (Maybe a)
+tryM m =
+ UnifyM (\env -> do
+ mb_r <- unUnifyM m env
+ return (Just mb_r))
+
+{-
+otherFail :: ErrMsg -> UnifyM s a
+otherFail s = UnifyM $ \_ -> return (Left s)
-unifyFail :: String -> UnifyM s a
+unifyFail :: ErrMsg -> UnifyM s a
unifyFail err = do
env <- getUnifEnv
msg <- case unify_ctx env of
- Nothing -> return ("Unspecified unification error: " ++ err)
+ Nothing -> return (text "Unspecified unification error:" <+> err)
Just (ctx, mod1, mod2)
| unify_verbosity env > normal
-> do mod1' <- convertModuleU mod1
@@ -142,6 +215,7 @@ unifyFail err = do
| otherwise
-> return (ctx ++ err ++ " (for more information, pass -v flag)")
UnifyM $ \_ -> return (Left msg)
+-}
-- | A convenient alias for mutable references in the unification monad.
type UnifRef s a = STRef s a
@@ -156,12 +230,17 @@ writeUnifRef x = liftST . writeSTRef x
-- | Get the current unification environment.
getUnifEnv :: UnifyM s (UnifEnv s)
-getUnifEnv = UnifyM $ \r -> return (Right r)
+getUnifEnv = UnifyM $ \r -> return (return r)
+
+-- | Add a fixed message to the error context.
+addErrContext :: Doc -> UnifyM s a -> UnifyM s a
+addErrContext ctx m = addErrContextM ctx m
+
+-- | Add a message to the error context. It may make monadic queries.
+addErrContextM :: ErrCtx s -> UnifyM s a -> UnifyM s a
+addErrContextM ctx m =
+ UnifyM $ \r -> unUnifyM m r { unify_ctx = ctx : unify_ctx r }
--- | Run a unification in some context
-withContext :: String -> ModuleU s -> ModuleU s -> UnifyM s a -> UnifyM s a
-withContext ctx mod1 mod2 m =
- UnifyM $ \r -> unUnifyM m r { unify_ctx = Just (ctx, mod1, mod2) }
-----------------------------------------------------------------------
-- The "unifiable" variants of the data types
@@ -317,7 +396,9 @@ convertUnitIdU' stk uid_u = do
UnitIdThunkU uid -> return (DefiniteUnitId uid)
UnitIdU u cid insts_u ->
case lookupMooEnv stk u of
- Just _i -> error "convertUnitIdU': mutual recursion" -- return (UnitIdVar i)
+ Just _i ->
+ failWith (text "Unsupported mutually recursive unit identifier")
+ -- return (UnitIdVar i)
Nothing -> do
insts <- T.forM insts_u $ convertModuleU' (extendMooEnv stk u)
return (IndefFullUnitId cid insts)
@@ -345,26 +426,48 @@ emptyModuleScopeU = (Map.empty, Map.empty)
-- | The mutable counterpart of 'ModuleScope'.
-type ModuleScopeU s = (ModuleProvidesU s, ModuleSubstU s)
+type ModuleScopeU s = (ModuleProvidesU s, ModuleRequiresU s)
-- | The mutable counterpart of 'ModuleProvides'
-type ModuleProvidesU s = Map ModuleName [ModuleSourceU s]
-data ModuleSourceU s =
- ModuleSourceU {
- -- We don't have line numbers, but if we did the
- -- package name and renaming could be associated
- -- with that as well
- usrc_pkgname :: PackageName,
- usrc_renaming :: IncludeRenaming,
- usrc_module :: ModuleU s
- }
+type ModuleProvidesU s = Map ModuleName [ModuleWithSourceU s]
+type ModuleRequiresU s = ModuleProvidesU s
+type ModuleWithSourceU s = WithSource (ModuleU s)
+
+-- TODO: Deduplicate this with Distribution.Backpack.MixLink.dispSource
+ci_msg :: ComponentInclude (OpenUnitId, ModuleShape) IncludeRenaming -> Doc
+ci_msg ci
+ | ci_implicit ci = text "build-depends:" <+> pp_pn
+ | otherwise = text "mixins:" <+> pp_pn <+> disp (ci_renaming ci)
+ where
+ pn = pkgName (ci_pkgid ci)
+ pp_pn =
+ case ci_cname ci of
+ CLibName -> disp pn
+ CSubLibName cn -> disp pn <<>> colon <<>> disp cn
+ -- Shouldn't happen
+ cn -> disp pn <+> parens (disp cn)
-- | Convert a 'ModuleShape' into a 'ModuleScopeU', so we can do
-- unification on it.
convertInclude
- :: ((OpenUnitId, ModuleShape), PackageId, IncludeRenaming)
- -> UnifyM s (ModuleScopeU s, (UnitIdU s, PackageId, ModuleRenaming))
-convertInclude ((uid, ModuleShape provs reqs), pid, incl@(IncludeRenaming prov_rns req_rns)) = do
+ :: ComponentInclude (OpenUnitId, ModuleShape) IncludeRenaming
+ -> UnifyM s (ModuleScopeU s,
+ Either (ComponentInclude (UnitIdU s) ModuleRenaming) {- normal -}
+ (ComponentInclude (UnitIdU s) ModuleRenaming) {- sig -})
+convertInclude ci@(ComponentInclude {
+ ci_ann_id = AnnotatedId {
+ ann_id = (uid, ModuleShape provs reqs),
+ ann_pid = pid,
+ ann_cname = compname
+ },
+ ci_renaming = incl@(IncludeRenaming prov_rns req_rns),
+ ci_implicit = implicit
+ }) = addErrContext (text "In" <+> ci_msg ci) $ do
let pn = packageName pid
+ the_source | implicit
+ = FromBuildDepends pn compname
+ | otherwise
+ = FromMixins pn compname incl
+ source = WithSource the_source
-- Suppose our package has two requirements A and B, and
-- we include it with @requires (A as X)@
@@ -383,16 +486,29 @@ convertInclude ((uid, ModuleShape provs reqs), pid, incl@(IncludeRenaming prov_r
-- are mapped to the same name, the intent is to merge them
-- together. But they are *functions*, so @B as X, B as Y@ is
-- illegal.
- let insertDistinct m (k,v) =
- if Map.member k m
- then error ("Duplicate requirement renaming " ++ display k)
- else return (Map.insert k v m)
- req_rename <- foldM insertDistinct Map.empty =<<
- case req_rns of
- DefaultRenaming -> return []
- -- Not valid here, but whatever
- HidingRenaming _ -> error "Cannot use hiding in requirement renaming"
- ModuleRenaming rns -> return rns
+
+ req_rename_list <-
+ case req_rns of
+ DefaultRenaming -> return []
+ HidingRenaming _ -> do
+ -- Not valid here for requires!
+ addErr $ text "Unsupported syntax" <+>
+ quotes (text "requires hiding (...)")
+ return []
+ ModuleRenaming rns -> return rns
+
+ let req_rename_listmap :: Map ModuleName [ModuleName]
+ req_rename_listmap =
+ Map.fromListWith (++) [ (k,[v]) | (k,v) <- req_rename_list ]
+ req_rename <- sequenceA . flip Map.mapWithKey req_rename_listmap $ \k vs0 ->
+ case vs0 of
+ [] -> error "req_rename"
+ [v] -> return v
+ v:vs -> do addErr $
+ text "Conflicting renamings of requirement" <+> quotes (disp k) $$
+ text "Renamed to: " <+> vcat (map disp (v:vs))
+ return v
+
let req_rename_fn k = case Map.lookup k req_rename of
Nothing -> k
Just v -> v
@@ -410,11 +526,20 @@ convertInclude ((uid, ModuleShape provs reqs), pid, incl@(IncludeRenaming prov_r
-- mappings.
--
-- A -> X ==> X -> <X>, B -> <B>
- reqs_u <- convertModuleSubst . Map.fromList $
- [ (k, OpenModuleVar k)
+ reqs_u <- convertModuleRequires . Map.fromList $
+ [ (k, [source (OpenModuleVar k)])
| k <- map req_rename_fn (Set.toList reqs)
]
+ -- Report errors if there were unused renamings
+ let leftover = Map.keysSet req_rename `Set.difference` reqs
+ unless (Set.null leftover) $
+ addErr $
+ hang (text "The" <+> text (showComponentName compname) <+>
+ text "from package" <+> quotes (disp pid)
+ <+> text "does not require:") 4
+ (vcat (map disp (Set.toList leftover)))
+
-- Provision computation is more complex.
-- For example, if we have:
--
@@ -450,37 +575,54 @@ convertInclude ((uid, ModuleShape provs reqs), pid, incl@(IncludeRenaming prov_r
r <- sequence
[ case Map.lookup from provs of
Just m -> return (to, m)
- Nothing -> error ("Tried to rename non-existent module " ++ display from)
+ Nothing -> failWith $
+ text "Package" <+> quotes (disp pid) <+>
+ text "does not expose the module" <+> quotes (disp from)
| (from, to) <- rns ]
return (r, prov_rns)
let prov_scope = modSubst req_subst
$ Map.fromListWith (++)
- [ (k, [ModuleSource pn incl v])
+ [ (k, [source v])
| (k, v) <- pre_prov_scope ]
provs_u <- convertModuleProvides prov_scope
- return ((provs_u, reqs_u), (uid_u, pid, prov_rns'))
+ -- TODO: Assert that provs_u is empty if provs was empty
+ return ((provs_u, reqs_u),
+ -- NB: We test that requirements is not null so that
+ -- users can create packages with zero module exports
+ -- that cause some C library to linked in, etc.
+ (if Map.null provs && not (Set.null reqs)
+ then Right -- is sig
+ else Left) (ComponentInclude {
+ ci_ann_id = AnnotatedId {
+ ann_id = uid_u,
+ ann_pid = pid,
+ ann_cname = compname
+ },
+ ci_renaming = prov_rns',
+ ci_implicit = ci_implicit ci
+ }))
-- | Convert a 'ModuleScopeU' to a 'ModuleScope'.
convertModuleScopeU :: ModuleScopeU s -> UnifyM s ModuleScope
convertModuleScopeU (provs_u, reqs_u) = do
provs <- convertModuleProvidesU provs_u
- reqs <- convertModuleSubstU reqs_u
+ reqs <- convertModuleRequiresU reqs_u
-- TODO: Test that the requirements are still free. If they
-- are not, they got unified, and that's dodgy at best.
- return (ModuleScope provs (Map.keysSet reqs))
+ return (ModuleScope provs reqs)
-- | Convert a 'ModuleProvides' to a 'ModuleProvidesU'
convertModuleProvides :: ModuleProvides -> UnifyM s (ModuleProvidesU s)
-convertModuleProvides = T.mapM $ \ms ->
- mapM (\(ModuleSource pn incl m)
- -> do m' <- convertModule m
- return (ModuleSourceU pn incl m')) ms
+convertModuleProvides = T.mapM (mapM (T.mapM convertModule))
-- | Convert a 'ModuleProvidesU' to a 'ModuleProvides'
convertModuleProvidesU :: ModuleProvidesU s -> UnifyM s ModuleProvides
-convertModuleProvidesU = T.mapM $ \ms ->
- mapM (\(ModuleSourceU pn incl m)
- -> do m' <- convertModuleU m
- return (ModuleSource pn incl m')) ms
+convertModuleProvidesU = T.mapM (mapM (T.mapM convertModuleU))
+
+convertModuleRequires :: ModuleRequires -> UnifyM s (ModuleRequiresU s)
+convertModuleRequires = convertModuleProvides
+
+convertModuleRequiresU :: ModuleRequiresU s -> UnifyM s ModuleRequires
+convertModuleRequiresU = convertModuleProvidesU
diff --git a/cabal/Cabal/Distribution/Compat/Binary/Class.hs b/cabal/Cabal/Distribution/Compat/Binary/Class.hs
index 833e080..e909310 100644
--- a/cabal/Cabal/Distribution/Compat/Binary/Class.hs
+++ b/cabal/Cabal/Distribution/Compat/Binary/Class.hs
@@ -30,7 +30,7 @@ import Data.Word
import Data.Binary.Put
import Data.Binary.Get
-import Control.Monad
+import Control.Applicative ((<$>), (<*>), (*>))
import Foreign
import Data.ByteString.Lazy (ByteString)
@@ -104,12 +104,12 @@ instance Binary () where
-- Bools are encoded as a byte in the range 0 .. 1
instance Binary Bool where
put = putWord8 . fromIntegral . fromEnum
- get = liftM (toEnum . fromIntegral) getWord8
+ get = fmap (toEnum . fromIntegral) getWord8
-- Values of type 'Ordering' are encoded as a byte in the range 0 .. 2
instance Binary Ordering where
put = putWord8 . fromIntegral . fromEnum
- get = liftM (toEnum . fromIntegral) getWord8
+ get = fmap (toEnum . fromIntegral) getWord8
------------------------------------------------------------------------
-- Words and Ints
@@ -137,34 +137,34 @@ instance Binary Word64 where
-- Int8s are written as a single byte.
instance Binary Int8 where
put i = put (fromIntegral i :: Word8)
- get = liftM fromIntegral (get :: Get Word8)
+ get = fmap fromIntegral (get :: Get Word8)
-- Int16s are written as a 2 bytes in big endian format
instance Binary Int16 where
put i = put (fromIntegral i :: Word16)
- get = liftM fromIntegral (get :: Get Word16)
+ get = fmap fromIntegral (get :: Get Word16)
-- Int32s are written as a 4 bytes in big endian format
instance Binary Int32 where
put i = put (fromIntegral i :: Word32)
- get = liftM fromIntegral (get :: Get Word32)
+ get = fmap fromIntegral (get :: Get Word32)
-- Int64s are written as a 4 bytes in big endian format
instance Binary Int64 where
put i = put (fromIntegral i :: Word64)
- get = liftM fromIntegral (get :: Get Word64)
+ get = fmap fromIntegral (get :: Get Word64)
------------------------------------------------------------------------
-- Words are are written as Word64s, that is, 8 bytes in big endian format
instance Binary Word where
put i = put (fromIntegral i :: Word64)
- get = liftM fromIntegral (get :: Get Word64)
+ get = fmap fromIntegral (get :: Get Word64)
-- Ints are are written as Int64s, that is, 8 bytes in big endian format
instance Binary Int where
put i = put (fromIntegral i :: Int64)
- get = liftM fromIntegral (get :: Get Int64)
+ get = fmap fromIntegral (get :: Get Int64)
------------------------------------------------------------------------
--
@@ -200,7 +200,7 @@ instance Binary Integer where
get = do
tag <- get :: Get Word8
case tag of
- 0 -> liftM fromIntegral (get :: Get SmallInt)
+ 0 -> fmap fromIntegral (get :: Get SmallInt)
_ -> do sign <- get
bytes <- get
let v = roll bytes
@@ -237,7 +237,7 @@ import GHC.Ptr (Ptr(..))
import GHC.IOBase (IO(..))
instance Binary Integer where
- put (S# i) = putWord8 0 >> put (I# i)
+ put (S# i) = putWord8 0 *> put (I# i)
put (J# s ba) = do
putWord8 1
put (I# s)
@@ -263,7 +263,7 @@ instance Binary ByteArray where
-- Pretty scary. Should be quick though
get = do
- (fp, off, n@(I# sz)) <- liftM toForeignPtr get -- so decode a ByteString
+ (fp, off, n@(I# sz)) <- fmap toForeignPtr get -- so decode a ByteString
assert (off == 0) $ return $ unsafePerformIO $ do
(MBA arr) <- newByteArray sz -- and copy it into a ByteArray#
let to = byteArrayContents# (unsafeCoerce# arr) -- urk, is this safe?
@@ -287,8 +287,8 @@ freezeByteArray arr = IO $ \s ->
-}
instance (Binary a,Integral a) => Binary (R.Ratio a) where
- put r = put (R.numerator r) >> put (R.denominator r)
- get = liftM2 (R.%) get get
+ put r = put (R.numerator r) *> put (R.denominator r)
+ get = (R.%) <$> get <*> get
------------------------------------------------------------------------
@@ -314,23 +314,23 @@ instance Binary Char where
w = fromIntegral (shiftR c 18 .&. 0x7)
get = do
- let getByte = liftM (fromIntegral :: Word8 -> Int) get
+ let getByte = fmap (fromIntegral :: Word8 -> Int) get
shiftL6 = flip shiftL 6 :: Int -> Int
w <- getByte
r <- case () of
_ | w < 0x80 -> return w
| w < 0xe0 -> do
- x <- liftM (xor 0x80) getByte
+ x <- fmap (xor 0x80) getByte
return (x .|. shiftL6 (xor 0xc0 w))
| w < 0xf0 -> do
- x <- liftM (xor 0x80) getByte
- y <- liftM (xor 0x80) getByte
+ x <- fmap (xor 0x80) getByte
+ y <- fmap (xor 0x80) getByte
return (y .|. shiftL6 (x .|. shiftL6
(xor 0xe0 w)))
| otherwise -> do
- x <- liftM (xor 0x80) getByte
- y <- liftM (xor 0x80) getByte
- z <- liftM (xor 0x80) getByte
+ x <- fmap (xor 0x80) getByte
+ y <- fmap (xor 0x80) getByte
+ z <- fmap (xor 0x80) getByte
return (z .|. shiftL6 (y .|. shiftL6
(x .|. shiftL6 (xor 0xf0 w))))
return $! chr r
@@ -339,20 +339,20 @@ instance Binary Char where
-- Instances for the first few tuples
instance (Binary a, Binary b) => Binary (a,b) where
- put (a,b) = put a >> put b
- get = liftM2 (,) get get
+ put (a,b) = put a *> put b
+ get = (,) <$> get <*> get
instance (Binary a, Binary b, Binary c) => Binary (a,b,c) where
- put (a,b,c) = put a >> put b >> put c
- get = liftM3 (,,) get get get
+ put (a,b,c) = put a *> put b *> put c
+ get = (,,) <$> get <*> get <*> get
instance (Binary a, Binary b, Binary c, Binary d) => Binary (a,b,c,d) where
- put (a,b,c,d) = put a >> put b >> put c >> put d
- get = liftM4 (,,,) get get get get
+ put (a,b,c,d) = put a *> put b *> put c *> put d
+ get = (,,,) <$> get <*> get <*> get <*> get
instance (Binary a, Binary b, Binary c, Binary d, Binary e) => Binary (a,b,c,d,e) where
- put (a,b,c,d,e) = put a >> put b >> put c >> put d >> put e
- get = liftM5 (,,,,) get get get get get
+ put (a,b,c,d,e) = put a *> put b *> put c *> put d *> put e
+ get = (,,,,) <$> get <*> get <*> get <*> get <*> get
--
-- and now just recurse:
@@ -390,7 +390,7 @@ instance (Binary a, Binary b, Binary c, Binary d, Binary e,
-- Container types
instance Binary a => Binary [a] where
- put l = put (length l) >> traverse_ put l
+ put l = put (length l) *> traverse_ put l
get = do n <- get :: Get Int
getMany n
@@ -407,21 +407,21 @@ getMany n = go [] n
instance (Binary a) => Binary (Maybe a) where
put Nothing = putWord8 0
- put (Just x) = putWord8 1 >> put x
+ put (Just x) = putWord8 1 *> put x
get = do
w <- getWord8
case w of
0 -> return Nothing
- _ -> liftM Just get
+ _ -> fmap Just get
instance (Binary a, Binary b) => Binary (Either a b) where
- put (Left a) = putWord8 0 >> put a
- put (Right b) = putWord8 1 >> put b
+ put (Left a) = putWord8 0 *> put a
+ put (Right b) = putWord8 1 *> put b
get = do
w <- getWord8
case w of
- 0 -> liftM Left get
- _ -> liftM Right get
+ 0 -> fmap Left get
+ _ -> fmap Right get
------------------------------------------------------------------------
-- ByteStrings (have specially efficient instances)
@@ -445,26 +445,26 @@ instance Binary ByteString where
-- Maps and Sets
instance (Binary a) => Binary (Set.Set a) where
- put s = put (Set.size s) >> traverse_ put (Set.toAscList s)
- get = liftM Set.fromDistinctAscList get
+ put s = put (Set.size s) *> traverse_ put (Set.toAscList s)
+ get = fmap Set.fromDistinctAscList get
instance (Binary k, Binary e) => Binary (Map.Map k e) where
- put m = put (Map.size m) >> traverse_ put (Map.toAscList m)
- get = liftM Map.fromDistinctAscList get
+ put m = put (Map.size m) *> traverse_ put (Map.toAscList m)
+ get = fmap Map.fromDistinctAscList get
instance Binary IntSet.IntSet where
- put s = put (IntSet.size s) >> traverse_ put (IntSet.toAscList s)
- get = liftM IntSet.fromDistinctAscList get
+ put s = put (IntSet.size s) *> traverse_ put (IntSet.toAscList s)
+ get = fmap IntSet.fromDistinctAscList get
instance (Binary e) => Binary (IntMap.IntMap e) where
- put m = put (IntMap.size m) >> traverse_ put (IntMap.toAscList m)
- get = liftM IntMap.fromDistinctAscList get
+ put m = put (IntMap.size m) *> traverse_ put (IntMap.toAscList m)
+ get = fmap IntMap.fromDistinctAscList get
------------------------------------------------------------------------
-- Queues and Sequences
instance (Binary e) => Binary (Seq.Seq e) where
- put s = put (Seq.length s) >> Fold.traverse_ put s
+ put s = put (Seq.length s) *> Fold.traverse_ put s
get = do n <- get :: Get Int
rep Seq.empty n get
where rep xs 0 _ = return $! xs
@@ -477,18 +477,18 @@ instance (Binary e) => Binary (Seq.Seq e) where
instance Binary Double where
put d = put (decodeFloat d)
- get = liftM2 encodeFloat get get
+ get = encodeFloat <$> get <*> get
instance Binary Float where
put f = put (decodeFloat f)
- get = liftM2 encodeFloat get get
+ get = encodeFloat <$> get <*> get
------------------------------------------------------------------------
-- Trees
instance (Binary e) => Binary (T.Tree e) where
- put (T.Node r s) = put r >> put s
- get = liftM2 T.Node get get
+ put (T.Node r s) = put r *> put s
+ get = T.Node <$> get <*> get
------------------------------------------------------------------------
-- Arrays
diff --git a/cabal/Cabal/Distribution/Compat/CopyFile.hs b/cabal/Cabal/Distribution/Compat/CopyFile.hs
index 1bf9553..ac0577b 100644
--- a/cabal/Cabal/Distribution/Compat/CopyFile.hs
+++ b/cabal/Cabal/Distribution/Compat/CopyFile.hs
@@ -27,17 +27,16 @@ import System.Directory
import System.FilePath
( takeDirectory )
import System.IO
- ( IOMode(ReadMode), hClose, hGetBuf, hPutBuf
+ ( IOMode(ReadMode), hClose, hGetBuf, hPutBuf, hFileSize
, withBinaryFile )
import Foreign
( allocaBytes )
#ifndef mingw32_HOST_OS
-import System.Posix.Internals (withFilePath)
import System.Posix.Types
( FileMode )
import System.Posix.Internals
- ( c_chmod )
+ ( c_chmod, withFilePath )
import Foreign.C
( throwErrnoPathIfMinus1_ )
#endif /* mingw32_HOST_OS */
@@ -94,7 +93,8 @@ copyFileChanged src dest = do
unless equal $ copyFile src dest
-- | Checks if two files are byte-identical.
--- Returns False if either of the files do not exist.
+-- Returns False if either of the files do not exist or if files
+-- are of different size.
filesEqual :: FilePath -> FilePath -> NoCallStackIO Bool
filesEqual f1 f2 = do
ex1 <- doesFileExist f1
@@ -102,6 +102,11 @@ filesEqual f1 f2 = do
if not (ex1 && ex2) then return False else
withBinaryFile f1 ReadMode $ \h1 ->
withBinaryFile f2 ReadMode $ \h2 -> do
- c1 <- BSL.hGetContents h1
- c2 <- BSL.hGetContents h2
- return $! c1 == c2
+ s1 <- hFileSize h1
+ s2 <- hFileSize h2
+ if s1 /= s2
+ then return False
+ else do
+ c1 <- BSL.hGetContents h1
+ c2 <- BSL.hGetContents h2
+ return $! c1 == c2
diff --git a/cabal/Cabal/Distribution/Compat/DList.hs b/cabal/Cabal/Distribution/Compat/DList.hs
index 48005bb..6f045fe 100644
--- a/cabal/Cabal/Distribution/Compat/DList.hs
+++ b/cabal/Cabal/Distribution/Compat/DList.hs
@@ -13,6 +13,7 @@ module Distribution.Compat.DList (
DList,
runDList,
singleton,
+ fromList,
snoc,
) where
@@ -29,6 +30,9 @@ runDList (DList run) = run []
singleton :: a -> DList a
singleton a = DList (a:)
+fromList :: [a] -> DList a
+fromList as = DList (as ++)
+
snoc :: DList a -> a -> DList a
snoc xs x = xs <> singleton x
diff --git a/cabal/Cabal/Distribution/Compat/Graph.hs b/cabal/Cabal/Distribution/Compat/Graph.hs
index 88e62eb..afbd3ae 100644
--- a/cabal/Cabal/Distribution/Compat/Graph.hs
+++ b/cabal/Cabal/Distribution/Compat/Graph.hs
@@ -71,7 +71,7 @@ module Distribution.Compat.Graph (
-- ** Maps
toMap,
-- ** Lists
- fromList,
+ fromDistinctList,
toList,
keys,
-- ** Sets
@@ -83,13 +83,25 @@ module Distribution.Compat.Graph (
nodeValue,
) where
+-- For bootstrapping GHC
+#ifdef MIN_VERSION_containers
+#if MIN_VERSION_containers(0,5,0)
+#define HAVE_containers_050
+#endif
+#endif
+
import Prelude ()
import qualified Distribution.Compat.Prelude as Prelude
import Distribution.Compat.Prelude hiding (lookup, null, empty)
import Data.Graph (SCC(..))
import qualified Data.Graph as G
+
+#ifdef HAVE_containers_050
+import qualified Data.Map.Strict as Map
+#else
import qualified Data.Map as Map
+#endif
import qualified Data.Set as Set
import qualified Data.Array as Array
import Data.Array ((!))
@@ -121,12 +133,12 @@ data Graph a
instance Show a => Show (Graph a) where
show = show . toList
-instance (IsNode a, Read a) => Read (Graph a) where
- readsPrec d s = map (\(a,r) -> (fromList a, r)) (readsPrec d s)
+instance (IsNode a, Read a, Show (Key a)) => Read (Graph a) where
+ readsPrec d s = map (\(a,r) -> (fromDistinctList a, r)) (readsPrec d s)
-instance (IsNode a, Binary a) => Binary (Graph a) where
+instance (IsNode a, Binary a, Show (Key a)) => Binary (Graph a) where
put x = put (toList x)
- get = fmap fromList get
+ get = fmap fromDistinctList get
instance (Eq (Key a), Eq a) => Eq (Graph a) where
g1 == g2 = graphMap g1 == graphMap g2
@@ -368,12 +380,14 @@ fromMap m
nodeTable = Array.listArray bounds ns
bounds = (0, Map.size m - 1)
--- | /O(V log V)/. Convert a list of nodes into a graph.
-fromList :: IsNode a => [a] -> Graph a
-fromList ns = fromMap
- . Map.fromList
- . map (\n -> n `seq` (nodeKey n, n))
- $ ns
+-- | /O(V log V)/. Convert a list of nodes (with distinct keys) into a graph.
+fromDistinctList :: (IsNode a, Show (Key a)) => [a] -> Graph a
+fromDistinctList = fromMap
+ . Map.fromListWith (\_ -> duplicateError)
+ . map (\n -> n `seq` (nodeKey n, n))
+ where
+ duplicateError n = error $ "Graph.fromDistinctList: duplicate key: "
+ ++ show (nodeKey n)
-- Map-like operations
diff --git a/cabal/Cabal/Distribution/Compat/Lens.hs b/cabal/Cabal/Distribution/Compat/Lens.hs
new file mode 100644
index 0000000..b4a0104
--- /dev/null
+++ b/cabal/Cabal/Distribution/Compat/Lens.hs
@@ -0,0 +1,274 @@
+{-# LANGUAGE RankNTypes #-}
+-- | This module provides very basic lens functionality, without extra dependencies.
+--
+-- For the documentation of the combinators see <http://hackage.haskell.org/package/lens lens> package.
+-- This module uses the same vocabulary.
+module Distribution.Compat.Lens (
+ -- * Types
+ Lens,
+ Lens',
+ Traversal,
+ Traversal',
+ -- ** LensLike
+ LensLike,
+ LensLike',
+ -- ** rank-1 types
+ Getting,
+ AGetter,
+ ASetter,
+ ALens,
+ ALens',
+ -- * Getter
+ view,
+ use,
+ -- * Setter
+ set,
+ over,
+ -- * Fold
+ toDListOf,
+ toListOf,
+ toSetOf,
+ -- * Lens
+ cloneLens,
+ aview,
+ -- * Common lenses
+ _1, _2,
+ non,
+ fromNon,
+ -- * Operators
+ (&),
+ (^.),
+ (.~), (?~), (%~),
+ (.=), (?=), (%=),
+ (^#),
+ (#~), (#%~),
+ -- * Internal Comonads
+ Pretext (..),
+ -- * Cabal developer info
+ -- $development
+ ) where
+
+import Prelude()
+import Distribution.Compat.Prelude
+
+import Control.Applicative (Const (..))
+import Data.Functor.Identity (Identity (..))
+import Control.Monad.State.Class (MonadState (..), gets, modify)
+
+import qualified Distribution.Compat.DList as DList
+import qualified Data.Set as Set
+
+-------------------------------------------------------------------------------
+-- Types
+-------------------------------------------------------------------------------
+
+type LensLike f s t a b = (a -> f b) -> s -> f t
+type LensLike' f s a = (a -> f a) -> s -> f s
+
+type Lens s t a b = forall f. Functor f => LensLike f s t a b
+type Traversal s t a b = forall f. Applicative f => LensLike f s t a b
+
+type Lens' s a = Lens s s a a
+type Traversal' s a = Traversal s s a a
+
+type Getting r s a = LensLike (Const r) s s a a
+
+type AGetter s a = LensLike (Const a) s s a a -- this doens't exist in 'lens'
+type ASetter s t a b = LensLike Identity s t a b
+type ALens s t a b = LensLike (Pretext a b) s t a b
+
+type ALens' s a = ALens s s a a
+
+-------------------------------------------------------------------------------
+-- Getter
+-------------------------------------------------------------------------------
+
+view :: Getting a s a -> s -> a
+view l s = getConst (l Const s)
+{-# INLINE view #-}
+
+use :: MonadState s m => Getting a s a -> m a
+use l = gets (view l)
+{-# INLINE use #-}
+
+-------------------------------------------------------------------------------
+-- Setter
+-------------------------------------------------------------------------------
+
+set :: ASetter s t a b -> b -> s -> t
+set l x = over l (const x)
+
+over :: ASetter s t a b -> (a -> b) -> s -> t
+over l f s = runIdentity (l (\x -> Identity (f x)) s)
+
+-------------------------------------------------------------------------------
+-- Fold
+-------------------------------------------------------------------------------
+
+toDListOf :: Getting (DList.DList a) s a -> s -> DList.DList a
+toDListOf l s = getConst (l (\x -> Const (DList.singleton x)) s)
+
+toListOf :: Getting (DList.DList a) s a -> s -> [a]
+toListOf l = DList.runDList . toDListOf l
+
+toSetOf :: Getting (Set.Set a) s a -> s -> Set.Set a
+toSetOf l s = getConst (l (\x -> Const (Set.singleton x)) s)
+
+-------------------------------------------------------------------------------
+-- Lens
+-------------------------------------------------------------------------------
+
+aview :: ALens s t a b -> s -> a
+aview l = pretextPos . l pretextSell
+{-# INLINE aview #-}
+{-
+lens :: (s -> a) -> (s -> a -> s) -> Lens' s a
+lens sa sbt afb s = sbt s <$> afb (sa s)
+-}
+
+-------------------------------------------------------------------------------
+-- Common
+-------------------------------------------------------------------------------
+
+_1 :: Lens (a, c) (b, c) a b
+_1 f (a, c) = flip (,) c <$> f a
+
+_2 :: Lens (c, a) (c, b) a b
+_2 f (c, a) = (,) c <$> f a
+
+-- | /Note:/ not an isomorphism here.
+non :: Eq a => a -> Lens' (Maybe a) a
+non def f s = wrap <$> f (unwrap s)
+ where
+ wrap x | x == def = Nothing
+ wrap x = Just x
+
+ unwrap = fromMaybe def
+
+
+fromNon :: Eq a => a -> Lens' a (Maybe a)
+fromNon def f s = unwrap <$> f (wrap s)
+ where
+ wrap x | x == def = Nothing
+ wrap x = Just x
+
+ unwrap = fromMaybe def
+
+-------------------------------------------------------------------------------
+-- Operators
+-------------------------------------------------------------------------------
+
+-- | '&' is a reverse application operator
+(&) :: a -> (a -> b) -> b
+(&) = flip ($)
+{-# INLINE (&) #-}
+infixl 1 &
+
+infixl 8 ^., ^#
+infixr 4 .~, %~, ?~
+infixr 4 #~, #%~
+infixr 4 .=, %=, ?=
+
+(^.) :: s -> Getting a s a -> a
+s ^. l = getConst (l Const s)
+{-# INLINE (^.) #-}
+
+(.~) :: ASetter s t a b -> b -> s -> t
+(.~) = set
+{-# INLINE (.~) #-}
+
+(?~) :: ASetter s t a (Maybe b) -> b -> s -> t
+l ?~ b = set l (Just b)
+{-# INLINE (?~) #-}
+
+(%~) :: ASetter s t a b -> (a -> b) -> s -> t
+(%~) = over
+{-# INLINE (%~) #-}
+
+(.=) :: MonadState s m => ASetter s s a b -> b -> m ()
+l .= b = modify (l .~ b)
+{-# INLINE (.=) #-}
+
+(?=) :: MonadState s m => ASetter s s a (Maybe b) -> b -> m ()
+l ?= b = modify (l ?~ b)
+{-# INLINE (?=) #-}
+
+(%=) :: MonadState s m => ASetter s s a b -> (a -> b) -> m ()
+l %= f = modify (l %~ f)
+{-# INLINE (%=) #-}
+
+(^#) :: s -> ALens s t a b -> a
+s ^# l = aview l s
+
+(#~) :: ALens s t a b -> b -> s -> t
+(#~) l b s = pretextPeek b (l pretextSell s)
+{-# INLINE (#~) #-}
+
+(#%~) :: ALens s t a b -> (a -> b) -> s -> t
+(#%~) l f s = pretextPeeks f (l pretextSell s)
+{-# INLINE (#%~) #-}
+
+pretextSell :: a -> Pretext a b b
+pretextSell a = Pretext (\afb -> afb a)
+{-# INLINE pretextSell #-}
+
+pretextPeeks :: (a -> b) -> Pretext a b t -> t
+pretextPeeks f (Pretext m) = runIdentity $ m (\x -> Identity (f x))
+{-# INLINE pretextPeeks #-}
+
+pretextPeek :: b -> Pretext a b t -> t
+pretextPeek b (Pretext m) = runIdentity $ m (\_ -> Identity b)
+{-# INLINE pretextPeek #-}
+
+pretextPos :: Pretext a b t -> a
+pretextPos (Pretext m) = getConst (m Const)
+{-# INLINE pretextPos #-}
+
+cloneLens :: Functor f => ALens s t a b -> LensLike f s t a b
+cloneLens l f s = runPretext (l pretextSell s) f
+{-# INLINE cloneLens #-}
+
+-------------------------------------------------------------------------------
+-- Comonads
+-------------------------------------------------------------------------------
+
+-- | @lens@ variant is also parametrised by profunctor.
+data Pretext a b t = Pretext { runPretext :: forall f. Functor f => (a -> f b) -> f t }
+
+instance Functor (Pretext a b) where
+ fmap f (Pretext pretext) = Pretext (\afb -> fmap f (pretext afb))
+
+-------------------------------------------------------------------------------
+-- Documentation
+-------------------------------------------------------------------------------
+
+-- $development
+--
+-- We cannot depend on @template-haskell@, because Cabal is a boot library.
+-- This fact makes defining optics a manual task. Here is a small recipe to
+-- make the process less tedious.
+--
+-- First start a repl
+--
+-- > cabal new-repl Cabal:parser-hackage-tests -fparsec-struct-diff
+--
+-- Because @--extra-package@ isn't yet implemented, we use a test-suite
+-- with @generics-sop@ dependency.
+--
+-- In the repl, we load a helper script:
+--
+-- > :l ../generics-sop-lens.hs
+--
+-- Now we are set up to derive lenses!
+--
+-- > :m +Distribution.Types.SourceRepo
+-- > putStr $ genericLenses (Proxy :: Proxy SourceRepo)
+--
+-- @
+-- repoKind :: Lens' SourceRepo RepoKind
+-- repoKind f s = fmap (\\x -> s { T.repoKind = x }) (f (T.repoKind s))
+-- \{-# INLINE repoKind #-\}
+-- ...
+-- @
+--
+-- /Note:/ You may need to adjust type-aliases, e.g. `String` to `FilePath`.
diff --git a/cabal/Cabal/Distribution/Compat/Map/Strict.hs b/cabal/Cabal/Distribution/Compat/Map/Strict.hs
new file mode 100644
index 0000000..6823777
--- /dev/null
+++ b/cabal/Cabal/Distribution/Compat/Map/Strict.hs
@@ -0,0 +1,31 @@
+{-# LANGUAGE CPP #-}
+
+-- For bootstrapping GHC
+#ifdef MIN_VERSION_containers
+#if MIN_VERSION_containers(0,5,0)
+#define HAVE_containers_050
+#endif
+#endif
+
+module Distribution.Compat.Map.Strict
+ ( module X
+#ifdef HAVE_containers_050
+#else
+ , insertWith
+ , fromSet
+#endif
+ ) where
+
+#ifdef HAVE_containers_050
+import Data.Map.Strict as X
+#else
+import Data.Map as X hiding (insertWith, insertWith')
+import qualified Data.Map
+import qualified Data.Set
+
+insertWith :: Ord k => (a -> a -> a) -> k -> a -> Map k a -> Map k a
+insertWith = Data.Map.insertWith'
+
+fromSet :: (k -> a) -> Data.Set.Set k -> Map k a
+fromSet f = Data.Map.fromDistinctAscList . Prelude.map (\k -> (k, f k)) . Data.Set.toList
+#endif
diff --git a/cabal/Cabal/Distribution/Compat/Newtype.hs b/cabal/Cabal/Distribution/Compat/Newtype.hs
new file mode 100644
index 0000000..e45e97c
--- /dev/null
+++ b/cabal/Cabal/Distribution/Compat/Newtype.hs
@@ -0,0 +1,70 @@
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE FunctionalDependencies #-}
+-- | Per Conor McBride, the 'Newtype' typeclass represents the packing and
+-- unpacking of a newtype, and allows you to operatate under that newtype with
+-- functions such as 'ala'.
+module Distribution.Compat.Newtype (
+ Newtype (..),
+ ala,
+ alaf,
+ pack',
+ unpack',
+ ) where
+
+import Data.Functor.Identity (Identity (..))
+import Data.Monoid (Sum (..), Product (..), Endo (..))
+
+-- | The @FunctionalDependencies@ version of 'Newtype' type-class.
+--
+-- /Note:/ for actual newtypes the implementation can be
+-- @pack = coerce; unpack = coerce@. We don't have default implementation,
+-- because @Cabal@ have to support older than @base >= 4.7@ compilers.
+-- Also, 'Newtype' could witness a non-structural isomorphism.
+class Newtype n o | n -> o where
+ pack :: o -> n
+ unpack :: n -> o
+
+instance Newtype (Identity a) a where
+ pack = Identity
+ unpack = runIdentity
+
+instance Newtype (Sum a) a where
+ pack = Sum
+ unpack = getSum
+
+instance Newtype (Product a) a where
+ pack = Product
+ unpack = getProduct
+
+instance Newtype (Endo a) (a -> a) where
+ pack = Endo
+ unpack = appEndo
+
+-- |
+--
+-- >>> ala Sum foldMap [1, 2, 3, 4 :: Int]
+-- 10
+--
+-- /Note:/ the user supplied function for the newtype is /ignored/.
+--
+-- >>> ala (Sum . (+1)) foldMap [1, 2, 3, 4 :: Int]
+-- 10
+ala :: (Newtype n o, Newtype n' o') => (o -> n) -> ((o -> n) -> b -> n') -> (b -> o')
+ala pa hof = alaf pa hof id
+
+-- |
+--
+-- >>> alaf Sum foldMap length ["cabal", "install"]
+-- 12
+--
+-- /Note:/ as with 'ala', the user supplied function for the newtype is /ignored/.
+alaf :: (Newtype n o, Newtype n' o') => (o -> n) -> ((a -> n) -> b -> n') -> (a -> o) -> (b -> o')
+alaf _ hof f = unpack . hof (pack . f)
+
+-- | Variant of 'pack', which takes a phantom type.
+pack' :: Newtype n o => (o -> n) -> o -> n
+pack' _ = pack
+
+-- | Variant of 'pack', which takes a phantom type.
+unpack' :: Newtype n o => (o -> n) -> n -> o
+unpack' _ = unpack
diff --git a/cabal/Cabal/Distribution/Compat/Parsec.hs b/cabal/Cabal/Distribution/Compat/Parsec.hs
index 1352936..d9d368b 100644
--- a/cabal/Cabal/Distribution/Compat/Parsec.hs
+++ b/cabal/Cabal/Distribution/Compat/Parsec.hs
@@ -16,6 +16,7 @@ module Distribution.Compat.Parsec (
P.sepBy,
P.sepBy1,
P.choice,
+ P.eof,
-- * Char
integral,
@@ -24,6 +25,7 @@ module Distribution.Compat.Parsec (
P.satisfy,
P.space,
P.spaces,
+ skipSpaces1,
P.string,
munch,
munch1,
@@ -71,3 +73,6 @@ munch
=> (Char -> Bool)
-> P.ParsecT s u m String
munch = many . P.satisfy
+
+skipSpaces1 :: P.Stream s m Char => P.ParsecT s u m ()
+skipSpaces1 = P.skipMany1 P.space
diff --git a/cabal/Cabal/Distribution/Compat/Prelude.hs b/cabal/Cabal/Distribution/Compat/Prelude.hs
index 21eec8d..45dbd96 100644
--- a/cabal/Cabal/Distribution/Compat/Prelude.hs
+++ b/cabal/Cabal/Distribution/Compat/Prelude.hs
@@ -40,6 +40,7 @@ module Distribution.Compat.Prelude (
Binary (..),
Alternative (..),
MonadPlus (..),
+ IsString (..),
-- * Some types
IO, NoCallStackIO,
@@ -63,6 +64,7 @@ module Distribution.Compat.Prelude (
null, length,
find, foldl',
traverse_, for_,
+ any, all,
-- * Data.Traversable
Traversable, traverse, sequenceA,
@@ -93,7 +95,7 @@ module Distribution.Compat.Prelude (
-- We also could hide few partial function
import Prelude as BasePrelude hiding
- ( IO, mapM, mapM_, sequence, null, length, foldr
+ ( IO, mapM, mapM_, sequence, null, length, foldr, any, all
#if MINVER_base_48
, Word
-- We hide them, as we import only some members
@@ -109,7 +111,7 @@ import Distribution.Compat.Semigroup (Monoid (..))
import Data.Foldable (length, null)
#endif
-import Data.Foldable (Foldable (foldMap, foldr), find, foldl', for_, traverse_)
+import Data.Foldable (Foldable (foldMap, foldr), find, foldl', for_, traverse_, any, all)
import Data.Traversable (Traversable (traverse, sequenceA), for)
import Control.Applicative (Alternative (..))
@@ -131,6 +133,7 @@ import Data.List (intercalate, intersperse, isPrefixOf,
isSuffixOf, nub, nubBy, sort, sortBy,
unfoldr)
import Data.Maybe
+import Data.String (IsString (..))
import Data.Int
import Data.Word
diff --git a/cabal/Cabal/Distribution/Compat/ReadP.hs b/cabal/Cabal/Distribution/Compat/ReadP.hs
index 44afb1c..a9c79c8 100644
--- a/cabal/Cabal/Distribution/Compat/ReadP.hs
+++ b/cabal/Cabal/Distribution/Compat/ReadP.hs
@@ -44,6 +44,7 @@ module Distribution.Compat.ReadP
munch, -- :: (Char -> Bool) -> ReadP String
munch1, -- :: (Char -> Bool) -> ReadP String
skipSpaces, -- :: ReadP ()
+ skipSpaces1,-- :: ReadP ()
choice, -- :: [ReadP a] -> ReadP a
count, -- :: Int -> ReadP a -> ReadP [a]
between, -- :: ReadP open -> ReadP close -> ReadP a -> ReadP a
@@ -66,17 +67,23 @@ module Distribution.Compat.ReadP
-- * Running a parser
ReadS, -- :: *; = String -> [(a,String)]
readP_to_S, -- :: ReadP a -> ReadS a
- readS_to_P -- :: ReadS a -> ReadP a
+ readS_to_P, -- :: ReadS a -> ReadP a
+
+ -- ** Parsec
+ parsecToReadP,
)
where
import Prelude ()
import Distribution.Compat.Prelude hiding (many, get)
+import Control.Applicative (liftA2)
import qualified Distribution.Compat.MonadFail as Fail
import Control.Monad( replicateM, (>=>) )
+import qualified Text.Parsec as P
+
infixr 5 +++, <++
-- ---------------------------------------------------------------------------
@@ -297,6 +304,11 @@ skipSpaces =
skip (c:s) | isSpace c = do _ <- get; skip s
skip _ = do return ()
+skipSpaces1 :: ReadP r ()
+-- ^ Like 'skipSpaces' but succeeds only if there is at least one
+-- whitespace character to skip.
+skipSpaces1 = satisfy isSpace >> skipSpaces
+
count :: Int -> ReadP r a -> ReadP r [a]
-- ^ @ count n p @ parses @n@ occurrences of @p@ in sequence. A list of
-- results is returned.
@@ -408,3 +420,16 @@ readS_to_P :: ReadS a -> ReadP r a
-- parser, and therefore a possible inefficiency.
readS_to_P r =
R (\k -> Look (\s -> final [bs'' | (a,s') <- r s, bs'' <- run (k a) s']))
+
+-- ---------------------------------------------------------------------------
+-- Converting from Parsec to ReadP
+--
+-- | Convert @Parsec@ parser to 'ReadP'.
+parsecToReadP
+ :: P.Parsec [Char] u a
+ -> u -- ^ initial user state
+ -> ReadP r a
+parsecToReadP p u = R $ \k -> Look $ \s ->
+ case P.runParser (liftA2 (,) p P.getInput) u "<parsecToReadP>" s of
+ Right (x, s') -> final (run (k x) s')
+ Left _ -> Fail
diff --git a/cabal/Cabal/Distribution/Compat/Stack.hs b/cabal/Cabal/Distribution/Compat/Stack.hs
index 98e8159..0ed0da2 100644
--- a/cabal/Cabal/Distribution/Compat/Stack.hs
+++ b/cabal/Cabal/Distribution/Compat/Stack.hs
@@ -4,6 +4,7 @@
module Distribution.Compat.Stack (
WithCallStack,
CallStack,
+ annotateCallStackIO,
withFrozenCallStack,
withLexicalCallStack,
callStack,
@@ -11,6 +12,8 @@ module Distribution.Compat.Stack (
parentSrcLocPrefix
) where
+import System.IO.Error
+
#ifdef MIN_VERSION_base
#if MIN_VERSION_base(4,8,1)
#define GHC_STACK_SUPPORTED 1
@@ -94,3 +97,17 @@ withLexicalCallStack :: (a -> IO b) -> a -> IO b
withLexicalCallStack f = f
#endif
+
+-- | This function is for when you *really* want to add a call
+-- stack to raised IO, but you don't have a
+-- 'Distribution.Verbosity.Verbosity' so you can't use
+-- 'Distribution.Simple.Utils.annotateIO'. If you have a 'Verbosity',
+-- please use that function instead.
+annotateCallStackIO :: WithCallStack (IO a -> IO a)
+annotateCallStackIO = modifyIOError f
+ where
+ f ioe = ioeSetErrorString ioe
+ . wrapCallStack
+ $ ioeGetErrorString ioe
+ wrapCallStack s =
+ prettyCallStack callStack ++ "\n" ++ s
diff --git a/cabal/Cabal/Distribution/Compiler.hs b/cabal/Cabal/Distribution/Compiler.hs
index 4b5dcb7..b6a2675 100644
--- a/cabal/Cabal/Distribution/Compiler.hs
+++ b/cabal/Cabal/Distribution/Compiler.hs
@@ -51,8 +51,11 @@ import Language.Haskell.Extension
import Distribution.Version (Version, mkVersion', nullVersion)
import qualified System.Info (compilerName, compilerVersion)
+import Distribution.Parsec.Class (Parsec (..))
+import Distribution.Pretty (Pretty (..))
import Distribution.Text (Text(..), display)
import qualified Distribution.Compat.ReadP as Parse
+import qualified Distribution.Compat.Parsec as P
import qualified Text.PrettyPrint as Disp
data CompilerFlavor =
@@ -66,12 +69,20 @@ instance Binary CompilerFlavor
knownCompilerFlavors :: [CompilerFlavor]
knownCompilerFlavors = [GHC, GHCJS, NHC, YHC, Hugs, HBC, Helium, JHC, LHC, UHC]
-instance Text CompilerFlavor where
- disp (OtherCompiler name) = Disp.text name
- disp (HaskellSuite name) = Disp.text name
- disp NHC = Disp.text "nhc98"
- disp other = Disp.text (lowercase (show other))
+instance Pretty CompilerFlavor where
+ pretty (OtherCompiler name) = Disp.text name
+ pretty (HaskellSuite name) = Disp.text name
+ pretty NHC = Disp.text "nhc98"
+ pretty other = Disp.text (lowercase (show other))
+
+instance Parsec CompilerFlavor where
+ parsec = classifyCompilerFlavor <$> component
+ where
+ component = do
+ cs <- P.munch1 isAlphaNum
+ if all isDigit cs then fail "all digits compiler name" else return cs
+instance Text CompilerFlavor where
parse = do
comp <- Parse.munch1 isAlphaNum
when (all isDigit comp) Parse.pfail
@@ -81,7 +92,7 @@ classifyCompilerFlavor :: String -> CompilerFlavor
classifyCompilerFlavor s =
fromMaybe (OtherCompiler s) $ lookup (lowercase s) compilerMap
where
- compilerMap = [ (display compiler, compiler)
+ compilerMap = [ (lowercase (display compiler), compiler)
| compiler <- knownCompilerFlavors ]
diff --git a/cabal/Cabal/Distribution/FieldGrammar.hs b/cabal/Cabal/Distribution/FieldGrammar.hs
new file mode 100644
index 0000000..3d80d9f
--- /dev/null
+++ b/cabal/Cabal/Distribution/FieldGrammar.hs
@@ -0,0 +1,86 @@
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+-- | This module provides a way to specify a grammar of @.cabal@ -like files.
+module Distribution.FieldGrammar (
+ -- * Field grammar type
+ FieldGrammar (..),
+ uniqueField,
+ optionalField,
+ optionalFieldDef,
+ optionalFieldDefAla,
+ monoidalField,
+ deprecatedField',
+ -- * Concrete grammar implementations
+ ParsecFieldGrammar,
+ ParsecFieldGrammar',
+ parseFieldGrammar,
+ fieldGrammarKnownFieldList,
+ PrettyFieldGrammar,
+ PrettyFieldGrammar',
+ prettyFieldGrammar,
+ -- * Auxlilary
+ (^^^),
+ Section(..),
+ Fields,
+ partitionFields,
+ takeFields,
+ runFieldParser,
+ runFieldParser',
+ ) where
+
+import Distribution.Compat.Prelude
+import Prelude ()
+
+import qualified Distribution.Compat.Map.Strict as Map
+
+import Distribution.FieldGrammar.Class
+import Distribution.FieldGrammar.Parsec
+import Distribution.FieldGrammar.Pretty
+import Distribution.Parsec.Field
+import Distribution.Utils.Generic (spanMaybe)
+
+type ParsecFieldGrammar' a = ParsecFieldGrammar a a
+type PrettyFieldGrammar' a = PrettyFieldGrammar a a
+
+infixl 5 ^^^
+
+-- | Reverse function application which binds tighter than '<$>' and '<*>'.
+-- Useful for refining grammar specification.
+--
+-- @
+-- \<*\> 'monoidalFieldAla' "extensions" (alaList' FSep MQuoted) oldExtensions
+-- ^^^ 'deprecatedSince' [1,12] "Please use 'default-extensions' or 'other-extensions' fields."
+-- @
+(^^^) :: a -> (a -> b) -> b
+x ^^^ f = f x
+
+-- | Partitioning state
+data PS ann = PS (Fields ann) [Section ann] [[Section ann]]
+
+-- | Partition field list into field map and groups of sections.
+partitionFields :: [Field ann] -> (Fields ann, [[Section ann]])
+partitionFields = finalize . foldl' f (PS mempty mempty mempty)
+ where
+ finalize :: PS ann -> (Fields ann, [[Section ann]])
+ finalize (PS fs s ss)
+ | null s = (fs, reverse ss)
+ | otherwise = (fs, reverse (reverse s : ss))
+
+ f :: PS ann -> Field ann -> PS ann
+ f (PS fs s ss) (Field (Name ann name) fss) =
+ PS (Map.insertWith (flip (++)) name [MkNamelessField ann fss] fs) [] ss'
+ where
+ ss' | null s = ss
+ | otherwise = reverse s : ss
+ f (PS fs s ss) (Section name sargs sfields) =
+ PS fs (MkSection name sargs sfields : s) ss
+
+-- | Take all fields from the front.
+takeFields :: [Field ann] -> (Fields ann, [Field ann])
+takeFields = finalize . spanMaybe match
+ where
+ finalize (fs, rest) = (Map.fromListWith (flip (++)) fs, rest)
+
+ match (Field (Name ann name) fs) = Just (name, [MkNamelessField ann fs])
+ match _ = Nothing
diff --git a/cabal/Cabal/Distribution/FieldGrammar/Class.hs b/cabal/Cabal/Distribution/FieldGrammar/Class.hs
new file mode 100644
index 0000000..853fec2
--- /dev/null
+++ b/cabal/Cabal/Distribution/FieldGrammar/Class.hs
@@ -0,0 +1,149 @@
+module Distribution.FieldGrammar.Class (
+ FieldGrammar (..),
+ uniqueField,
+ optionalField,
+ optionalFieldDef,
+ optionalFieldDefAla,
+ monoidalField,
+ deprecatedField',
+ ) where
+
+import Distribution.Compat.Lens
+import Distribution.Compat.Prelude
+import Prelude ()
+
+import Data.Functor.Identity (Identity (..))
+
+import Distribution.Compat.Newtype (Newtype)
+import Distribution.Parsec.Class (Parsec)
+import Distribution.Parsec.Field
+import Distribution.Pretty (Pretty)
+
+-- | 'FieldGrammar' is parametrised by
+--
+-- * @s@ which is a structure we are parsing. We need this to provide prettyprinter
+-- functionality
+--
+-- * @a@ type of the field.
+--
+-- /Note:/ We'd like to have @forall s. Applicative (f s)@ context.
+--
+class FieldGrammar g where
+ -- | Unfocus, zoom out, /blur/ 'FieldGrammar'.
+ blurFieldGrammar :: ALens' a b -> g b c -> g a c
+
+ -- | Field which should be defined, exactly once.
+ uniqueFieldAla
+ :: (Parsec b, Pretty b, Newtype b a)
+ => FieldName -- ^ field name
+ -> (a -> b) -- ^ 'Newtype' pack
+ -> ALens' s a -- ^ lens into the field
+ -> g s a
+
+ -- | Boolean field with a default value.
+ booleanFieldDef
+ :: FieldName -- ^ field name
+ -> ALens' s Bool -- ^ lens into the field
+ -> Bool -- ^ default
+ -> g s Bool
+
+ -- | Optional field.
+ optionalFieldAla
+ :: (Parsec b, Pretty b, Newtype b a)
+ => FieldName -- ^ field name
+ -> (a -> b) -- ^ 'pack'
+ -> ALens' s (Maybe a) -- ^ lens into the field
+ -> g s (Maybe a)
+
+ -- | Monoidal field.
+ --
+ -- Values are combined with 'mappend'.
+ --
+ -- /Note:/ 'optionalFieldAla' is a @monoidalField@ with 'Last' monoid.
+ --
+ monoidalFieldAla
+ :: (Parsec b, Pretty b, Monoid a, Newtype b a)
+ => FieldName -- ^ field name
+ -> (a -> b) -- ^ 'pack'
+ -> ALens' s a -- ^ lens into the field
+ -> g s a
+
+ -- | Parser matching all fields with a name starting with a prefix.
+ prefixedFields
+ :: FieldName -- ^ field name prefix
+ -> ALens' s [(String, String)] -- ^ lens into the field
+ -> g s [(String, String)]
+
+ -- | Known field, which we don't parse, neither pretty print.
+ knownField :: FieldName -> g s ()
+
+ -- | Field which is parsed but not pretty printed.
+ hiddenField :: g s a -> g s a
+
+ -- | Deprecated since
+ deprecatedSince
+ :: [Int] -- ^ version
+ -> String -- ^ deprecation message
+ -> g s a
+ -> g s a
+
+ -- | Annotate field with since spec-version.
+ availableSince
+ :: [Int] -- ^ spec version
+ -> g s a
+ -> g s a
+
+-- | Field which can be defined at most once.
+uniqueField
+ :: (FieldGrammar g, Parsec a, Pretty a)
+ => FieldName -- ^ field name
+ -> ALens' s a -- ^ lens into the field
+ -> g s a
+uniqueField fn = uniqueFieldAla fn Identity
+
+-- | Field which can be defined at most once.
+optionalField
+ :: (FieldGrammar g, Parsec a, Pretty a)
+ => FieldName -- ^ field name
+ -> ALens' s (Maybe a) -- ^ lens into the field
+ -> g s (Maybe a)
+optionalField fn = optionalFieldAla fn Identity
+
+-- | Optional field with default value.
+optionalFieldDef
+ :: (FieldGrammar g, Functor (g s), Parsec a, Pretty a, Eq a, Show a)
+ => FieldName -- ^ field name
+ -> LensLike' (Pretext (Maybe a) (Maybe a)) s a -- ^ @'Lens'' s a@: lens into the field
+ -> a -- ^ default value
+ -> g s a
+optionalFieldDef fn = optionalFieldDefAla fn Identity
+
+-- | Optional field with default value.
+optionalFieldDefAla
+ :: (FieldGrammar g, Functor (g s), Parsec b, Pretty b, Newtype b a, Eq a, Show a)
+ => FieldName -- ^ field name
+ -> (a -> b) -- ^ 'Newtype' pack
+ -> LensLike' (Pretext (Maybe a) (Maybe a)) s a -- ^ @'Lens'' s a@: lens into the field
+ -> a -- ^ default value
+ -> g s a
+optionalFieldDefAla fn pack l def =
+ fromMaybe def <$> optionalFieldAla fn pack (l . fromNon def)
+
+-- | Field which can be define multiple times, and the results are @mappend@ed.
+monoidalField
+ :: (FieldGrammar g, Parsec a, Pretty a, Monoid a)
+ => FieldName -- ^ field name
+ -> ALens' s a -- ^ lens into the field
+ -> g s a
+monoidalField fn = monoidalFieldAla fn Identity
+
+-- | Deprecated field. If found, warning is issued.
+--
+-- /Note:/ also it's not pretty printed!
+--
+deprecatedField'
+ :: FieldGrammar g
+ => String -- ^ deprecation message
+ -> g s a
+ -> g s a
+deprecatedField' = deprecatedSince []
diff --git a/cabal/Cabal/Distribution/FieldGrammar/Parsec.hs b/cabal/Cabal/Distribution/FieldGrammar/Parsec.hs
new file mode 100644
index 0000000..bf72f8f
--- /dev/null
+++ b/cabal/Cabal/Distribution/FieldGrammar/Parsec.hs
@@ -0,0 +1,260 @@
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE OverloadedStrings #-}
+-- | This module provides a 'FieldGrammarParser', one way to parse
+-- @.cabal@ -like files.
+--
+-- Fields can be specified multiple times in the .cabal files. The order of
+-- such entries is important, but the mutual ordering of different fields is
+-- not.Also conditional sections are considered after non-conditional data.
+-- The example of this silent-commutation quirk is the fact that
+--
+-- @
+-- buildable: True
+-- if os(linux)
+-- buildable: False
+-- @
+--
+-- and
+--
+-- @
+-- if os(linux)
+-- buildable: False
+-- buildable: True
+-- @
+--
+-- behave the same! This is the limitation of 'GeneralPackageDescription'
+-- structure.
+--
+-- So we transform the list of fields @['Field' ann]@ into
+-- a map of grouped ordinary fields and a list of lists of sections:
+-- @'Fields' ann = 'Map' 'FieldName' ['NamelessField' ann]@ and @[['Section' ann]]@.
+--
+-- We need list of list of sections, because we need to distinguish situations
+-- where there are fields in between. For example
+--
+-- @
+-- if flag(bytestring-lt-0_10_4)
+-- build-depends: bytestring < 0.10.4
+--
+-- default-language: Haskell2020
+--
+-- else
+-- build-depends: bytestring >= 0.10.4
+--
+-- @
+--
+-- is obviously invalid specification.
+--
+-- We can parse 'Fields' like we parse @aeson@ objects, yet we use
+-- slighly higher-level API, so we can process unspecified fields,
+-- to report unknown fields and save custom @x-fields@.
+--
+module Distribution.FieldGrammar.Parsec (
+ ParsecFieldGrammar,
+ parseFieldGrammar,
+ fieldGrammarKnownFieldList,
+ -- * Auxiliary
+ Fields,
+ NamelessField (..),
+ Section (..),
+ runFieldParser,
+ runFieldParser',
+ ) where
+
+import qualified Data.ByteString as BS
+import Data.List (dropWhileEnd)
+import Data.Ord (comparing)
+import Data.Set (Set)
+import qualified Data.Set as Set
+import qualified Distribution.Compat.Map.Strict as Map
+import Distribution.Compat.Prelude
+import Distribution.Compat.Newtype
+import Distribution.Simple.Utils (fromUTF8BS)
+import Prelude ()
+import qualified Text.Parsec as P
+import qualified Text.Parsec.Error as P
+
+import Distribution.FieldGrammar.Class
+import Distribution.Parsec.Class
+import Distribution.Parsec.Common
+import Distribution.Parsec.Field
+import Distribution.Parsec.ParseResult
+
+-------------------------------------------------------------------------------
+-- Auxiliary types
+-------------------------------------------------------------------------------
+
+type Fields ann = Map FieldName [NamelessField ann]
+
+-- | Single field, without name, but with its annotation.
+data NamelessField ann = MkNamelessField !ann [FieldLine ann]
+ deriving (Eq, Show, Functor)
+
+-- | The 'Section' constructor of 'Field'.
+data Section ann = MkSection !(Name ann) [SectionArg ann] [Field ann]
+ deriving (Eq, Show, Functor)
+
+-------------------------------------------------------------------------------
+-- ParsecFieldGrammar
+-------------------------------------------------------------------------------
+
+data ParsecFieldGrammar s a = ParsecFG
+ { fieldGrammarKnownFields :: !(Set FieldName)
+ , fieldGrammarKnownPrefixes :: !(Set FieldName)
+ , fieldGrammarParser :: !(Fields Position -> ParseResult a)
+ }
+ deriving (Functor)
+
+parseFieldGrammar :: Fields Position -> ParsecFieldGrammar s a -> ParseResult a
+parseFieldGrammar fields grammar = do
+ for_ (Map.toList (Map.filterWithKey isUnknownField fields)) $ \(name, nfields) ->
+ for_ nfields $ \(MkNamelessField pos _) ->
+ parseWarning pos PWTUnknownField $ "Unknown field: " ++ show name
+ -- TODO: fields allowed in this section
+
+ -- parse
+ fieldGrammarParser grammar fields
+
+ where
+ isUnknownField k _ = not $
+ k `Set.member` fieldGrammarKnownFields grammar
+ || any (`BS.isPrefixOf` k) (fieldGrammarKnownPrefixes grammar)
+
+fieldGrammarKnownFieldList :: ParsecFieldGrammar s a -> [FieldName]
+fieldGrammarKnownFieldList = Set.toList . fieldGrammarKnownFields
+
+instance Applicative (ParsecFieldGrammar s) where
+ pure x = ParsecFG mempty mempty (\_ -> pure x)
+ {-# INLINE pure #-}
+
+ ParsecFG f f' f'' <*> ParsecFG x x' x'' = ParsecFG
+ (mappend f x)
+ (mappend f' x')
+ (\fields -> f'' fields <*> x'' fields)
+ {-# INLINE (<*>) #-}
+
+instance FieldGrammar ParsecFieldGrammar where
+ blurFieldGrammar _ (ParsecFG s s' parser) = ParsecFG s s' parser
+
+ uniqueFieldAla fn _pack _extract = ParsecFG (Set.singleton fn) Set.empty parser
+ where
+ parser fields = case Map.lookup fn fields of
+ Nothing -> parseFatalFailure zeroPos $ show fn ++ " field missing:"
+ Just [] -> parseFatalFailure zeroPos $ show fn ++ " field foo"
+ Just [x] -> parseOne x
+ -- TODO: parse all
+ -- TODO: warn about duplicate fields?
+ Just xs-> parseOne (last xs)
+
+ parseOne (MkNamelessField pos fls) =
+ unpack' _pack <$> runFieldParser pos parsec fls
+
+ booleanFieldDef fn _extract def = ParsecFG (Set.singleton fn) Set.empty parser
+ where
+ parser :: Fields Position -> ParseResult Bool
+ parser fields = case Map.lookup fn fields of
+ Nothing -> pure def
+ Just [] -> pure def
+ Just [x] -> parseOne x
+ -- TODO: parse all
+ -- TODO: warn about duplicate optional fields?
+ Just xs -> parseOne (last xs)
+
+ parseOne (MkNamelessField pos fls) = runFieldParser pos parsec fls
+
+ optionalFieldAla fn _pack _extract = ParsecFG (Set.singleton fn) Set.empty parser
+ where
+ parser fields = case Map.lookup fn fields of
+ Nothing -> pure Nothing
+ Just [] -> pure Nothing
+ Just [x] -> parseOne x
+ -- TODO: parse all!
+ Just xs -> parseOne (last xs) -- TODO: warn about duplicate optional fields?
+
+ parseOne (MkNamelessField pos fls)
+ | null fls = pure Nothing
+ | otherwise = Just . (unpack' _pack) <$> runFieldParser pos parsec fls
+
+ monoidalFieldAla fn _pack _extract = ParsecFG (Set.singleton fn) Set.empty parser
+ where
+ parser fields = case Map.lookup fn fields of
+ Nothing -> pure mempty
+ Just xs -> foldMap (unpack' _pack) <$> traverse parseOne xs
+
+ parseOne (MkNamelessField pos fls) = runFieldParser pos parsec fls
+
+ prefixedFields fnPfx _extract = ParsecFG mempty (Set.singleton fnPfx) (pure . parser)
+ where
+ parser :: Fields Position -> [(String, String)]
+ parser values = reorder $ concatMap convert $ filter match $ Map.toList values
+
+ match (fn, _) = fnPfx `BS.isPrefixOf` fn
+ convert (fn, fields) =
+ -- TODO: warn about invalid UTF8
+ [ (pos, (fromUTF8BS fn, trim $ fromUTF8BS $ fieldlinesToBS fls))
+ | MkNamelessField pos fls <- fields
+ ]
+ -- hack: recover the order of prefixed fields
+ reorder = map snd . sortBy (comparing fst)
+ trim :: String -> String
+ trim = dropWhile isSpace . dropWhileEnd isSpace
+
+ availableSince _ = id
+
+ deprecatedSince (_ : _) _ grammar = grammar -- pass on non-empty version
+ deprecatedSince _ msg (ParsecFG names prefixes parser) = ParsecFG names prefixes parser'
+ where
+ parser' values = do
+ let deprecatedFields = Map.intersection values $ Map.fromSet (const ()) names
+ for_ (Map.toList deprecatedFields) $ \(name, fields) ->
+ for_ fields $ \(MkNamelessField pos _) ->
+ parseWarning pos PWTDeprecatedField $
+ "The field " <> show name <> " is deprecated. " ++ msg
+
+ parser values
+
+ knownField fn = ParsecFG (Set.singleton fn) Set.empty (\_ -> pure ())
+
+ hiddenField = id
+
+-------------------------------------------------------------------------------
+-- Parsec
+-------------------------------------------------------------------------------
+
+runFieldParser' :: Position -> FieldParser a -> String -> ParseResult a
+runFieldParser' (Position row col) p str = case P.runParser p' [] "<field>" str of
+ Right (pok, ws) -> do
+ -- TODO: map pos
+ traverse_ (\(PWarning t pos w) -> parseWarning pos t w) ws
+ pure pok
+ Left err -> do
+ let ppos = P.errorPos err
+ -- Positions start from 1:1, not 0:0
+ let epos = Position (row - 1 + P.sourceLine ppos) (col - 1 + P.sourceColumn ppos)
+ let msg = P.showErrorMessages
+ "or" "unknown parse error" "expecting" "unexpected" "end of input"
+ (P.errorMessages err)
+
+ parseFatalFailure epos $ msg ++ ": " ++ show str
+ where
+ p' = (,) <$ P.spaces <*> p <* P.spaces <* P.eof <*> P.getState
+
+runFieldParser :: Position -> FieldParser a -> [FieldLine Position] -> ParseResult a
+runFieldParser pp p ls = runFieldParser' pos p =<< fieldlinesToString pos ls
+ where
+ -- TODO: make per line lookup
+ pos = case ls of
+ [] -> pp
+ (FieldLine pos' _ : _) -> pos'
+
+fieldlinesToBS :: [FieldLine ann] -> BS.ByteString
+fieldlinesToBS = BS.intercalate "\n" . map (\(FieldLine _ bs) -> bs)
+
+-- TODO: Take position from FieldLine
+-- TODO: Take field name
+fieldlinesToString :: Position -> [FieldLine ann] -> ParseResult String
+fieldlinesToString pos fls =
+ let str = intercalate "\n" . map (\(FieldLine _ bs') -> fromUTF8BS bs') $ fls
+ in if '\xfffd' `elem` str
+ then str <$ parseWarning pos PWTUTF "Invalid UTF8 encoding"
+ else pure str
diff --git a/cabal/Cabal/Distribution/FieldGrammar/Pretty.hs b/cabal/Cabal/Distribution/FieldGrammar/Pretty.hs
new file mode 100644
index 0000000..865ba10
--- /dev/null
+++ b/cabal/Cabal/Distribution/FieldGrammar/Pretty.hs
@@ -0,0 +1,70 @@
+{-# LANGUAGE DeriveFunctor #-}
+module Distribution.FieldGrammar.Pretty (
+ PrettyFieldGrammar,
+ prettyFieldGrammar,
+ ) where
+
+import Distribution.Compat.Lens
+import Distribution.Compat.Newtype
+import Distribution.Compat.Prelude
+import Distribution.Pretty (Pretty (..))
+import Distribution.Simple.Utils (fromUTF8BS)
+import Prelude ()
+import Text.PrettyPrint (Doc)
+import qualified Text.PrettyPrint as PP
+
+import Distribution.FieldGrammar.Class
+import Distribution.ParseUtils (ppField)
+
+newtype PrettyFieldGrammar s a = PrettyFG
+ { fieldGrammarPretty :: s -> Doc
+ }
+ deriving (Functor)
+
+instance Applicative (PrettyFieldGrammar s) where
+ pure _ = PrettyFG (\_ -> mempty)
+ PrettyFG f <*> PrettyFG x = PrettyFG (\s -> f s PP.$$ x s)
+
+-- | We can use 'PrettyFieldGrammar' to pp print the @s@.
+prettyFieldGrammar :: PrettyFieldGrammar s a -> s -> Doc
+prettyFieldGrammar = fieldGrammarPretty
+
+instance FieldGrammar PrettyFieldGrammar where
+ blurFieldGrammar f (PrettyFG pp) = PrettyFG (pp . aview f)
+
+ uniqueFieldAla fn _pack l = PrettyFG $ \s ->
+ ppField (fromUTF8BS fn) (pretty (pack' _pack (aview l s)))
+
+ booleanFieldDef fn l def = PrettyFG pp
+ where
+ pp s
+ | b == def = mempty
+ | otherwise = ppField (fromUTF8BS fn) (PP.text (show b))
+ where
+ b = aview l s
+
+ optionalFieldAla fn _pack l = PrettyFG pp
+ where
+ pp s = case aview l s of
+ Nothing -> mempty
+ Just a -> ppField (fromUTF8BS fn) (pretty (pack' _pack a))
+
+ monoidalFieldAla fn _pack l = PrettyFG pp
+ where
+ pp s = ppField (fromUTF8BS fn) (pretty (pack' _pack (aview l s)))
+
+ prefixedFields _fnPfx l = PrettyFG (pp . aview l)
+ where
+ pp xs = PP.vcat
+ -- always print the field, even its Doc is empty
+ -- i.e. don't use ppField
+ [ PP.text n <<>> PP.colon PP.<+> (PP.vcat $ map PP.text $ lines s)
+ | (n, s) <- xs
+ -- fnPfx `isPrefixOf` n
+ ]
+
+ knownField _ = pure ()
+ deprecatedSince [] _ _ = PrettyFG (\_ -> mempty)
+ deprecatedSince _ _ x = x
+ availableSince _ = id
+ hiddenField _ = PrettyFG (\_ -> mempty)
diff --git a/cabal/Cabal/Distribution/InstalledPackageInfo.hs b/cabal/Cabal/Distribution/InstalledPackageInfo.hs
index ec5ef28..6bacbb4 100644
--- a/cabal/Cabal/Distribution/InstalledPackageInfo.hs
+++ b/cabal/Cabal/Distribution/InstalledPackageInfo.hs
@@ -32,9 +32,11 @@ module Distribution.InstalledPackageInfo (
InstalledPackageInfo(..),
installedPackageId,
installedComponentId,
- requiredSignatures,
installedOpenUnitId,
+ sourceComponentName,
+ requiredSignatures,
ExposedModule(..),
+ AbiDependency(..),
ParseResult(..), PError(..), PWarning,
emptyInstalledPackageInfo,
parseInstalledPackageInfo,
@@ -50,7 +52,6 @@ import Distribution.Compat.Prelude
import Distribution.ParseUtils
import Distribution.License
import Distribution.Package hiding (installedUnitId, installedPackageId)
-import Distribution.Package.TextClass ()
import Distribution.Backpack
import qualified Distribution.Package as Package
import Distribution.ModuleName
@@ -58,6 +59,10 @@ import Distribution.Version
import Distribution.Text
import qualified Distribution.Compat.ReadP as Parse
import Distribution.Compat.Graph
+import Distribution.Types.MungedPackageId
+import Distribution.Types.ComponentName
+import Distribution.Types.MungedPackageName
+import Distribution.Types.UnqualComponentName
import Text.PrettyPrint as Disp
import qualified Data.Char as Char
@@ -80,6 +85,7 @@ data InstalledPackageInfo
-- indefinite, OpenModule is always an OpenModuleVar
-- with the same ModuleName as the key.
instantiatedWith :: [(ModuleName, OpenModule)],
+ sourceLibName :: Maybe UnqualComponentName,
compatPackageKey :: String,
license :: License,
copyright :: String,
@@ -112,6 +118,7 @@ data InstalledPackageInfo
-- INVARIANT: if the package is definite, UnitId is NOT
-- a ComponentId of an indefinite package
depends :: [UnitId],
+ abiDepends :: [AbiDependency],
ccOptions :: [String],
ldOptions :: [String],
frameworkDirs :: [FilePath],
@@ -144,6 +151,7 @@ requiredSignatures ipi = openModuleSubstFreeHoles (Map.fromList (instantiatedWit
{-# DEPRECATED installedPackageId "Use installedUnitId instead" #-}
-- | Backwards compatibility with Cabal pre-1.24.
+--
-- This type synonym is slightly awful because in cabal-install
-- we define an 'InstalledPackageId' but it's a ComponentId,
-- not a UnitId!
@@ -152,6 +160,9 @@ installedPackageId = installedUnitId
instance Binary InstalledPackageInfo
+instance Package.HasMungedPackageId InstalledPackageInfo where
+ mungedId = mungedPackageId
+
instance Package.Package InstalledPackageInfo where
packageId = sourcePackageId
@@ -173,6 +184,7 @@ emptyInstalledPackageInfo
installedUnitId = mkUnitId "",
installedComponentId_ = mkComponentId "",
instantiatedWith = [],
+ sourceLibName = Nothing,
compatPackageKey = "",
license = UnspecifiedLicense,
copyright = "",
@@ -200,6 +212,7 @@ emptyInstalledPackageInfo
includeDirs = [],
includes = [],
depends = [],
+ abiDepends = [],
ccOptions = [],
ldOptions = [],
frameworkDirs = [],
@@ -252,6 +265,89 @@ showExposedModules xs
parseExposedModules :: Parse.ReadP r [ExposedModule]
parseExposedModules = parseOptCommaList parse
+dispMaybe :: Text a => Maybe a -> Disp.Doc
+dispMaybe Nothing = Disp.empty
+dispMaybe (Just x) = disp x
+
+parseMaybe :: Text a => Parse.ReadP r (Maybe a)
+parseMaybe = fmap Just parse Parse.<++ return Nothing
+
+-- -----------------------------------------------------------------------------
+-- ABI dependency
+
+-- | An ABI dependency is a dependency on a library which also
+-- records the ABI hash ('abiHash') of the library it depends
+-- on.
+--
+-- The primary utility of this is to enable an extra sanity when
+-- GHC loads libraries: it can check if the dependency has a matching
+-- ABI and if not, refuse to load this library. This information
+-- is critical if we are shadowing libraries; differences in the
+-- ABI hash let us know what packages get shadowed by the new version
+-- of a package.
+data AbiDependency = AbiDependency {
+ depUnitId :: UnitId,
+ depAbiHash :: AbiHash
+ }
+ deriving (Eq, Generic, Read, Show)
+
+instance Text AbiDependency where
+ disp (AbiDependency uid abi) =
+ disp uid <<>> Disp.char '=' <<>> disp abi
+ parse = do
+ uid <- parse
+ _ <- Parse.char '='
+ abi <- parse
+ return (AbiDependency uid abi)
+
+instance Binary AbiDependency
+
+-- -----------------------------------------------------------------------------
+-- Munging
+
+sourceComponentName :: InstalledPackageInfo -> ComponentName
+sourceComponentName ipi =
+ case sourceLibName ipi of
+ Nothing -> CLibName
+ Just qn -> CSubLibName qn
+
+-- | Returns @Just@ if the @name@ field of the IPI record would not contain
+-- the package name verbatim. This helps us avoid writing @package-name@
+-- when it's redundant.
+maybePackageName :: InstalledPackageInfo -> Maybe PackageName