[Haskell-cafe] GHC API + Cabal API + Cabal version checks: is there a way out?

JP Moresmau jpmoresmau at gmail.com
Fri Sep 6 13:51:31 CEST 2013


Hello all,

I have an issue that has been nagging me for a while, and I'd like to make
sure I haven't missed a solution to it.
I'm the maintainer for the buildwrapper package. This package has
dependencies on the Cabal and GHC libraries, and also uses the
cabal-install executable. For example it will run cabal configure by
invoking the executable, then it will load the LocalBuildInfo via the Cabal
API, and extract the relevant information to start a GHC session with the
proper flags, etc.
Now yesterday some great news were announced, a new version of Cabal!
However, I can't use it. I can of course install the Cabal library and
rebuild the cabal executable but
- buildwrapper will only use the version of the Cabal library that was
bundled with GHC, since the GHC library has a dependency on that version of
Cabal
- so the library access will be using Cabal 1.16, but the executable will
be 1.18
- and the library checks when reading the setup-config file that the Cabal
versions match. Hence, running configure with 1.18 create build information
I can't read back in 1.16.

So I'm stuck. People can easily install cabal 1.18 and build their projects
with it, but I can't use it in conjunction with buildwrapper.
Some solutions I've considered
- do not use the Cabal API and write my own code to read the local build
info, and to replace all the Cabal library code I use
- do not use the cabal-install executable but do everything by the API

Both solutions reek of madness, and involve rewriting code that others have
already written, and a maintenance nightmare with each Cabal release.

So, do I have to wait a new release of GHC/Haskell Platform or is there a
better solution? I suspect ghc-mod and other similar packages have the same
issues.

Thanks for any help!

-- 
JP Moresmau
http://jpmoresmau.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130906/535ecc8b/attachment.htm>


More information about the Haskell-Cafe mailing list