diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-12-14 01:28:43 -0800 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-12-21 08:49:06 -0800 |
commit | ee4e1654c31b9c6f6ad9b19ece25f040bbbcbd72 (patch) | |
tree | 8f58c21ea66a817e384fceb01e930df00cb7e7a9 /libraries | |
parent | 2189239872322dc363cc5f82e14ab5fb1a6d5b8c (diff) | |
download | haskell-ee4e1654c31b9c6f6ad9b19ece25f040bbbcbd72.tar.gz |
Support for abi-depends for computing shadowing.
Summary:
This is a complete fix based off of
ed7af26606b3a605a4511065ca1a43b1c0f3b51d for handling
shadowing and out-of-order -package-db flags simultaneously.
The general strategy is we first put all databases together,
overriding packages as necessary. Once this is done, we successfully
prune out broken packages, including packages which depend on a package
whose ABI differs from the ABI we need.
Our check gracefully degrades in the absence of abi-depends, as
we only check deps which are recorded in abi-depends.
Contains time and Cabal submodule update.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: niteria, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2846
GHC Trac Issues: #12485
Diffstat (limited to 'libraries')
m--------- | libraries/Cabal | 0 | ||||
-rw-r--r-- | libraries/ghc-boot/GHC/PackageDb.hs | 12 | ||||
m--------- | libraries/hpc | 0 | ||||
m--------- | libraries/time | 0 |
4 files changed, 10 insertions, 2 deletions
diff --git a/libraries/Cabal b/libraries/Cabal -Subproject 034b44191740214c9e691439b604a8ac95ee994 +Subproject 09865f60caa55a7b02880f2a779c9dd8e1be5ac diff --git a/libraries/ghc-boot/GHC/PackageDb.hs b/libraries/ghc-boot/GHC/PackageDb.hs index 09991092ee..9b2889f4cf 100644 --- a/libraries/ghc-boot/GHC/PackageDb.hs +++ b/libraries/ghc-boot/GHC/PackageDb.hs @@ -66,7 +66,8 @@ import System.Directory -- | This is a subset of Cabal's 'InstalledPackageInfo', with just the bits --- that GHC is interested in. +-- that GHC is interested in. See Cabal's documentation for a more detailed +-- description of all of the fields. -- data InstalledPackageInfo compid srcpkgid srcpkgname instunitid unitid modulename mod = InstalledPackageInfo { @@ -78,6 +79,9 @@ data InstalledPackageInfo compid srcpkgid srcpkgname instunitid unitid modulenam packageVersion :: Version, abiHash :: String, depends :: [instunitid], + -- | Like 'depends', but each dependency is annotated with the + -- ABI hash we expect the dependency to respect. + abiDepends :: [(instunitid, String)], importDirs :: [FilePath], hsLibraries :: [String], extraLibraries :: [String], @@ -159,6 +163,7 @@ emptyInstalledPackageInfo = packageVersion = Version [] [], abiHash = "", depends = [], + abiDepends = [], importDirs = [], hsLibraries = [], extraLibraries = [], @@ -307,7 +312,7 @@ instance (RepInstalledPackageInfo a b c d e f g) => put (InstalledPackageInfo unitId componentId instantiatedWith sourcePackageId packageName packageVersion - abiHash depends importDirs + abiHash depends abiDepends importDirs hsLibraries extraLibraries extraGHCiLibraries libraryDirs libraryDynDirs frameworks frameworkDirs @@ -325,6 +330,7 @@ instance (RepInstalledPackageInfo a b c d e f g) => instantiatedWith) put abiHash put (map toStringRep depends) + put (map (\(k,v) -> (toStringRep k, v)) abiDepends) put importDirs put hsLibraries put extraLibraries @@ -355,6 +361,7 @@ instance (RepInstalledPackageInfo a b c d e f g) => instantiatedWith <- get abiHash <- get depends <- get + abiDepends <- get importDirs <- get hsLibraries <- get extraLibraries <- get @@ -383,6 +390,7 @@ instance (RepInstalledPackageInfo a b c d e f g) => (fromStringRep packageName) packageVersion abiHash (map fromStringRep depends) + (map (\(k,v) -> (fromStringRep k, v)) abiDepends) importDirs hsLibraries extraLibraries extraGHCiLibraries libraryDirs libraryDynDirs diff --git a/libraries/hpc b/libraries/hpc -Subproject 8625c1c0550719437acad89d49401cf04899008 +Subproject 92673292ab7ce7878e982d0a02df3e548ef15b5 diff --git a/libraries/time b/libraries/time -Subproject 52e0f5e85ffbaab77b155d48720fb216021c8a7 +Subproject b6098be8a4facfa854c633f2a3a82ab8e72962e |