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

Re: svn commit: r16449 - trunk/build/generator

From: David James <james82_at_gmail.com>
Date: 2005-10-05 19:33:31 CEST

On 10/5/05, Max Bowsher <maxb@ukf.net> wrote:
> David James wrote:
> > Max, are you using a static or a dynamic build of APR?
>
> Dynamic.
>
> > I'm using a static build of APR.
>
> Oh dear. There's the problem.
>
> > Does that mean that C/Python module
> > (libsvn._core, libsvn._wc, etc) has a separate copy of the internal
> > APR datastructures?
>
> Yes :-(
>
> > If so, then it might be a good idea for us to
> > separately initialize APR in each module.
>
> Issues with this:
> - atexit() slots may be a scarce finite resource - no more than 32 are
> guaranteed.
> - are there any issues with passing objects allocated by pools owned by one
> apr instance to another?
> - does libsvn_swig_py have an additional copy of apr, as well as all the
> modules?
> - it's worryingly inelegant
>
> I'm pretty surprised that the link succeeded at all, as I know that libtool
> is designed to outright refuse to link a shared library to a static library.
>
> Note also that we already require (though we do not enforce) that
> libsvn_swig_py be a shared library, with improper operation being the result
> if it is static (issue 2202). In view of this, I think we can reasonably
> require that apr also be a shared library.
>
> Perhaps we can create some configury to warn about this issue.
Yes, probably we should create a warning. I have reinstalled APR as a
shared library and everything works fine.

Still, I've found an easy way to get the bindings working with a
static APR. The following patch makes the Subversion bindings with a
static APR, on my system, because it initializes APR from inside the
libsvn_swig_py library as opposed to from within a Python library. (We
used to initialize APR from within libsvn_swig_py, until we changed
this behaviour in r16382. That's why static APR builds always used to
work for me.)

[[[

Create svn_swig_py_initialize API function for initializing the libsvn_swig_py
library. This function initializes APR, and sets up atexit(apr_terminate).
Followup to r16382.

* swig/core.i:
  Use svn_swig_py_initialize instead of apr_initialize and
  apr_terminate.

* swig/python/libsvn_swig_py/swigutil_py.h
  (svn_swig_py_initialize): New.

* swig/python/libsvn_swig_py/swigutil_py.c
  (svn_swig_py_initialize): New.

]]]

Cheers,

David

--
David James -- http://www.cs.toronto.edu/~james


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Wed Oct 5 20:50:37 2005

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