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. <div>
<br></div><div>The right solution, imho, is to review these dependencies and move the low level ones<span></span> 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.<br>
<br>Re: specific workaround i am not sure.</div><div><br></div><div>On Friday, September 6, 2013, JP Moresmau  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hello all,<div><br></div><div>I have an issue that has been nagging me for a while, and I&#39;d like to make sure I haven&#39;t missed a solution to it.</div><div>I&#39;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.</div>

<div>Now yesterday some great news were announced, a new version of Cabal!</div><div>However, I can&#39;t use it. I can of course install the Cabal library and rebuild the cabal executable but</div><div>- 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</div>

<div>- so the library access will be using Cabal 1.16, but the executable will be 1.18</div><div>- 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&#39;t read back in 1.16.</div>

<div><br></div><div>So I&#39;m stuck. People can easily install cabal 1.18 and build their projects with it, but I can&#39;t use it in conjunction with buildwrapper.</div><div>Some solutions I&#39;ve considered</div><div>

- 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</div><div>- do not use the cabal-install executable but do everything by the API</div><div><br>

</div><div>Both solutions reek of madness, and involve rewriting code that others have already written, and a maintenance nightmare with each Cabal release.<br clear="all"><div><br></div><div>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.</div>

<div><br></div><div>Thanks for any help!</div><div><br></div>-- <br>JP Moresmau<br><a href="http://jpmoresmau.blogspot.com/" target="_blank">http://jpmoresmau.blogspot.com/</a>
</div></div>
</blockquote></div>