You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Philip Martin <ph...@codematters.co.uk> on 2011/06/21 14:03:40 UTC

Subversion's Berkeley DB detection with APR trunk

apr trunk combines apr and apr-util into a single library and there is
only a single apr-2-config script.  Subversion can be configured by
using this script for both apr and apr-util, but Subversion's Berkeley
DB detection doesn't work.  This is because the apr-2-config script
doesn't support the --db-version parameter that the old apu-config
script provided.

Should we rework Subversion's Berkeley DB detection or should we change
APR?

-- 
Philip

[PATCH] add --db-version/header/lib to apr-2-config for Subversion

Posted by Philip Martin <ph...@wandisco.com>.
"C. Michael Pilato" <cm...@collab.net> writes:

> I'd be interested in knowing why the --db-version parameter was
> dropped.  In the absence of a solid reason, I think APR should be
> changed to support as much.

The following patch adds --db-version, --db-header and --db-lib to
apr-2-config.  I haven't tried to adapt Subversion yet.

Index: apr-config.in
===================================================================
--- apr-config.in	(revision 1137909)
+++ apr-config.in	(working copy)
@@ -44,6 +44,9 @@
 APR_SO_EXT="@so_ext@"
 APR_LIB_TARGET="@export_lib_target@"
 APR_LIBNAME="@APR_LIBNAME@"
+APU_DB_VERSION="@apu_db_version@"
+APU_DB_HEADER="@apu_db_header@"
+APU_DB_LIB="@apu_db_lib@"
 
 # NOTE: the following line is modified during 'make install': alter with care!
 location=@APR_CONFIG_LOCATION@
@@ -230,6 +233,18 @@
     fi
     exit 0
     ;;
+    --db-version)
+    echo $APU_DB_VERSION
+    exit 0
+    ;;
+    --db-header)
+    echo $APU_DB_HEADER
+    exit 0
+    ;;
+    --db-lib)
+    echo $APU_DB_LIB
+    exit 0
+    ;;
     --help)
     show_usage
     exit 0
Index: build/dbm.m4
===================================================================
--- build/dbm.m4	(revision 1137909)
+++ build/dbm.m4	(working copy)
@@ -1004,6 +1004,7 @@
   AC_SUBST(apu_have_gdbm)
   AC_SUBST(apu_have_ndbm)
   AC_SUBST(apu_have_db)
+  AC_SUBST(apu_db_lib)
   AC_SUBST(apu_db_header)
   AC_SUBST(apu_db_version)
 

-- 
Philip

Re: Subversion's Berkeley DB detection with APR trunk

Posted by Philip Martin <ph...@wandisco.com>.
Stefan Sperling <st...@elego.de> writes:

> Does this mean it's no longer possible to compile static svn
> executables with BDB support if APR trunk is used?

The static libapr-2.a appears to contain the apr_dbm_db.o object so it
should be OK if we knew that BDB support was provided.

-- 
Philip

Re: Subversion's Berkeley DB detection with APR trunk

Posted by Stefan Sperling <st...@elego.de>.
On Tue, Jun 21, 2011 at 02:42:06PM +0100, Philip Martin wrote:
> "C. Michael Pilato" <cm...@collab.net> writes:
> 
> > I'd be interested in knowing why the --db-version parameter was
> > dropped.  In the absence of a solid reason, I think APR should be
> > changed to support as much.
> 
> Probably it's because apr is now modular and BDB support is one of the
> things that is loaded dynamically.  It's easy enough to reinstate
> --db-version, but that doesn't fix Subversion because apr no longer
> explicitly links against the BDB library.  Subversion's configure fails
> its link test with 'undefined reference to db_version'.

Does this mean it's no longer possible to compile static svn
executables with BDB support if APR trunk is used?

This would make it very hard to compile svn/svnadmin for some embedded
(or very rare) platforms with ra_local access for BDB repositories.

Re: Subversion's Berkeley DB detection with APR trunk

Posted by Philip Martin <ph...@wandisco.com>.
Philip Martin <ph...@wandisco.com> writes:

> "C. Michael Pilato" <cm...@collab.net> writes:
>
>> I seem to recall that it used to be extremely important for Subversion
>> to use the same BDB to which APR was linked.  mod_dav_svn used APR's
>> DB support for its activities database, and couldn't deal with having
>> APR's DB being one flavor of BDB while the Subversion repositories
>> which it also needed to read/write needed a different flavor of BDB.
>> Has any of this changed since our move (back in 1.5) away from
>> DB-based activities databases?  I mean, could we move BDB detection
>> into Subversion proper and that not be catastrophic?
>
> I suppose it depends on the details of the shared library loading and
> that varies from platform to platform.  I don't really know all the
> details or how portable it is.
>
> Apache won't be linked to libdb at all, both mod_dav_svn and apr_dbm_db
> will be loaded by apache at run time.  mod_dav_svn may not be linked to
> libdb either as it may also load libsvn_fs_base at run time.  So on my
> Linux machine when apache loads apr_dbm_db it gets an ELF NEEDED for
> libdb-X.Y.so and will load that version of the library, when it loads
> mod_dav_svn/libsvn_fs_base it gets NEEDED for libdb-P.Q.so and will load
> that version if not already loaded.
>
> Loading isn't the whole story, we also have to consider symbol
> resolution.  APR passes RTLD_GLOBAL to dlopen() so symbols from one load
> are available to later loads.  The default for Berkeley DB is that
> symbol names are unchanged from version to version, so symbols from the
> first load would satisfy the second load.  However on my Debian system
> the symbols are also ELF versioned (I don't know whether this a Debian
> enhancement) so even when the names are the same they won't match unless
> the version is new enough.

I'm assuming that we still need to coexist with the use of APR's BDB
interface.  Even if mod_dav_svn no longer uses it directly I expect
there are auth modules that do, as well as all sorts of unrelated
modules.

-- 
Philip

Re: Subversion's Berkeley DB detection with APR trunk

Posted by Philip Martin <ph...@wandisco.com>.
"C. Michael Pilato" <cm...@collab.net> writes:

> I seem to recall that it used to be extremely important for Subversion
> to use the same BDB to which APR was linked.  mod_dav_svn used APR's
> DB support for its activities database, and couldn't deal with having
> APR's DB being one flavor of BDB while the Subversion repositories
> which it also needed to read/write needed a different flavor of BDB.
> Has any of this changed since our move (back in 1.5) away from
> DB-based activities databases?  I mean, could we move BDB detection
> into Subversion proper and that not be catastrophic?

I suppose it depends on the details of the shared library loading and
that varies from platform to platform.  I don't really know all the
details or how portable it is.

Apache won't be linked to libdb at all, both mod_dav_svn and apr_dbm_db
will be loaded by apache at run time.  mod_dav_svn may not be linked to
libdb either as it may also load libsvn_fs_base at run time.  So on my
Linux machine when apache loads apr_dbm_db it gets an ELF NEEDED for
libdb-X.Y.so and will load that version of the library, when it loads
mod_dav_svn/libsvn_fs_base it gets NEEDED for libdb-P.Q.so and will load
that version if not already loaded.

Loading isn't the whole story, we also have to consider symbol
resolution.  APR passes RTLD_GLOBAL to dlopen() so symbols from one load
are available to later loads.  The default for Berkeley DB is that
symbol names are unchanged from version to version, so symbols from the
first load would satisfy the second load.  However on my Debian system
the symbols are also ELF versioned (I don't know whether this a Debian
enhancement) so even when the names are the same they won't match unless
the version is new enough.

-- 
Philip

Re: Subversion's Berkeley DB detection with APR trunk

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 06/21/2011 09:42 AM, Philip Martin wrote:
> "C. Michael Pilato" <cm...@collab.net> writes:
> 
>> I'd be interested in knowing why the --db-version parameter was
>> dropped.  In the absence of a solid reason, I think APR should be
>> changed to support as much.
> 
> Probably it's because apr is now modular and BDB support is one of the
> things that is loaded dynamically.  It's easy enough to reinstate
> --db-version, but that doesn't fix Subversion because apr no longer
> explicitly links against the BDB library.  Subversion's configure fails
> its link test with 'undefined reference to db_version'.

Hrm.

I seem to recall that it used to be extremely important for Subversion to
use the same BDB to which APR was linked.  mod_dav_svn used APR's DB support
for its activities database, and couldn't deal with having APR's DB being
one flavor of BDB while the Subversion repositories which it also needed to
read/write needed a different flavor of BDB.  Has any of this changed since
our move (back in 1.5) away from DB-based activities databases?  I mean,
could we move BDB detection into Subversion proper and that not be catastrophic?

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: Subversion's Berkeley DB detection with APR trunk

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 06/21/2011 09:42 AM, Philip Martin wrote:
> "C. Michael Pilato" <cm...@collab.net> writes:
> 
>> I'd be interested in knowing why the --db-version parameter was
>> dropped.  In the absence of a solid reason, I think APR should be
>> changed to support as much.
> 
> Probably it's because apr is now modular and BDB support is one of the
> things that is loaded dynamically.  It's easy enough to reinstate
> --db-version, but that doesn't fix Subversion because apr no longer
> explicitly links against the BDB library.  Subversion's configure fails
> its link test with 'undefined reference to db_version'.

Hrm.

I seem to recall that it used to be extremely important for Subversion to
use the same BDB to which APR was linked.  mod_dav_svn used APR's DB support
for its activities database, and couldn't deal with having APR's DB being
one flavor of BDB while the Subversion repositories which it also needed to
read/write needed a different flavor of BDB.  Has any of this changed since
our move (back in 1.5) away from DB-based activities databases?  I mean,
could we move BDB detection into Subversion proper and that not be catastrophic?

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: Subversion's Berkeley DB detection with APR trunk

Posted by Philip Martin <ph...@wandisco.com>.
"C. Michael Pilato" <cm...@collab.net> writes:

> I'd be interested in knowing why the --db-version parameter was
> dropped.  In the absence of a solid reason, I think APR should be
> changed to support as much.

Probably it's because apr is now modular and BDB support is one of the
things that is loaded dynamically.  It's easy enough to reinstate
--db-version, but that doesn't fix Subversion because apr no longer
explicitly links against the BDB library.  Subversion's configure fails
its link test with 'undefined reference to db_version'.

Index: apr-config.in
===================================================================
--- apr-config.in	(revision 1137909)
+++ apr-config.in	(working copy)
@@ -44,6 +44,7 @@
 APR_SO_EXT="@so_ext@"
 APR_LIB_TARGET="@export_lib_target@"
 APR_LIBNAME="@APR_LIBNAME@"
+APU_DB_VERSION="@apu_db_version@"
 
 # NOTE: the following line is modified during 'make install': alter with care!
 location=@APR_CONFIG_LOCATION@
@@ -230,6 +231,10 @@
     fi
     exit 0
     ;;
+    --db-version)
+    echo $APU_DB_VERSION
+    exit 0
+    ;;
     --help)
     show_usage
     exit 0



-- 
Philip

Re: Subversion's Berkeley DB detection with APR trunk

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> On 06/21/2011 08:03 AM, Philip Martin wrote:
> > apr trunk combines apr and apr-util into a single library and there
> > is
> > only a single apr-2-config script.  Subversion can be configured by
> > using this script for both apr and apr-util, but Subversion's
> > Berkeley
> > DB detection doesn't work.  This is because the apr-2-config script
> > doesn't support the --db-version parameter that the old apu-config
> > script provided.
> > 
> > Should we rework Subversion's Berkeley DB detection or should we
> > change
> > APR?
> 
> I'd be interested in knowing why the --db-version parameter was
> dropped.  In
> the absence of a solid reason, I think APR should be changed to
> support as much.

+1

> --
> C. Michael Pilato <cm...@collab.net>
> CollabNet   <>   www.collab.net   <>   Distributed Development On
> Demand
> 

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/

Re: Subversion's Berkeley DB detection with APR trunk

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> On 06/21/2011 08:03 AM, Philip Martin wrote:
> > apr trunk combines apr and apr-util into a single library and there
> > is
> > only a single apr-2-config script.  Subversion can be configured by
> > using this script for both apr and apr-util, but Subversion's
> > Berkeley
> > DB detection doesn't work.  This is because the apr-2-config script
> > doesn't support the --db-version parameter that the old apu-config
> > script provided.
> > 
> > Should we rework Subversion's Berkeley DB detection or should we
> > change
> > APR?
> 
> I'd be interested in knowing why the --db-version parameter was
> dropped.  In
> the absence of a solid reason, I think APR should be changed to
> support as much.

+1

> --
> C. Michael Pilato <cm...@collab.net>
> CollabNet   <>   www.collab.net   <>   Distributed Development On
> Demand
> 

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/

Re: Subversion's Berkeley DB detection with APR trunk

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 06/21/2011 08:03 AM, Philip Martin wrote:
> apr trunk combines apr and apr-util into a single library and there is
> only a single apr-2-config script.  Subversion can be configured by
> using this script for both apr and apr-util, but Subversion's Berkeley
> DB detection doesn't work.  This is because the apr-2-config script
> doesn't support the --db-version parameter that the old apu-config
> script provided.
> 
> Should we rework Subversion's Berkeley DB detection or should we change
> APR?

I'd be interested in knowing why the --db-version parameter was dropped.  In
the absence of a solid reason, I think APR should be changed to support as much.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Re: Subversion's Berkeley DB detection with APR trunk

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 06/21/2011 08:03 AM, Philip Martin wrote:
> apr trunk combines apr and apr-util into a single library and there is
> only a single apr-2-config script.  Subversion can be configured by
> using this script for both apr and apr-util, but Subversion's Berkeley
> DB detection doesn't work.  This is because the apr-2-config script
> doesn't support the --db-version parameter that the old apu-config
> script provided.
> 
> Should we rework Subversion's Berkeley DB detection or should we change
> APR?

I'd be interested in knowing why the --db-version parameter was dropped.  In
the absence of a solid reason, I think APR should be changed to support as much.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Re: Subversion's Berkeley DB detection with APR trunk

Posted by Branko Čibej <br...@e-reka.si>.
On 21.06.2011 14:03, Philip Martin wrote:
> apr trunk combines apr and apr-util into a single library and there is
> only a single apr-2-config script.  Subversion can be configured by
> using this script for both apr and apr-util, but Subversion's Berkeley
> DB detection doesn't work.  This is because the apr-2-config script
> doesn't support the --db-version parameter that the old apu-config
> script provided.
>
> Should we rework Subversion's Berkeley DB detection or should we change
> APR?

Changing trunk APR seems to be the way to go here. I wonder why that
option didn't make it into the merged config script.

-- Brane