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

Re: svn 1.4.4 --version/--help gives error without dav

From: Karl Berry <karl_at_freefriends.org>
Date: 2007-09-06 21:05:35 CEST

I wrote a few weeks ago about configuring svn without dav, and then
getting an error from --version and --help, namely:

> svn: 'libsvn_ra_dav-1.so.0' does not define 'svn_ra_dav__init()': Error string not specified yet

David G kindly replied on July 29 with several pointers, including most
notably which shared libraries were getting linked.

I've dealt with that, but the problem persists (now in 1.4.5), and here
is why: I am compiling svn from the original source and installing it in
my own directory, but my system (Red Hat) also has svn installed in the
system libraries, including most notably /usr/lib/libsvn_ra_dav*.so.

Although in my compilation of svn I disabled dav at configure time, it
turns out that's not enough. At runtime, load_ra_module in ra_loader.c
looks up the .so for libsvn_ra_dav; since my installation directory
doesn't have it, the .so in /usr/lib is found, which is a different
version, and the error ensues.

Specifically, in the case of --version/--help, svn_ra_print_modules
  loops through ra_libraries, which includes the dav scheme with the
  initfunc and compat_initfunc members set to zero (since
  SVN_LIBSVN_CLIENT_LINKS_RA_DAV is not #define'd).
Since initfunc is zero, the loop calls load_ra_module.
load_ra_module calls SVN_ERR(svn_dso_load(&dso, libname)),
  which succeeds, since there's a .so in /usr/lib with the right name.

I found that it is possible to avoid the error by moving the #ifdef's in
the initialization of ra_libraries so that the struct entry is
completely eradicated at compile time (diff below). However, I imagine
you had good reason for wanting to discover these at runtime, so I'm
doubtful you want to change that.

So perhaps this configuration is simply not supportable out of box: one
version of svn in the system directories, and a user-built version
elsewhere that includes fewer ra schemes. ?

Life goes on if so, of course, but I wanted to mention it and see if
I was missing some other nice way of handling it.

Thanks,
Karl

--- /usr/local/src/subversion-1.4.5/subversion/libsvn_ra/ORIG/ra_loader.c 2006-08-10 22:58:33.000000000 +0200
+++ /usr/local/src/subversion-1.4.5/subversion/libsvn_ra/ra_loader.c 2007-09-06 19:18:00.000000000 +0200
@@ -65,2 +65,3 @@
 } ra_libraries[] = {
+#ifdef SVN_LIBSVN_CLIENT_LINKS_RA_DAV
   {
@@ -68,8 +69,8 @@
     dav_schemes,
-#ifdef SVN_LIBSVN_CLIENT_LINKS_RA_DAV
     svn_ra_dav__init,
     svn_ra_dav_init
-#endif
   },
+#endif
 
+#ifdef SVN_LIBSVN_CLIENT_LINKS_RA_SVN
   {
@@ -77,8 +78,8 @@
     svn_schemes,
-#ifdef SVN_LIBSVN_CLIENT_LINKS_RA_SVN
     svn_ra_svn__init,
     svn_ra_svn_init
-#endif
   },
+#endif
 
+#ifdef SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL
   {
@@ -86,8 +87,8 @@
     local_schemes,
-#ifdef SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL
     svn_ra_local__init,
     svn_ra_local_init
-#endif
   },
+#endif
 
+#ifdef SVN_LIBSVN_CLIENT_LINKS_RA_SERF
   {
@@ -95,7 +96,6 @@
     dav_schemes,
-#ifdef SVN_LIBSVN_CLIENT_LINKS_RA_SERF
     svn_ra_serf__init,
     svn_ra_serf_init
-#endif
   },
+#endif
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Sep 6 21:02:27 2007

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.