[commit: ghc] wip/remove-cabal-dep: Introduce new file format for the package database binary cache (d1e7a79)
git at git.haskell.org
git at git.haskell.org
Fri Aug 22 15:38:33 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/remove-cabal-dep
Link : http://ghc.haskell.org/trac/ghc/changeset/d1e7a792ee4f4e7b07147f33c20b5d9a332cfa45/ghc
>---------------------------------------------------------------
commit d1e7a792ee4f4e7b07147f33c20b5d9a332cfa45
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.)
>---------------------------------------------------------------
d1e7a792ee4f4e7b07147f33c20b5d9a332cfa45
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 d1e7a792ee4f4e7b07147f33c20b5d9a332cfa45
More information about the ghc-commits
mailing list