This is a cosmetic bug related to path errors. I have a module that
imports a non-existing module, and run ghc on it providing a
non-existing path. I am using ghc-5.00 checked out yesterday from
anoncvs and compiled without any special fine tuning. Compilation
works:
======================================================================
$ ghc -i/does_not_exist -c H.hs
WARNING: error while reading directory /does_not_exist
H.hs:2:
failed to load interface for `DoesNotExistEither':
Could not find interface file for `DoesNotExistEither'
======================================================================
Dependency generation crashes:
======================================================================
$ ghc -i/does_not_exist -M H.hs
ghc-5.00: panic! (the `impossible' happened, GHC version 5.00):
does not exist
Action: getDirectoryContents
Reason: No such file or directory
Please report it as a compiler bug to [EMAIL PROTECTED],
or http://sourceforge.net/projects/ghc/.
======================================================================
Fix: the existence check in compiler/main/DriverMkDepend.hs, lines
114ff should not be omitted. This patch should do the trick (borrowed
from Finder.lhs):
======================================================================
cvs server: Diffing .
Index: DriverMkDepend.hs
===================================================================
RCS file: /cvs/fptools/ghc/compiler/main/DriverMkDepend.hs,v
retrieving revision 1.9
diff -u -H -w -B -b -r1.9 DriverMkDepend.hs
--- DriverMkDepend.hs 2001/03/28 16:51:03 1.9
+++ DriverMkDepend.hs 2001/04/26 11:34:30
@@ -113,8 +113,8 @@
-- reference.
import_dirs <- readIORef v_Import_paths
pkg_import_dirs <- getPackageImportPath
- import_dir_contents <- mapM getDirectoryContents import_dirs
- pkg_import_dir_contents <- mapM getDirectoryContents pkg_import_dirs
+ import_dir_contents <- mapM getDirectoryContents' import_dirs
+ pkg_import_dir_contents <- mapM getDirectoryContents' pkg_import_dirs
writeIORef v_Dep_dir_contents
(zip import_dirs import_dir_contents ++
zip pkg_import_dirs pkg_import_dir_contents)
@@ -199,4 +199,11 @@
-- in
search dir_contents
+
+getDirectoryContents' d
+ = IO.catch (getDirectoryContents d)
+ (\_ -> do hPutStr stderr
+ ("WARNING: error while reading directory " ++ d)
+ return []
+ )
======================================================================
regards,
Matthias
--
Matthias Fischmann | Research Engineer | +358 (9) 8565 7474
[EMAIL PROTECTED] | SSH Communication Security Corp. | +358 (40) 752 5291
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs