[Xapian-devel] Ruby bindings now pass all smoketests

Olly Betts olly at survex.com
Sat Apr 22 21:10:17 BST 2006


On Sat, Apr 22, 2006 at 03:05:06PM -0300, Paul Legato wrote:
> I like the underscore idea, because it emphasizes to users that they 
> shouldn't try to require the .so file directly, but should rather use 
> xapian.rb. There is one problem -- Ruby tries to initialize shared 
> objects by calling an Init_<objectname> function. So when I require 
> _xapian, it tries to call Init__xapian, which doesn't exist.

Yeah, I found you can fix that by passing "-feature _xapian" when
running SWIG.  The documentation wasn't clear, so I compared the
generated file with and without, and this only affects the "Init_XXX"
symbol.

> I can't get the configure script to work here. It rejects my version of 
> SWIG (1.3.29 is not yet available in Debian Unstable). So, this issue 
> may well be fixed when building the correct way. :)

Yes - I don't think I said explicitly, but with the patch "make check"
passes for Ruby for me.

Incidentally, it might be worth the effort of installing 1.3.29 - SWIG
gained a "magic renaming" thing added for Ruby pretty recently which
might be useful to us.

> For now, I will change it to "require 'xapian.so'" 
> explicitly (since Ruby is not smart enough to not try to include 
> xapian.rb from within itself.)

So I noticed.  That's fine for now, but less good generally since
dynamically loadable modules don't have a ".so" extension on every
platform (it can be ".dll" or ".sl" or probably other things).

Cheers,
    Olly



More information about the Xapian-devel mailing list