[Xapian-devel] C# bindings and string typed return values

Greg freediving at gmail.com
Tue Apr 5 16:16:13 BST 2011


On Tue, Apr 5, 2011 at 5:29 AM, Olly Betts <olly at survex.com> wrote:
> On Mon, Apr 04, 2011 at 08:55:36AM -0700, Dan Colish wrote:
>> On Apr 4, 2011 3:35 AM, "Greg" <freediving at gmail.com> wrote:
>> > Sorry I'm resurrecting this topic but I've been doing some debugging /
>> > research on the string topic and it seem the problem is caused by a
>> > change in .NET 4.0 CLR which apparently was fixed in SWIG 2.x see
>> >
>> http://sourceforge.net/tracker/?func=detail&aid=2957375&group_id=1645&atid=101645
>> > for more information.
>> >
>> > Are there any plans to migrate Xapian to use the latest version of SWIG?
>>
>> Moving to the latest SWIG bindings has been something we've discussed a few
>> times recently.
>
> We even have a ticket for it:
>
> http://trac.xapian.org/ticket/538
>
> I've added a note about this issue.
>
>> I.think its a worthy goal, but it will require a lot of
>> testing. Most of the bindings only have smoketests. I would not be confident
>> making a change like this without a good picture of our binding test
>> coverage.
>
> What we've done in the past is to compare the generated code for each
> language before and after.  Often that makes it pretty obvious that
> there's low risk of breakage, but sometimes it's not so clear.
>
> I tried a while back, and I believe we'll need to fix stuff for PHP at
> least.
>
> I've set the milestone for this to 1.2.6 - it won't get any easier with
> time, only harder as more things change.
>
> Cheers,
>    Olly
Just an update on the issue, I've been able to solve it by adding the
needed code from the SWIG generator (the new version) to the current
output (XapianPINVOKE.cs). Since Xapian uses own version of SWIG it
might be worth to just update that specific generating template in
this case (csharphead.swg); it's a standalone and localized change
that will only effect C# (around 3 rows of code) so might be a worthy
short term goal.



More information about the Xapian-devel mailing list