Removing GHC's dependency on Cabal

Edward Z. Yang ezyang at mit.edu
Thu Jul 24 13:56:22 UTC 2014


Hello all,

I know Duncan and SPJ have been keen on removing GHC's dependency on
Cabal for some time now.  Simon and I were chatting about the subject
today, and we wanted to propose an alternative way of doing the
remodularization.

Here are diagrams of the proposals:
http://web.mit.edu/~ezyang/Public/ghc-cabal-refactor.pdf

As I understand it, Duncan's proposal is to take the current
constellation of libraries, and just remove the dependency to Cabal from
GHC and bin-package-db, duplicating data structures as necessary.
ghc-pkg is now responsible for converting between Cabal's format and
GHC's format.

Simon suggested that this 'ghc-pkg' functionality (which specifies
the database format and how to handle it) should be placed in a library
of its own.  So in the third graph, we have a new package ghc-db which
everyone depends on.  Cabal no longers shells out to ghc-pkg to modify
database, instead it directly converts to ghc-db's format and then
invokes library functions in the library.

We were wondering if there was any reason to prefer the former
situation over the latter. One answer might be that Cabal is less keen
to have a dependency on a very GHC specific library (although the
ghc-pkg dependency is quite a fairly tightly coupled one.)

Cheers,
Edward


More information about the ghc-devs mailing list