[commit: ghc] wip/remove-cabal-dep: Introduce new file format for the package database binary cache (a54d9a9)

git at git.haskell.org git at git.haskell.org
Sun Aug 24 22:47:22 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/remove-cabal-dep
Link       : http://ghc.haskell.org/trac/ghc/changeset/a54d9a90c57241067f7f8740efea7d25c75c6318/ghc

>---------------------------------------------------------------

commit a54d9a90c57241067f7f8740efea7d25c75c6318
Author: Duncan Coutts <duncan at well-typed.com>
Date:   Tue Aug 19 20:33:10 2014 +0100

    Introduce new file format for the package database binary cache
    
    The purpose of the new format is to make it possible for the compiler
    to not depend on the Cabal library. The new cache file format contains
    more or less the same information duplicated in two different sections
    using different representations.
    
    One section is basically the same as what the package db contains now,
    a list of packages using the types defined in the Cabal library. This
    section is read back by ghc-pkg, and used for things like ghc-pkg dump
    which have to produce output using the Cabal InstalledPackageInfo text
    representation.
    
    The other section is a ghc-local type which contains a subset of the
    information from the Cabal InstalledPackageInfo -- just the bits that
    the compiler cares about.
    
    The trick is that the compiler can read this second section without
    needing to know the representation (or types) of the first part. The
    ghc-pkg tool knows about both representations and writes both.
    
    This patch introduces the new cache file format but does not yet use it
    properly. More patches to follow. (As of this patch, the compiler reads
    the part intended for ghc-pkg so it still depends on Cabal and the
    ghc-local package type is not yet fully defined.)


>---------------------------------------------------------------

a54d9a90c57241067f7f8740efea7d25c75c6318
 compiler/main/Packages.lhs                         |   6 +-
 .../Distribution/InstalledPackageInfo/Binary.hs    |  19 +-
 libraries/bin-package-db/GHC/PackageDb.hs          | 206 +++++++++++++++++++++
 libraries/bin-package-db/bin-package-db.cabal      |  18 +-
 utils/ghc-pkg/Main.hs                              |  33 ++--
 5 files changed, 238 insertions(+), 44 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 a54d9a90c57241067f7f8740efea7d25c75c6318


More information about the ghc-commits mailing list