summaryrefslogtreecommitdiff
path: root/compiler/backpack/BkpSyn.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-01-15 16:48:30 (GMT)
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-01-31 07:46:15 (GMT)
commit29c701c154cafa4844cf3c1bd4a93cacfa6b1ee1 (patch)
tree88a060f43c73306463510b53607c1fd9460bd84b /compiler/backpack/BkpSyn.hs
parentbf38a20eefcaaaac404a1818c3eff8273dc67dd9 (diff)
downloadghc-29c701c154cafa4844cf3c1bd4a93cacfa6b1ee1.zip
ghc-29c701c154cafa4844cf3c1bd4a93cacfa6b1ee1.tar.gz
ghc-29c701c154cafa4844cf3c1bd4a93cacfa6b1ee1.tar.bz2
Refactor package related code
The package terminology is a bit of a mess. Cabal packages contain components. Instances of these components when built with some flags/options/dependencies are called units. Units are registered into package databases and their metadata are called PackageConfig. GHC only knows about package databases containing units. It is a sad mismatch not fixed by this patch (we would have to rename parameters such as `package-id <unit-id>` which would affect users). This patch however fixes the following internal names: - Renames PackageConfig into UnitInfo. - Rename systemPackageConfig into globalPackageDatabase[Path] - Rename PkgConfXX into PkgDbXX - Rename pkgIdMap into unitIdMap - Rename ModuleToPkgDbAll into ModuleNameProvidersMap - Rename lookupPackage into lookupUnit - Add comments on DynFlags package related fields It also introduces a new `PackageDatabase` datatype instead of explicitly passing the following tuple: `(FilePath,[PackageConfig])`. The `pkgDatabase` field in `DynFlags` now contains the unit info for each unit of each package database exactly as they have been read from disk. Previously the command-line flag `-distrust-all-packages` would modify these unit info. Now this flag only affects the "dynamic" consolidated package state found in `pkgState` field. It makes sense because `initPackages` could be called first with this `distrust-all-packages` flag set and then again (using ghc-api) without and it should work (package databases are not read again from disk when `initPackages` is called the second time). Bump haddock submodule
Diffstat (limited to 'compiler/backpack/BkpSyn.hs')
-rw-r--r--compiler/backpack/BkpSyn.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/backpack/BkpSyn.hs b/compiler/backpack/BkpSyn.hs
index ce14018..fcc0160 100644
--- a/compiler/backpack/BkpSyn.hs
+++ b/compiler/backpack/BkpSyn.hs
@@ -23,7 +23,7 @@ import GHC.Hs
import SrcLoc
import Outputable
import Module
-import PackageConfig
+import UnitInfo
{-
************************************************************************