packages and profiling

Bernard James POPE
Fri, 18 Oct 2002 15:33:44 +1000 (EST)

Hi all,
I've been playing around with the package mechanism in ghc which
is great.

However it took me quite a while to realise that when I compile
a module (say Foo.hs, for a package) with profiling, the .hi file
must be named Foo.p_hi, and not Foo.hi, when it appears in the
"import_dirs" directory.    

When the interface was called Foo.hi and I tried to use the package
the compiler complained:

   ghc-5.04: can't find module `Foo' (while processing "Main.hs")

this is with ghc --make

I might have realised the problem earlier if the error message had
said something about what file it was looking for, something like:

    "couldn't find Foo.p_hi in [wherever it was looking]"

Although the documentation for packages mentions the "_p" suffix
behaviour for library archives I don't think it mentions the
suffix for interface files.

Perhaps creating packages with profiling should have its own section
in the documentation?