Skip to content

Commit

Permalink
Separate GenericPackageDescription from PackageDescription
Browse files Browse the repository at this point in the history
Now, neither contains the other, and their common fields are contained
in 'CommonPackageDependencies'.
  • Loading branch information
Ericson2314 committed Feb 14, 2018
1 parent 0ed8c35 commit 7a40f92
Show file tree
Hide file tree
Showing 40 changed files with 1,010 additions and 649 deletions.
2 changes: 2 additions & 0 deletions Cabal/Cabal.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ library
Distribution.Types.BenchmarkType
Distribution.Types.BuildInfo
Distribution.Types.BuildType
Distribution.Types.CommonPackageDescription
Distribution.Types.ComponentInclude
Distribution.Types.Dependency
Distribution.Types.ExeDependency
Expand Down Expand Up @@ -392,6 +393,7 @@ library
Distribution.Types.Lens
Distribution.Types.Benchmark.Lens
Distribution.Types.BuildInfo.Lens
Distribution.Types.CommonPackageDescription.Lens
Distribution.Types.Executable.Lens
Distribution.Types.ForeignLib.Lens
Distribution.Types.GenericPackageDescription.Lens
Expand Down
2 changes: 1 addition & 1 deletion Cabal/Distribution/Backpack/Configure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ configureComponentLocalBuildInfos
| otherwise = error ("uid_lookup: " ++ display uid)
where uid = unDefUnitId def_uid
graph2 <- toLinkedComponents verbosity uid_lookup
(package pkg_descr) shape_pkg_map graph1
(packageId pkg_descr) shape_pkg_map graph1

infoProgress $
hang (text "Linked component graph:") 4
Expand Down
4 changes: 2 additions & 2 deletions Cabal/Distribution/Backpack/ConfiguredComponent.hs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ mkConfiguredComponent pkg_descr this_cid lib_deps exe_deps component = do
return ConfiguredComponent {
cc_ann_id = AnnotatedId {
ann_id = this_cid,
ann_pid = package pkg_descr,
ann_pid = packageId pkg_descr,
ann_cname = componentName component
},
cc_component = component,
Expand Down Expand Up @@ -230,7 +230,7 @@ toConfiguredComponent' use_external_internal_deps flags
else cc
where
-- TODO: pass component names to it too!
this_cid = computeComponentId deterministic ipid_flag cid_flag (package pkg_descr)
this_cid = computeComponentId deterministic ipid_flag cid_flag (packageId pkg_descr)
(componentName component) (Just (deps, flags))
deps = [ ann_id aid | m <- Map.elems dep_map
, aid <- Map.elems m ]
Expand Down
9 changes: 4 additions & 5 deletions Cabal/Distribution/PackageDescription.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ module Distribution.PackageDescription (
-- * Package descriptions
PackageDescription(..),
emptyPackageDescription,
specVersion,
buildType,
license,
descCabalVersion,
BuildType(..),
knownBuildTypes,
allLibraries,

-- * package description shared
CommonPackageDescription(..),

-- ** Renaming (syntactic)
ModuleRenaming(..),
defaultRenaming,
Expand Down Expand Up @@ -72,7 +72,6 @@ module Distribution.PackageDescription (
-- * Build information
BuildInfo(..),
emptyBuildInfo,
allBuildInfo,
allLanguages,
allExtensions,
usedExtensions,
Expand All @@ -83,7 +82,6 @@ module Distribution.PackageDescription (
hcStaticOptions,

-- ** Supplementary build information
allBuildDepends,
enabledBuildDepends,
ComponentName(..),
defaultLibName,
Expand Down Expand Up @@ -130,6 +128,7 @@ import Distribution.Types.ModuleReexport
import Distribution.Types.BuildInfo
import Distribution.Types.SetupBuildInfo
import Distribution.Types.BuildType
import Distribution.Types.CommonPackageDescription
import Distribution.Types.GenericPackageDescription
import Distribution.Types.CondTree
import Distribution.Types.Condition
Expand Down
Loading

0 comments on commit 7a40f92

Please sign in to comment.