ghc 6.2 gets confused about Main.hi reuse
claus.reinke at talk21.com
Wed Feb 4 07:46:19 EST 2004
>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.
We use -hidir/-odir to build for different platforms, so the only
problem comes from ghc using hidir/<platform>/Main.hi for
both pfe.hs and pfe_client.hs. Executables and sources have
different names, why not the interface files? Will try -ohi and
see if that helps.
>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" :-)
Don't do what?-) Compile more than one executable in the same
directory? That'd be a rather harsh limitation, wouldn't it?
The real question is why a build that goes through without a
hitch in ghc-6.0.1 suddenly fails in ghc-6.2.
As it happens, this aspect of our build also worked in ghc-5.04.2,
but of course that build broke in ghc-6.0.1 because of the Template
Haskell syntax intrusion bug.. So, every time a new ghc comes out,
we have to modify our build, and not because of deprecated
feature warnings, either!-(
>GHC can't tell that the Main.hi was from a different build -
>presumably the source file was Main.hs in both cases?.
No, different sources, different executables, just some
shared imports. It's the current HaRe snapshot (works
with ghc-6.0.1, needs fix with ghc-6.2).
More information about the Glasgow-haskell-bugs