diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-08-25 11:24:28 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-10-14 21:39:47 -0700 |
commit | 5b0191f74ab05b187f81ea037623338a615b1619 (patch) | |
tree | 5f46c51ec53b5ecf16e4ca224aa13d19ebbe9df3 /libraries/ghc-boot | |
parent | 729bf08e8311736aec7dc894b640a3a8d7dd24ad (diff) | |
download | haskell-5b0191f74ab05b187f81ea037623338a615b1619.tar.gz |
Update Cabal to HEAD, IPID renamed to Component ID.
This commit contains a Cabal submodule update which unifies installed
package IDs and package keys under a single notion, a Component ID.
We update GHC to keep follow this unification. However, this commit
does NOT rename installed package ID to component ID and package key to
unit ID; the plan is to do that in a companion commit.
- Compiler info now has "Requires unified installed package IDs"
- 'exposed' is now expected to contain unit keys, not IPIDs.
- Shadowing is no more. We now just have a very simple strategy
to deal with duplicate unit keys in combined package databases:
if their ABIs are the same, use the latest one; otherwise error.
Package databases maintain the invariant that there can only
be one entry of a unit ID.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin, bgamari, hvr, goldfire
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1184
GHC Trac Issues: #10714
Diffstat (limited to 'libraries/ghc-boot')
-rw-r--r-- | libraries/ghc-boot/GHC/PackageDb.hs | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/libraries/ghc-boot/GHC/PackageDb.hs b/libraries/ghc-boot/GHC/PackageDb.hs index 672b7ebbe3..1f6b54f151 100644 --- a/libraries/ghc-boot/GHC/PackageDb.hs +++ b/libraries/ghc-boot/GHC/PackageDb.hs @@ -73,7 +73,8 @@ data InstalledPackageInfo instpkgid srcpkgid srcpkgname pkgkey modulename packageName :: srcpkgname, packageVersion :: Version, packageKey :: pkgkey, - depends :: [instpkgid], + abiHash :: String, + depends :: [pkgkey], importDirs :: [FilePath], hsLibraries :: [String], extraLibraries :: [String], @@ -87,9 +88,9 @@ data InstalledPackageInfo instpkgid srcpkgid srcpkgname pkgkey modulename includeDirs :: [FilePath], haddockInterfaces :: [FilePath], haddockHTMLs :: [FilePath], - exposedModules :: [ExposedModule instpkgid modulename], + exposedModules :: [ExposedModule pkgkey modulename], hiddenModules :: [modulename], - instantiatedWith :: [(modulename,OriginalModule instpkgid modulename)], + instantiatedWith :: [(modulename,OriginalModule pkgkey modulename)], exposed :: Bool, trusted :: Bool } @@ -99,9 +100,9 @@ data InstalledPackageInfo instpkgid srcpkgid srcpkgname pkgkey modulename -- plus module name) representing where a module was *originally* defined -- (i.e., the 'exposedReexport' field of the original ExposedModule entry should -- be 'Nothing'). Invariant: an OriginalModule never points to a reexport. -data OriginalModule instpkgid modulename +data OriginalModule pkgkey modulename = OriginalModule { - originalPackageId :: instpkgid, + originalPackageId :: pkgkey, originalModuleName :: modulename } deriving (Eq, Show) @@ -128,11 +129,11 @@ data OriginalModule instpkgid modulename -- We use two 'Maybe' data types instead of an ADT with four branches or -- four fields because this representation allows us to treat -- reexports/signatures uniformly. -data ExposedModule instpkgid modulename +data ExposedModule pkgkey modulename = ExposedModule { exposedName :: modulename, - exposedReexport :: Maybe (OriginalModule instpkgid modulename), - exposedSignature :: Maybe (OriginalModule instpkgid modulename) + exposedReexport :: Maybe (OriginalModule pkgkey modulename), + exposedSignature :: Maybe (OriginalModule pkgkey modulename) } deriving (Eq, Show) @@ -150,6 +151,7 @@ emptyInstalledPackageInfo = packageName = fromStringRep BS.empty, packageVersion = Version [] [], packageKey = fromStringRep BS.empty, + abiHash = "", depends = [], importDirs = [], hsLibraries = [], @@ -301,7 +303,7 @@ instance (BinaryStringRep a, BinaryStringRep b, BinaryStringRep c, put (InstalledPackageInfo installedPackageId sourcePackageId packageName packageVersion packageKey - depends importDirs + abiHash depends importDirs hsLibraries extraLibraries extraGHCiLibraries libraryDirs frameworks frameworkDirs ldOptions ccOptions @@ -314,6 +316,7 @@ instance (BinaryStringRep a, BinaryStringRep b, BinaryStringRep c, put (toStringRep packageName) put packageVersion put (toStringRep packageKey) + put abiHash put (map toStringRep depends) put importDirs put hsLibraries @@ -340,6 +343,7 @@ instance (BinaryStringRep a, BinaryStringRep b, BinaryStringRep c, packageName <- get packageVersion <- get packageKey <- get + abiHash <- get depends <- get importDirs <- get hsLibraries <- get @@ -364,6 +368,7 @@ instance (BinaryStringRep a, BinaryStringRep b, BinaryStringRep c, (fromStringRep sourcePackageId) (fromStringRep packageName) packageVersion (fromStringRep packageKey) + abiHash (map fromStringRep depends) importDirs hsLibraries extraLibraries extraGHCiLibraries libraryDirs |