[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: SWIG problems

From: Michael Wood <mwood_at_its.uct.ac.za>
Date: 2002-08-20 09:03:30 CEST

On Mon, Aug 19, 2002 at 01:15:41PM -0500, Scott Lamb wrote:
> I'm having some trouble getting SWIG bindings to work:
>
> - a "python2 setup.py build" in subversion/bindings/swig/python fails.
> It seems that the __attribute__ stuff on printf-like functions is
> confusing swig's parser. I don't think these are ever needed in the
> python bindings (it has its own % thing), so I just surrounded them with
> a #ifndef SWIG block. I can send a patch later.

I noticed this too using swig 1.3.14. The swig interface file ignores
this function anyway.

> - with a somewhat-old version, cvs2svn.py segfaults, when committing the
> first revision I think. Backtrace is not too informative:
>
> #0 0x400e6476 in strlen () at strlen:-1
> #1 0x08092402 in PyString_FromString ()
> #2 0x401a835d in _wrap_svn_fs_commit_txn (self=0x0, args=0x8164ddc)
> at build/svn_fs.c:1047
> #3 0x080593ed in call_cfunction ()

I didn't get this far because I'm having other problems with the swig
stuff.

> Might have gone away in a newer version, but I'm having some trouble
> getting one of those to work:
>
> - I tried current SVN and newest available swig (1.3.14). I get errors
> like this:
>
> Traceback (most recent call last):
> File "./cvs2svn.py", line 17, in ?
> from svn import fs, util, _delta, _repos
> File "/usr/lib/python2.2/site-packages/svn/fs.py", line 19, in ?
> import _fs
> ImportError: dynamic module does not define init function (init_fs)
>
> It tries to dlsym() init_fs in /usr/lib/python2.2/site-packages/_fs.so,
> but init__fs (two underscores) exists.

Changing the "%module _fs" to "%module fs" and similar for the others
fixed that for me, but then I had trouble with the util module.

All modules compile fine. Some modules contain a function called
t_output_helper. The util module uses this function, but doesn't seem
to include it. (I get unknown symbol type errors, and nm tells me
"U t_output_helper".) Not being at all familiar with swig or writing
Python modules in C, I have not yet managed to get past this point.

-- 
Michael Wood <mwood@its.uct.ac.za>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Aug 20 09:04:12 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.