05 April 2010

The bugfix for the bugfix

Ever since I have started participating in LilyPond development, I've known that Guile plays an integral role in LilyPond's overall "functioning".  The Guile library, libguile, allows access to Scheme code from C (or C++) code (and vice versa).  Guile lies at the heart of LilyPond's infrastructure, so it's critical that LilyPond integrates well with Guile.

Recently, there have some dramatic changes to the Guile code base; basically, Guile has been modernized and now rightfully belongs in the 21st century.

Since Guile has seen such sweeping changes, it's not surprising that there might be some compatibility problems between Guile 1.9 (latest development series) and Lilypond.  And... there are many problems.  :-)

Some have been fixed.  Some might (and hopefully will) be fixed before Guile 2.0 is released.  One of the most annoying ones that the Guile devs are aware of is the removal of "currying" define forms.  My commit here shows how I'm temporary working around this problem.

So, on to the "bugfix for the bugfix".  One of the Guile-compatibility issues is an improvement that LilyPond needs to adapt to.  I'm currently have a patch (posted here), but I apparently didn't test it well enough.

For those interested, the "#if !HAVE_GUILE_HASH_FUNC ..." part of the patch is not working because I forgot to include the header "config.hh".  Funny thing is, after trying to include config.hh, some previously non-functioning #ifdefs started working, and some of the conditionally compiled code does not compile!  :-)  Oh, the joys of conditional compilation.  I haven't checked yet, but that code has probably been untouched for five years.  Compilers have improved tremendously over the past five years, so it doesn't surprise me that previously (supposedly) working code no longer compiles.

In other words, I have to amend my patch by including "config.hh" in the appropriate place, AND by fixing non-compiling code that, before including "config.hh", never compiled and was therefore unnoticed.

Happy Monday night!