[Haskell-cafe] Cabal version constraint seems to be ignored.

Carlo Hamalainen carlo at carlo-hamalainen.net
Fri Jan 31 09:26:05 UTC 2014


On 26/01/14 20:16, Albert Y. C. Lai wrote:
> It seems that you are using GHC API. Then your program starts a GHC
> session, which is not unlike an average ghci session, in particular:
>
> A. It will load and link libraries afresh during run time. This is
> independent of whatever your executable is linked with.
>
> B. And the default choice of libraries is, clearly: the newest
> unhidden version.
>
> Therefore, when your GHC session also has to work with compiled code
> built against older versions, there will be incompatibilities.

Ah, I see.

> What do you tell your users?

In my testing, using cabal sandboxes seems to work, but that's not
really a full solution.

> P.S. cabal-install goes out of its way to dictate library versions to
> ghc. It begins with -hide-all-packages, then it recites, one by one,
> -package base-4.1.0.0, -package Cabal-1.16.0, -package
> text-0.11.3.1,... Are you going to bother to do the same?

I did add some functionality like this recently:

https://github.com/carlohamalainen/ghc-imported-from/commit/e1a212000a73372f84aecd307d9d794c87768e93#diff-d2ce8e34838af0511940565d8c9d7addR108  
(around line 108)

which is just using ghc-mod's API to do so. But I still run into the
original problem that I had before, at least when not using a sandbox.
I'm not sure what to do from here.

-- 
Carlo Hamalainen
http://carlo-hamalainen.net



More information about the Haskell-Cafe mailing list