bad interface file - how to track error down?

Marc Weber marco-oweber at
Sat Feb 17 13:24:01 EST 2007

How to track this error down?
When not using cabal adding OldNew.hs to the include path everything is

--- command run ------
$ rm -fr dist; cWC; cat MW/OldNew.hs; ghc --show-iface dist/build/MW/OldNew.hi;
	cd testapp/; cat test.hs; ghc -package mwutil --make test.hs' &> /tmp/f

cWC does ./setup configure, build, install
notice the cd testapp to ensure OldNew.hs is not in include path.
-- output annotated in haskell style --------------

{- configuring and instaling succesfully: -}
setup: No command given (try --help)
setup: Warning: No license-file field.
Configuring mwutil-0.1...
configure: Dependency base-any: using base-2.0
configure: Dependency haskell98-any: using haskell98-1.0
configure: Using install prefix: /usr/local
configure: Binaries installed in: /usr/local/bin
configure: Libraries installed in: /usr/local/lib/mwutil-0.1/ghc-6.6
configure: Private binaries installed in: /usr/local/libexec
configure: Data files installed in: /usr/local/share/mwutil-0.1
configure: Using compiler: /usr/bin/ghc
configure: Compiler flavor: GHC
configure: Compiler version: 6.6
configure: Using package tool: /usr/bin/ghc-pkg
configure: Using ar found on system at: /usr/bin/ar
configure: Using haddock found on system at: /usr/local/bin/haddock
configure: No pfesetup found
configure: Using ranlib found on system at: /usr/bin/ranlib
configure: Using runghc found on system at: /usr/bin/runghc
configure: Using runhugs found on system at: /usr/bin/runhugs
configure: Using happy: /usr/bin/happy
configure: Using alex: /usr/bin/alex
configure: Using hsc2hs: /usr/bin/hsc2hs
configure: Using c2hs: /usr/bin/c2hs
configure: No cpphs found
configure: Using greencard: /usr/local/bin/greencard
Preprocessing library mwutil-0.1...
Building mwutil-0.1...
[1 of 1] Compiling MW.OldNew        ( MW/OldNew.hs, dist/build/MW/OldNew.o )
/usr/bin/ar: creating dist/build/libHSmwutil-0.1.a
Installing: /usr/local/lib/mwutil-0.1/ghc-6.6 & /usr/local/bin mwutil-0.1...
Registering mwutil-0.1...
Reading package info from ".installed-pkg-config" ... done.
Saving old package config file... done.
Writing new package config file... done.

{- the file causing the error -}
module MW.OldNew where

data Old a = Old a
data New a = New a
data OldNew a = OldNew a a;

unOld :: Old a -> a
unOld (Old o) = o
unNew :: New n -> n
unNew (New n) = n


{- output of --show-iface -}
interface mwutil:MW.OldNew 1 6060 where
export mwutil:MW.OldNew OldNew|{OldNew OldNew} a Old|{Old Old} New|{New New} unOld unNew
module dependencies:
package dependencies: base
orphans: base:GHC.Base base:GHC.ForeignPtr
data OldNew a
    Variances [(True, False)]
    RecFlag NonRecursive
    Generics: no
    = OldNew a a Stricts: _ _
data New a
    Variances [(True, False)]
    RecFlag NonRecursive
    Generics: no
    = New a Stricts: _
data Old a
    Variances [(True, False)]
    RecFlag NonRecursive
    Generics: no
    = Old a Stricts: _
unOld :: Old a -> a
unNew :: New n -> n
a :: base:GHC.Num.Integer

{- the test app -}
module Main where
import MW.OldNew

main = do
  print "test"

{- compiling test app with -package mwutil -}
[1 of 1] Compiling Main             ( test.hs, test.o )

    Bad interface file: /usr/local/lib/mwutil-0.1/ghc-6.6/MW/OldNew.hi
	Something is amiss; requested module  mwutil-0.1:MW.OldNew differs from
	name found in the interface file mwutil:MW.OldNew


More information about the Glasgow-haskell-users mailing list