Skip to content

import leakage

When I compile with ghc --make, sometimes imports from
one module "leak" into the imports list (in the .hi
file) of another, unrelated module that was compiled later.

For example:
Point.lhs is the following file:
\begin{code}
module Point (
         module PointClass, module Point1, module Point2, 
         module Point3, module Point4, module PointN,
module Point
       ) where

import PointClass
import Point1
import Point2
import Point3
import Point4
import PointN
\end{code}

In one particular ghc run, files were compiled like this:
Skipping  PointClass       (
/sc/downloads/GeomAlgLib/haskell/PointClass.lhs,
/sc/downloads/GeomAlgLib/haskell/PointClass.o )
Skipping  Point1           (
/sc/downloads/GeomAlgLib/haskell/Point1.lhs,
/sc/downloads/GeomAlgLib/haskell/Point1.o )
Skipping  Point2           (
/sc/downloads/GeomAlgLib/haskell/Point2.lhs,
/sc/downloads/GeomAlgLib/haskell/Point2.o )
Skipping  Point3           (
/sc/downloads/GeomAlgLib/haskell/Point3.lhs,
/sc/downloads/GeomAlgLib/haskell/Point3.o )
Skipping  PointN           (
/sc/downloads/GeomAlgLib/haskell/PointN.lhs,
/sc/downloads/GeomAlgLib/haskell/PointN.o )
Skipping  Point4           (
/sc/downloads/GeomAlgLib/haskell/Point4.lhs,
/sc/downloads/GeomAlgLib/haskell/Point4.o )
Skipping  GLExtra          ( GLExtra.hs, GLExtra.o )
Skipping  GtkExtra         ( GtkExtra.hs, GtkExtra.o )
Compiling Point            (
/sc/downloads/GeomAlgLib/haskell/Point.lhs,
/sc/downloads/GeomAlgLib/haskell/Point.o )

None of the Point* modules depend on GdkPixmap (as
verified by looking in their .hi files), but GtkExtra
does.  After this run, Point.hi contains the line
import GdkPixmap !;
(This means that subsequent compiles of different
programs using Point will fail, since they don't have
the right compiler flags to find GdkPixmap.hi.)
System information:
Linux nebula 2.4.9-686 #1 Sun Aug 19 10:46:52 EST 2001
i686 unknown
gcc version 2.95.4 20011006 (Debian prerelease)

I am attaching a transcript of a compile run using -v.
Trac metadata
Trac field Value
Version 5.02
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution ResolvedInvalid
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information