[commit: ghc] master: Library names, with Cabal submodule update (f9687ca)
git at git.haskell.org
git at git.haskell.org
Thu Jul 23 20:38:40 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/f9687caf337d409e4735d5bb4cf73a7dc629a58c/ghc
>---------------------------------------------------------------
commit f9687caf337d409e4735d5bb4cf73a7dc629a58c
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date: Tue Jun 23 13:15:17 2015 -0700
Library names, with Cabal submodule update
A library name is a package name, package version, and hash of the
version names of all textual dependencies (i.e. packages which were included.) A library
name is a coarse approximation of installed package IDs, which are suitable for
inclusion in package keys (you don't want to put an IPID in a package key, since
it means the key will change any time the source changes.)
- We define ShPackageKey, which is the semantic object which
is hashed into a PackageKey. You can use 'newPackageKey'
to hash a ShPackageKey to a PackageKey
- Given a PackageKey, we can lookup its ShPackageKey with
'lookupPackageKey'. The way we can do this is by consulting
the 'pkgKeyCache', which records a reverse mapping from
every hash to the ShPackageKey. This means that if you
load in PackageKeys from external sources (e.g. interface
files), you also need to load in a mapping of PackageKeys
to their ShPackageKeys so we can populate the cache.
- We define a 'LibraryName' which encapsulates the full
depenency resolution that Cabal may have selected; this
is opaque to GHC but can be used to distinguish different
versions of a package.
- Definite packages don't have an interesting PackageKey,
so we rely on Cabal to pass them to us.
- We can pretty-print package keys while displaying the
instantiation, but it's not wired up to anything (e.g.
the Outputable instance of PackageKey).
Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>
Test Plan: validate
Reviewers: austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1056
GHC Trac Issues: #10566
>---------------------------------------------------------------
f9687caf337d409e4735d5bb4cf73a7dc629a58c
compiler/backpack/ShPackageKey.hs | 280 +++++++++++++++++++++
compiler/ghc.cabal.in | 2 +
compiler/main/DynFlags.hs | 43 +++-
compiler/main/PackageConfig.hs | 20 ++
compiler/main/Packages.hs | 8 +-
docs/users_guide/packages.xml | 24 +-
libraries/Cabal | 2 +-
testsuite/tests/cabal/sigcabal01/Makefile | 2 +-
testsuite/tests/cabal/sigcabal01/all.T | 2 +-
testsuite/tests/cabal/sigcabal02/Makefile | 4 +-
.../tests/safeHaskell/check/pkg01/safePkg01.stdout | 6 +-
testsuite/tests/th/TH_Roles2.stderr | 6 +-
utils/ghc-cabal/Main.hs | 43 ++--
13 files changed, 400 insertions(+), 42 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc f9687caf337d409e4735d5bb4cf73a7dc629a58c
More information about the ghc-commits
mailing list