Building error Gtk2Hs under GHC 6.6.1 on Solaris 10 x86

Hi, haskell-caffe! I'm trying to build Gtk2Hs 0.9.11 under GHC 6.6.1 on Solaris 10 x86: ./configure --with-hcflags=-O0 --disable-split-objs OK! gmake ........................ ........................ ........................ if test -f glib/libHSglib_a.deps; then touch glib/libHSglib_a.deps; else touch glib/libHSglib_a.deps; gmake glib/System/Glib/FFI.hs glib/System/Glib/UTFString.hs glib/System/Glib/Types.hs glib/System/Glib/GType.hs glib/System/Glib/GValue.hs glib/System/Glib/GValueTypes.hs glib/System/Glib/GObject.hs glib/System/Glib/Properties.hs glib/System/Glib/GError.hs glib/System/Glib/GList.hs glib/System/Glib/Signals.hs glib/System/Glib/MainLoop.hs glib/System/Glib/GTypeConstants.hs glib/System/Glib/GParameter.hs glib/System/Glib/StoreValue.hs glib/System/Glib.hs glib/System/Glib/Attributes.hs glib/System/Glib/Flags.hs; /usr/local/bin/ghc -M -optdep-f -optdepglib/libHSglib_a.deps -fglasgow-exts -O0 -fffi -iglib -package-conf package.conf.inplace -hide-all-packages -ignore-package glib -package base -package haskell98 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include glib/System/Glib/FFI.hs glib/System/Glib/UTFString.hs glib/System/Glib/Types.hs glib/System/Glib/GType.hs glib/System/Glib/GValue.hs glib/System/Glib/GValueTypes.hs glib/System/Glib/GObject.hs glib/System/Glib/Properties.hs glib/System/Glib/GError.hs glib/System/Glib/GList.hs glib/System/Glib/Signals.hs glib/System/Glib/MainLoop.hs glib/System/Glib/GTypeConstants.hs glib/System/Glib/GParameter.hs glib/System/Glib/StoreValue.hs glib/System/Glib.hs glib/System/Glib/Attributes.hs glib/System/Glib/Flags.hs; fi; gmake[1]: Entering directory `/usr/export/home/lebed/tmp/gtk2hs-0.9.11' ./mk/chsDepend -iglib:gtk:sourceview sourceview/Graphics/UI/Gtk/SourceView/Types.chs could not find {#import.chs on search path glib gtk sourceview gmake[1]: *** [sourceview/Graphics/UI/Gtk/SourceView/Types.dep] Error 1 gmake[1]: Leaving directory `/usr/export/home/lebed/tmp/gtk2hs-0.9.11' <no location info>: can't find file: glib/System/Glib/FFI.hs gmake: *** [glib/libHSglib_a.deps] Error 1 gmake: *** Deleting file `glib/libHSglib_a.deps' Where is my mistake? (I've got the same error under GHC 6.6 on Solaris 10 sparc.) -- View this message in context: http://www.nabble.com/Building-error-Gtk2Hs-under-GHC-6.6.1-on-Solaris-10-x8... Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

On Wed, 2007-05-23 at 21:42 -0700, lebed wrote:
Hi, haskell-caffe!
I'm trying to build Gtk2Hs 0.9.11 under GHC 6.6.1 on Solaris 10 x86:
./mk/chsDepend -iglib:gtk:sourceview sourceview/Graphics/UI/Gtk/SourceView/Types.chs could not find {#import.chs on search path glib gtk sourceview gmake[1]: *** [sourceview/Graphics/UI/Gtk/SourceView/Types.dep] Error 1 gmake[1]: Leaving directory `/usr/export/home/lebed/tmp/gtk2hs-0.9.11'
<no location info>: can't find file: glib/System/Glib/FFI.hs gmake: *** [glib/libHSglib_a.deps] Error 1 gmake: *** Deleting file `glib/libHSglib_a.deps'
Where is my mistake?
This is a bug in mk/chsDepend(.in) probably due to some difference in how sed works in Solaris compared to Linux. the mk/chsDepend shell script looks at a .chs file and tries to find all the lines that look like: {#import Some.Module.Name#} and then find the .chi files corresponding to those import lines. It looks from the error message that it's picking up "{#import" as if it were a module. The shell/sed code that is probably going wrong is: DEPS=`$GREP "{#import" $FULLNAME 2> /dev/null \ | $SED 'y/./\//;s/^{#import \(qualified \)*\([a-zA-Z1-9/]*\)#}.*/\2/'`; testing this with standard solaris sed (on Solaris 9) reveals the problem, standard Solaris sed is terrible! :-) The problem is that standard Solaris /usr/bin/sed does not allow * on sub-expressions, for example this sed regexp "\(bar\)*" does not match the string "bar bar". The other Solaris sed that is not on the path by default works fine (/usr/xpg4/bin/sed). Well actually it needs a minor patch too, it doesn't like the escape in "y/./\//", but if we change it to "y|.|/|" then it's happy. So the solution I think is for me to change the configure script to look for /usr/xpg4/bin/sed in preference to /usr/bin/sed on Solaris and also to make that other minor syntax fix. The workaround you can try is to edit mk/chsDepend and set SED to either gnu sed or to /usr/xpg4/bin/sed though in the latter case you'll also need to fix the "y|.|/|" bit. Then you'll need to make clean and make again. Duncan

How about switching from sed to perl, then? Cheers Christian Duncan Coutts schrieb:
This is a bug in mk/chsDepend(.in) probably due to some difference in how sed works in Solaris compared to Linux.
the mk/chsDepend shell script looks at a .chs file and tries to find all the lines that look like:
{#import Some.Module.Name#}
and then find the .chi files corresponding to those import lines. It looks from the error message that it's picking up "{#import" as if it were a module.
The shell/sed code that is probably going wrong is:
DEPS=`$GREP "{#import" $FULLNAME 2> /dev/null \ | $SED 'y/./\//;s/^{#import \(qualified \)*\([a-zA-Z1-9/]*\)#}.*/\2/'`;
testing this with standard solaris sed (on Solaris 9) reveals the problem, standard Solaris sed is terrible! :-)
The problem is that standard Solaris /usr/bin/sed does not allow * on sub-expressions, for example this sed regexp "\(bar\)*" does not match the string "bar bar". The other Solaris sed that is not on the path by default works fine (/usr/xpg4/bin/sed). Well actually it needs a minor patch too, it doesn't like the escape in "y/./\//", but if we change it to "y|.|/|" then it's happy.
So the solution I think is for me to change the configure script to look for /usr/xpg4/bin/sed in preference to /usr/bin/sed on Solaris and also to make that other minor syntax fix.
The workaround you can try is to edit mk/chsDepend and set SED to either gnu sed or to /usr/xpg4/bin/sed though in the latter case you'll also need to fix the "y|.|/|" bit. Then you'll need to make clean and make again.
Duncan

On Thu, 2007-05-31 at 13:48 +0200, Christian Maeder wrote:
How about switching from sed to perl, then?
/me runs away screaming Actually the easier fix was to not look for an optional "qualified" string (ie dropping the \(qualified \)* clause) as it turns out we didn't need it anyway. Duncan
participants (3)
-
Christian Maeder
-
Duncan Coutts
-
lebed