From ee4e1654c31b9c6f6ad9b19ece25f040bbbcbd72 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Wed, 14 Dec 2016 01:28:43 -0800 Subject: 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 Test Plan: validate Reviewers: niteria, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2846 GHC Trac Issues: #12485 --- utils/ghc-cabal/Main.hs | 2 +- utils/ghc-pkg/Main.hs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'utils') diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs index 3b55fe7b0a..12699a7f2d 100644 --- a/utils/ghc-cabal/Main.hs +++ b/utils/ghc-cabal/Main.hs @@ -316,7 +316,7 @@ generate directory distdir dll0Modules config_args do cwd <- getCurrentDirectory let ipid = mkUnitId (display (packageId pd)) let installedPkgInfo = inplaceInstalledPackageInfo cwd distdir - pd (mkAbiHash "") lib lbi clbi + pd (mkAbiHash "inplace") lib lbi clbi final_ipi = mangleIPI directory distdir lbi $ installedPkgInfo { Installed.installedUnitId = ipid, Installed.compatPackageKey = display (packageId pd), diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index 290993f4a5..53f5f9dce6 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -1107,6 +1107,7 @@ convertPackageInfoToCacheFormat pkg = GhcPkg.packageName = packageName pkg, GhcPkg.packageVersion = Version.Version (versionNumbers (packageVersion pkg)) [], GhcPkg.depends = depends pkg, + GhcPkg.abiDepends = map (\(AbiDependency k v) -> (k,unAbiHash v)) (abiDepends pkg), GhcPkg.abiHash = unAbiHash (abiHash pkg), GhcPkg.importDirs = importDirs pkg, GhcPkg.hsLibraries = hsLibraries pkg, -- cgit v1.2.1