ghc 6.2 gets confused about Main.hi reuse

Simon Marlow simonmar at microsoft.com
Wed Feb 4 04:57:20 EST 2004


 
> It turns out that ghc 6.2 seems to get confused about the reuse of
> Main.hi: we build two different executables (client/server) in the
> same directory, from the same set of modules, and ghc traditionally
> ignores the -o directive and names the interface file Main.hi.

The -ohi flag lets you rename the interface file, or -hisuf is useful
for renaming a whole bunch of interface files if you want to build
modules in two different ways in the same directory.

I can't say exactly what caused the error you're seeing, but the root
cause is clearly that the compiler is finding Main.hi from the previous
build and attempting to use it to determine whether Main needs to be
rebuilt.  The solution is "don't do that" :-)  GHC can't tell that the
Main.hi was from a different build - presumably the source file was
Main.hs in both cases?.

Cheers,
	Simon


More information about the Glasgow-haskell-bugs mailing list