Hi,

I have found a bug with mkdependHS. The bug which I am reporting is present
in ghc 2.07, but I believe that it has been around for sometime. It is by no
means a serious bug, but worth reporting. I have included below a makefile,
the two Haskell modules and the make error which demonstrate the bug.

Essentially, mkdependHS always picks-up an import statement even if the
import is commented as shown in My_Module.hs below. Commenting imports in
this manner will cause mkdependHS to crash with the error I have included.

_________________________________ Main.hs _________________________________

module Main where

import My_Module

main = done

______________________________ My_Module.hs _______________________________

module My_Module where

{-
import Another_Module
-}

foo :: Int
foo = 10

________________________________ makefile _________________________________

HC = ghc

SRCS = Main.hs My_Module.hs

OBJS = Main.o My_Module.o

all: buggy

buggy: $(OBJS)
        $(HC) -o buggy $(OBJS)

%.hi: %.o
        @:

%.hi: %.hs
        $(HC) -c $<

%.o: %.hs
        $(HC) -c $<

clean:
        rm -f *.o *.hi

depend :
        mkdependHS -- $(SRCS)
# DO NOT DELETE: Beginning of Haskell dependencies
Main.o : Main.hs
Main.o : ./My_Module.hi
My_Module.o : My_Module.hs
# DO NOT DELETE: End of Haskell dependencies

_______________________________ the error _________________________________

yeats.ucc.ie> make depend
mkdependHS -- Main.hs My_Module.hs
No file `Another_Module.hi', `Another_Module.lhs', `Another_Module.hs' (reqd from file 
`My_Module.hs')
among import directories:
        .
*** Error code 2
make: Fatal error: Command failed for target `depend'


Happy bug-fixing,
        Barry.
______________________________________________________________________________
 Barry O'Sullivan, Department of Computer Science,   | Tel: +353-(0)21-903085
 National University of Ireland, Cork (UCC), Ireland | Fax: +353-(0)21-903113

Reply via email to