[commit: ghc] master: Introduce new file format for the package database binary cache (8d7a1dc)

git at git.haskell.org git at git.haskell.org
Fri Aug 29 14:03:56 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/8d7a1dcdbee47a980d0ecc8fa8e9336866a75d1b/ghc

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

commit 8d7a1dcdbee47a980d0ecc8fa8e9336866a75d1b
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.)


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

8d7a1dcdbee47a980d0ecc8fa8e9336866a75d1b
 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 8d7a1dcdbee47a980d0ecc8fa8e9336866a75d1b


More information about the ghc-commits mailing list