[Haskell-cafe] Bad interface problem.

Claude Heiland-Allen claude at mathr.co.uk
Wed Jul 11 07:34:22 CEST 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

On 11/07/12 05:51, Magicloud Magiclouds wrote:
> I cleaned out everything, no luck....
> 
> On Fri, Jul 6, 2012 at 2:14 AM, Albert Y. C. Lai <trebla at vex.net>
> wrote:
>> On 12-07-03 04:19 AM, Magicloud Magiclouds wrote:
>>> template-haskell-2.6.0.0:Language.Haskell.TH differs from name
>>> found in the interface file
>>> template-haskell:Language.Haskell.TH

You installed a bad template-haskell version.  You can only use a
version corresponding to your ghc version.

I had a similar problem recently.  My solution process was as follows:

1. check which template-haskell version came with my ghc:

$ ghc -V
The Glorious Glasgow Haskell Compilation System, version 7.4.2
$ ghc-pkg list template-haskell
/home/claude/opt/lib/ghc-7.4.2/package.conf.d
   template-haskell-2.7.0.0
/home/claude/.ghc/x86_64-linux-7.4.2/package.conf.d
$

2. make sure to forbid every other version of template-haskell
(because it will break horribly, as you found):

$ cabal install --constraint='template-haskell==2.7.0.0' foo

3. if foo fails to install because it thinks it needs a different
version of template-haskell, try adjusting dependencies in foo.cabal

4. if foo installs and works with the adjusted dependencies, let the
maintainer know

>> I think things are so messed up that it is time to clean out
>> everything. See my 
>> http://www.vex.net/~trebla/haskell/sicp.xhtml#remove
>> 
>> In fact, time to read the whole article and avoid unsafe
>> re-installs and "upgrades".

It's a good read for sure!  Perhaps it could be updated to add a
problem I ran into recently:

"cabal install --solver=modular --avoid-reinstalls" sounds perfect, if
sicp.xhtml scared you properly.   But excessively avoiding reinstalls
is bad, as cabal-install seems to install a different allowable
version instead.  The result for me was horrible diamond dependency
problems - half my packages were built with one version of
mtl/transformers, and the other half with a different version of
mtl/transformers.

When I then tried to ghci using some modules from both halves of my
installed packages, I got very very confusing type errors complaining
about almost-identical-looking types not being identical.


Claude
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQEcBAEBAgAGBQJP/RBbAAoJEHZDo4jueIiW164IALlHcaauJX2AjBZTDExU0mKC
wlH+dIbaKkl8H1IMIXQnWSX0GxFGMsbPTdBXf/BC2CMXTcSJr8YMiyKewMAs734g
DijNU/x/nQlcVruOk1c8EAijIKs938vT3dF0j863+afMAA+cRWlyLWfV50Y7AIG6
4hF0Fr5Q73GwonFzTXuX+iWLxBL1i2jXgPjKJvNTJZr+iGn5txCj+6ZpJyfIXaaw
PZtQrnX/37vQ/ctbKsnDqRQI27/ENJyW3zm76Gax47EIpMvL8fHzEg8IpyR9/eR8
8ZfGKYNA1EsARHT3KS6pBPsVQdhn/qYInVZ5NYQ1r/kd9D6nqoy5pETdz3z/23Y=
=Rzob
-----END PGP SIGNATURE-----



More information about the Haskell-Cafe mailing list