[Haskell-cafe] Building error Gtk2Hs under GHC 6.6.1 on Solaris 10 x86

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Wed May 30 16:43:22 EDT 2007


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



More information about the Haskell-Cafe mailing list