[nhc-bugs] 1.10 build fails with ghc-5.02.1

Malcolm Wallace Malcolm.Wallace@cs.york.ac.uk
Wed, 23 Jan 2002 11:27:21 +0000


> It solves this problem. Thanks, but now the build fails later:
> 
> [..]
> /var/tmp/src/nhc98-1.10/script/nhc98 -cpp -c +CTS -part -redefine -CTS -P../LowB/ -P../ix86-FreeBSD -prelude -o /var/tmp/src/nhc98-1.10/targets/ix86-FreeBSD/obj/prelude/PreludeIO/Show_IOError.o Show_IOError.hs
> 
> ====================================
>         Error when renaming::
> Identifier hGetFileName used at 30:23,18:39 is not defined.
> gmake[2]: *** [/var/tmp/src/nhc98-1.10/targets/ix86-FreeBSD/obj/prelude/PreludeIO/Show_IOError.o] Error 1

I guess you have already applied 'patch-1.10-IO'.  It turns out that
there is a bug in this patch.  I will replace the patch with a correct
one on the FTP site, but for you, the easiest fix is to apply the
following secondary patch.

Regards,
    Malcolm

===================================================================
diff -u -r1.8 -r1.11 include/IO.hi
--- include/IO.hi       2001/12/17 11:37:29     1.8
+++ include/IO.hi       2001/12/18 18:49:34     1.11
@@ -253,6 +253,9 @@
 {-# NEED hGetLine #-}
 hGetLine{-# 1 #-}::(Handle -> (Prelude.IO Prelude.String));
 
+{-# NEED hGetFileName #-}
+hGetFileName{-# 1 #-}::(Handle -> (Prelude.Maybe Prelude.String));
+
 {-# NEED ioeGetFileName #-}
 ioeGetFileName{-# 1 #-}::(Prelude.IOError -> (Prelude.Maybe Prelude.FilePath));

@@ -300,5 +303,5 @@
 isEOF{-# 0 #-}::(Prelude.IO Prelude.Bool);
 interface ! Prelude
 {-# NEED IO #-}
-data IO a;
+newtype {-#  #-} IO a;
 }
===================================================================
diff -u -r1.5 -r1.7 include/IO.T.hi
--- include/IO.T.hi     2001/12/17 11:37:29     1.5
+++ include/IO.T.hi     2001/12/18 18:49:34     1.7
@@ -238,6 +238,9 @@
 {-# NEED hGetLine #-}
 hGetLine{-# 2 #-}::(Prelude.SR -> (Prelude.Trace -> (Prelude.R (Prelude.Trace -> ((Prelude.R Handle) -> (Prelude.R (Prelude.IO Prelude.String)))))));
 
+{-# NEED hGetFileName #-}
+hGetFileName{-# 2 #-}::(Prelude.SR -> (Prelude.Trace -> (Prelude.R (Prelude.Trace -> ((Prelude.R Handle) -> (Prelude.R (Prelude.Maybe Prelude.String)))))));
+
 {-# NEED ioeGetFileName #-}
 ioeGetFileName{-# 2 #-}::(Prelude.SR -> (Prelude.Trace -> (Prelude.R (Prelude.Trace -> ((Prelude.R Prelude.IOError) -> (Prelude.R (Prelude.Maybe Prelude.FilePath)))))));