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

Yuri de Wit ydewit at gmail.com
Fri Sep 6 15:13:58 CEST 2013


I spent some time looking into the touch points between ghc and cabal in
the past, and the first oddity i saw was a direct dependency from ghc to
the cabal sources. After taking a closer look it seems that ghc shares some
common, low level modules with cabal that didnt seem to justify the whole
dependency.

The right solution, imho, is to review these dependencies and move the low
level ones out into a separate package that is shared by both ghc and cabal
and that will rarely change. The direct side effect of this is that ghc
would not be tied directly to a specific cabal version and you would
not have to deal with this issue.

Re: specific workaround i am not sure.

On Friday, September 6, 2013, JP Moresmau wrote:

> 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/8bb22d80/attachment.htm>


More information about the Haskell-Cafe mailing list