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

Re: compiling svn-588 on FreeBSD with stock neon and db3

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2001-12-26 23:22:31 CET

Garrett Rooney <rooneg@electricjellyfish.net> writes:
> > and I'll take a look at what's involved in DB4 right now. :-)
>
> great, thanks a lot for all your help.

Here's (most of) a patch for the Berkeley upgrade. There's a bug in
it, as the configure step still fails to detect Berkeley 4.0, but I
think this is pretty close to what we'll need.

However, I just recalled that the whole reason we delayed this upgrade
in the first place is that there's a problem trying to use different
Berkeley versions between Apache and Subversion -- as I remember it,
mod_dav_svn was unable to load a different version of the Berkeley
shared libraries than the rest of httpd 2.0, so we can't upgrade until
Apache/APR does (?).

I think Mike Pilato and Greg Stein can comment more knowledgably about
this. In the meantime, here's the patch if you'd like to try and
figure out what I'm doing wrong. :-) It would be great if we could
have this ready so that when we finally _can_ upgrade, it's a
no-brainer.

-Karl

Upgrade to Berkeley DB 4.0.14.

This patch is unfinished. I think all the necessary code changes are
done, but something's still wrong with the configure step, as it does
not detect Berkeley 4.0 in /usr/local/BerkeleyDB.4.0 even when pass
the --with-berkeley-db flag.

* subversion/libsvn_fs/fs.c (cleanup_fs): Use fs->env->txn_checkpoint.
(svn_fs_close_fs): Use fs->env->txn_stat and fs->env->lock_stat, in
the instrumenting code.

* subversion/libsvn_fs/trail.c (begin_trail): Use
fs->env->txn_begin.
(abort_trail): Use fs->env->txn_abort.
(commit_trail): Use fs->env->txn_commit and fs->env->txn_checkpoint.

* INSTALL: Talk about Berkeley 4.0.14, not 3.3.11.

* ac-helpers/berkeley-db.m4 (SVN_LIB_BERKELEY_DB): Link to the .la
library unconditionally, as Berkeley now generates one. Make
workarounds look for Berkeley 4.0, not 3.3.

* configure.in (SVN_FS_WANT_DB_MAJOR, SVN_FS_WANT_DB_MINOR,
SVN_FS_WANT_DB_PATCH): Set to 4, 0, and 14 respectively.

Index: ./ac-helpers/berkeley-db.m4
===================================================================
--- ./ac-helpers/.svn/text-base/berkeley-db.m4.svn-base Mon Nov 19 15:28:02 2001
+++ ./ac-helpers/berkeley-db.m4 Wed Dec 26 17:20:44 2001
@@ -97,13 +97,7 @@
     dbdir=`cd db/dist ; pwd`
     SVN_DB_INCLUDES="-I$dbdir"
     svn_lib_berkeley_db=yes
- # Linking directly to the .la is broken with --disable-shared
- # because Berkeley db does not seem to generate a .la library.
- if test "$enable_shared" = "yes"; then
- SVN_DB_LIBS="$dbdir/libdb-3.3.la"
- else
- SVN_DB_LIBS="-L$dbdir -ldb"
- fi
+ SVN_DB_LIBS="$dbdir/libdb-4.0.la"
   elif test "$status" = "skip"; then
     svn_lib_berkeley_db=no
   else
@@ -115,9 +109,11 @@
       # database library in /usr/local/lib, as libdb.a. There is no
       # /usr/local/include/db.h. So if you check for /usr/local first, you'll
       # get the old header file from /usr/include, and the new library from
- # /usr/local/lib --- disaster. Check for that bogosity first.
- places="std /usr/local/include/db3:/usr/local/lib /usr/local
- /usr/local/BerkeleyDB.$1.$2 /usr/include/db3:/usr/lib"
+ # /usr/local/lib. Disaster. We check for that bogosity first,
+ # and assume that the bogosity has carried over to the Berkeley
+ # 4.0.x series -- if it hasn't, someone please make a noise.
+ places="std /usr/local/include/db4:/usr/local/lib /usr/local
+ /usr/local/BerkeleyDB.$1.$2 /usr/include/db4:/usr/lib"
     fi
     # Now `places' is guaranteed to be a list of place specs we should
     # search, no matter what flags the user passed.
Index: ./configure.in
===================================================================
--- ./.svn/text-base/configure.in.svn-base Fri Dec 21 11:05:35 2001
+++ ./configure.in Wed Dec 26 16:59:10 2001
@@ -116,9 +116,9 @@
 
 # Build the filesystem library (and repository administration tool)
 # only if we have an appropriate version of Berkeley DB.
-SVN_FS_WANT_DB_MAJOR=3
-SVN_FS_WANT_DB_MINOR=3
-SVN_FS_WANT_DB_PATCH=11
+SVN_FS_WANT_DB_MAJOR=4
+SVN_FS_WANT_DB_MINOR=0
+SVN_FS_WANT_DB_PATCH=14
 SVN_LIB_BERKELEY_DB($SVN_FS_WANT_DB_MAJOR, $SVN_FS_WANT_DB_MINOR,
                     $SVN_FS_WANT_DB_PATCH)
 
Index: ./subversion/libsvn_fs/trail.c
===================================================================
--- ./subversion/libsvn_fs/.svn/text-base/trail.c.svn-base Mon Nov 19 15:27:58 2001
+++ ./subversion/libsvn_fs/trail.c Wed Dec 26 16:57:06 2001
@@ -52,7 +52,7 @@
   trail->pool = svn_pool_create (pool);
   trail->undo = 0;
   SVN_ERR (DB_WRAP (fs, "beginning Berkeley DB transaction",
- txn_begin (fs->env, 0, &trail->db_txn, 0)));
+ fs->env->txn_begin (fs->env, 0, &trail->db_txn, 0)));
 
   *trail_p = trail;
   return SVN_NO_ERROR;
@@ -72,7 +72,7 @@
       undo->func (undo->baton);
 
   SVN_ERR (DB_WRAP (fs, "aborting Berkeley DB transaction",
- txn_abort (trail->db_txn)));
+ fs->env->txn_abort (trail->db_txn)));
  
   svn_pool_destroy (trail->pool);
 
@@ -96,13 +96,13 @@
      doesn't return DB_LOCK_DEADLOCK --- all deadlocks are reported
      earlier. */
   SVN_ERR (DB_WRAP (fs, "committing Berkeley DB transaction",
- txn_commit (trail->db_txn, 0)));
+ fs->env->txn_commit (trail->db_txn, 0)));
 
   /* Do a checkpoint here, if enough has gone on.
      The checkpoint parameters below are pretty arbitrary. Perhaps
      there should be an svn_fs_berkeley_mumble function to set them. */
   SVN_ERR (DB_WRAP (fs, "checkpointing after Berkeley DB transaction",
- txn_checkpoint (fs->env, 1024, 5, 0)));
+ fs->env->txn_checkpoint (fs->env, 1024, 5, 0)));
 
   /* We don't destroy the pool; we assume it contains stuff which will
      be useful beyond the transaction. */
Index: ./subversion/libsvn_fs/fs.c
===================================================================
--- ./subversion/libsvn_fs/.svn/text-base/fs.c.svn-base Tue Dec 18 11:51:20 2001
+++ ./subversion/libsvn_fs/fs.c Wed Dec 26 16:52:47 2001
@@ -132,12 +132,12 @@
 
   /* Checkpoint any changes. */
   {
- int db_err = txn_checkpoint (env, 0, 0, 0);
+ int db_err = env->txn_checkpoint (env, 0, 0, 0);
 
     while (db_err == DB_INCOMPLETE)
       {
         apr_sleep (1000000L); /* microseconds, so 1000000L == 1 second */
- db_err = txn_checkpoint (env, 0, 0, 0);
+ db_err = env->txn_checkpoint (env, 0, 0, 0);
       }
 
     /* If the environment was not (properly) opened, then txn_checkpoint
@@ -269,8 +269,9 @@
     int db_err;
 
     /* Print transaction statistics for this DB env. */
- if ((db_err = txn_stat (fs->env, &t)) != 0)
- fprintf (stderr, "Error running txn_stat(): %s", db_strerror (db_err));
+ if ((db_err = fs->env->txn_stat (fs->env, &t, 0)) != 0)
+ fprintf (stderr, "Error running fs->env->txn_stat(): %s",
+ db_strerror (db_err));
     else
       {
         printf ("*** DB txn stats, right before closing env:\n");
@@ -292,8 +293,9 @@
       }
 
     /* Print transaction statistics for this DB env. */
- if ((db_err = lock_stat (fs->env, &l)) != 0)
- fprintf (stderr, "Error running lock_stat(): %s", db_strerror (db_err));
+ if ((db_err = fs->env->lock_stat (fs->env, &l, 0)) != 0)
+ fprintf (stderr, "Error running fs->env->lock_stat(): %s",
+ db_strerror (db_err));
     else
       {
         printf ("*** DB lock stats, right before closing env:\n");
Index: ./INSTALL
===================================================================
--- ./.svn/text-base/INSTALL.svn-base Thu Dec 20 16:34:19 2001
+++ ./INSTALL Wed Dec 26 17:06:11 2001
@@ -148,17 +148,17 @@
       building a Subversion client that speaks to a remote (networked)
       repository, you don't need it.
 
- You'll need Berkeley DB 3.3.11 installed on your system. You can
+ You'll need Berkeley DB 4.0.14 installed on your system. You can
       get it from http://www.sleepycat.com/.
 
       If you already have another version of Berkeley DB installed and
- don't want to downgrade, you can unpack the Berkeley 3.3.11
+ don't want to downgrade, you can unpack the Berkeley 4.0.14
       distribution into a subdir named `db' in the top-level of the
       Subversion source tree. Then Subversion will ignore the system
       DB and use the one it found in its own source tree.
       Alternatively, you can add this flag
 
- --with-berkeley-db=/usr/local/BerkeleyDB.3.3
+ --with-berkeley-db=/usr/local/BerkeleyDB.4.0
 
       to your `configure' switches, and the build process will use the
       named Berkeley. You may need to use a different path, of
@@ -354,11 +354,11 @@
        this from happening, you have to tell Apache where to find the
        version of db subversion uses. Right before configure:
        
- export LDFLAGS=-L/usr/local/BerkeleyDB.3.3/lib
- export CPPFLAGS=-I/usr/local/BerkeleyDB.3.3/include
+ export LDFLAGS=-L/usr/local/BerkeleyDB.4.0/lib
+ export CPPFLAGS=-I/usr/local/BerkeleyDB.4.0/include
 
- Add --with-dbm=db3 to the configure line. This note assumes
- you have installed Berkeley DB 3.3.11 at its default locations.
+ Add --with-dbm=db4 to the configure line. This note assumes
+ you have installed Berkeley DB 4.0.14 at its default locations.
        For more info about the db requirement, see section III.C.1.
 
   All instructions below assume you configured Apache to install

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:54 2006

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.