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

Re: Support for BDB in RPM's

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-04-29 14:48:58 CEST

David Summers <david@summersoft.fay.ar.us> writes:

> OK, I tried several more things. The db-4.2 is listed FIRST in the
> 'ldd svn' and 'ldd svnadmin' but that doesn't help.
> I fiddeled around and switched all -ldb to -ldb-4.2 and all
> -I/usr/include/db42 is include FIRST before other includes.
> No luck. It compiles but still produces BDB 4.1.25 repositories.

It still appears that you are not picking up the 4.2 header files.
You can confirm that by running nm on libsvn_fs_base-1.so, or by
adding -H to the gcc compile command.

Here's how I did something similar to what you want to do:

My normal Subversion build uses BDB 4.2 installed in /usr and apr-util
installed in /usr/local/apache2 linked to BDB 4.2 in /usr. Subversion
is configured using "--with-apr-util=/usr/local/apache2" and the
resulting build looks like:

$ ldd /usr/local/subversion/lib/libsvn_fs_base-1.so | grep db
        libdb-4.2.so => /usr/lib/libdb-4.2.so (0x40082000)
$ nm /usr/local/subversion/lib/libsvn_fs_base-1.so | grep db_cre
         U db_create_4002

Note my BDB 4.2 is compiled using --with-uniquename, hence the _4002
suffix on the db_create symbol.

I have just downloaded BDB 4.3, configured using --with-uniquename and
installed in /usr/local/bdb43. Then I rebuilt Subversion using

$ make EXTRA_CFLAGS=-I/usr/local/bdb43/include \
       EXTRA_LDFLAGS="-L/usr/local/bdb43/lib -ldb-4.3"

Note I did not reconfigure Subversion, it's still configured to use
apr-util from /usr/local/apache2 and BDB 4.2 from /usr. The build
didn't quite work, for some reason I had to add libsvn_fs to the libs
for target-test in build.conf, once that was done the build completed.

The newly built Subversion appears to use BDB 4.3:

$ ldd subversion/libsvn_fs_base/.libs/libsvn_fs_base-1.so | grep db
        libdb-4.3.so => /usr/local/bdb43/lib/libdb-4.3.so (0x4002d000)
        libdb-4.2.so => /usr/lib/libdb-4.2.so (0x40139000)
$ nm subversion/libsvn_fs_base/.libs/libsvn_fs_base-1.so | grep db_cre
         U db_create_4003

Using my normal Subversion binaries I get BDB 4.2:

$ svnadmin create --fs-type bdb repo_normal
$ db4.2_archive -l -h repo_normal/db

Using the newly built ones I get BDB 4.3:

$ subversion/svnadmin/svnadmin create --fs-type bdb repo_special
$ db4.2_archive -l -h repo_special/db
db_archive: Program version 4.2 doesn't match environment version
db_archive: Ignoring log file: repo_special/db/log.0000000001: unsupported log version 10
db_archive: Invalid log file: log.0000000001: Invalid argument
db_archive: PANIC: Invalid argument
db_archive: PANIC: DB_RUNRECOVERY: Fatal error, run database recovery
db_archive: Program version 4.2 doesn't match environment version
db_archive: open: DB_RUNRECOVERY: Fatal error, run database recovery
$ /usr/local/bdb43/bin/db_archive -l -h repo_special/db

As far as your build goes, the thing you have to crack is you must get
your compile to pick up your 4.2 headers; that's the key, it's what
makes libsvn_fs_base use a different BDB from apr-util. It should
simply be a matter of getting the .h files and the -I directives in
the right place.

Philip Martin
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Apr 29 14:52:32 2005

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