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

Re: Ruby binding can't be built?

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2002-12-27 01:03:53 CET

On Thursday, December 26, 2002, at 01:29 PM, Fumitoshi UKAI wrote:

> Ok.
>
> With this patch from trunk revision 4196, it can be built without any
> warnings on debian/sid. It may be better to change Svn::Client#propget
> and proplist from singleton_method to usual method to get auth_baton
> and accept revision arg.

honestly, i'd prefer to see two separate sets of methods, one for
normal props and one for revision props. stashing the revision in the
object seems like a hack, and they really are different things. now
the auth_baton seems like something one might want to stash in the
object, but if we split it out into separate revprop methods, then you
only need it for those, in which case you might as well pass it in i
suppose.

> I check it can be loaded without errors, but not yet tried much
> operations.
> Is there any good sample/test program or documentation?

unfortunately, no. this stuff could really use a good test suite and a
heavy dose of documentation, but there currently isn't any. again, if
you write it, i'll commit it ;-)

some comments on the actual patch. first, you should probably submit a
log entry with it (see the HACKING document for details), and you
shouldn't use tabs, just spaces (also in HACKING). the code changes
look fine, at first glance (haven't had a chance to test yet), but some
of the extconf.rb stuff looks sketchy. i don't like the idea of
forcing the use of gcc for the compiler like that, and the apr and
aprutil libs really are apr-0 and aprutil-0 (at least the ones from the
apache people are). i assume from your comments that you're compiling
on a debian box? you really should test this stuff with the bleeding
edge svn and apr/aprutil packages, as that's what it needs to build on.
  i think i like the stuff for building in the working copy though, i'll
have to digest it a bit first though.

thanks,

-garrett

> Thanks,
> Fumitoshi UKAI
>
> Index: client.c
> ===================================================================
> --- client.c (revision 4196)
> +++ client.c (working copy)
> @@ -27,11 +27,13 @@
>
> static svn_error_t *
> cl_log_message_func (const char **log_msg,
> + const char **tmp_file,
> apr_array_header_t *commit_items,
> void *baton,
> apr_pool_t *pool)
> {
> *log_msg = apr_pstrdup (pool, baton);
> + *tmp_file = NULL;
>
> return SVN_NO_ERROR;
> }
> @@ -555,6 +557,8 @@
> cl_propget (VALUE class, VALUE name, VALUE aTarget, VALUE recurse)
> {
> apr_hash_t *props;
> + svn_opt_revision_t *revision = NULL;
> + svn_client_auth_baton_t *auth_baton = NULL;
> apr_pool_t *pool;
> VALUE obj;
>
> @@ -564,8 +568,9 @@
> pool = svn_pool_create (NULL);
>
> SVN_RB_ERR (svn_client_propget (&props, StringValuePtr (name),
> - StringValuePtr (aTarget), RTEST
> (recurse),
> - pool),
> + StringValuePtr (aTarget),
> + revision, auth_baton,
> + RTEST (recurse), pool),
> pool);
>
> obj = svn_ruby_strbuf_hash (props, pool);
> @@ -577,6 +582,8 @@
> cl_proplist (VALUE class, VALUE aTarget, VALUE recurse)
> {
> apr_array_header_t *props;
> + svn_opt_revision_t *revision = NULL;
> + svn_client_auth_baton_t *auth_baton = NULL;
> apr_pool_t *pool;
>
> Check_Type (aTarget, T_STRING);
> @@ -584,6 +591,7 @@
> pool = svn_pool_create (NULL);
>
> SVN_RB_ERR (svn_client_proplist (&props, StringValuePtr (aTarget),
> + revision, auth_baton,
> RTEST (recurse), pool),
> pool);
>
> Index: extconf.rb
> ===================================================================
> --- extconf.rb (revision 4196)
> +++ extconf.rb (working copy)
> @@ -3,6 +3,12 @@
> #
> # Options: --with-svn-dir=<path to svn install>
> #
> +# When build in build tree,
> +# % SVN_BUILD_DIR=$svn_build_dir ruby extconf.rb
> +# % make
> +# % make -n DESTDIR=$DESTDIR install | \
> +# sed -e '$s/svn.so/.libs\/svn.so/' | sh
> +#
>
> if /mswin32/ =~ PLATFORM then
> require 'env'
> @@ -10,6 +16,11 @@
> require 'Env'
> end
>
> +if ENV['SVN_BUILD_DIR']
> + require 'rbconfig'
> + Config::MAKEFILE_CONFIG['CC'] = 'libtool gcc'
> + Config::MAKEFILE_CONFIG['LDSHARED'] = 'libtool --mode=link gcc
> -shared'
> +end
> require 'mkmf' # Here's the ruby module that does the grunt work
>
> dir_config('svn')
> @@ -26,20 +37,37 @@
> 'wc.o',
> ]
>
> +if ENV['SVN_BUILD_DIR']
> + ENV['PATH'] = "#{ENV['SVN_BUILD_DIR']}:#{ENV['PATH']}"
> +end
> $CFLAGS << ' -I. '
>
> $LDFLAGS << `apr-config --ldflags`.chop
> $LOCAL_LIBS << `apr-config --libs`.chop
> +# XXX: libapr0_2.0.43-1.deb doesn't provides shlib dependencies
> +$LOCAL_LIBS << ' -lgdbm'
> +$LOCAL_LIBS << ' -lexpat'
> +
> $CFLAGS << `apr-config --cflags`.chop
> $CFLAGS << `apr-config --includes`.chop
>
> +if ENV['SVN_BUILD_DIR']
> + $LDFLAGS << " " + ['svn_subr','svn_delta', 'svn_client',
> + 'svn_wc', 'svn_ra', 'svn_fs', 'svn_repos'].collect {|c|
> + "-L#{ENV['SVN_BUILD_DIR']}/subversion/lib#{c}" }.join(" ")
> +end
> +
> $LDFLAGS << `svn-config --ldflags`.chop
> $CFLAGS << `svn-config --cflags`.chop
> $CFLAGS << `svn-config --includes`.chop
>
> +if ENV['SVN_BUILD_DIR']
> + $CFLAGS << ' -I../../include'
> +else
> # ick... svn-config doesn't seem to be adding in the directory the
> subversion
> # includes are in, so lets work around that for now.
> -$CFLAGS << ' -I' + `svn-config --prefix`.chop +
> '/include/subversion-1'
> + $CFLAGS << ' -I' + `svn-config --prefix`.chop +
> '/include/subversion-1'
> +end
>
> # Linux needs -lpthread.
> if PLATFORM =~ /linux/ && $CFLAGS =~ /-pthread/ then
> @@ -48,8 +76,8 @@
>
> # Extra libraries needed to compile
> libraries = [
> - ['apr-0', 'apr_initialize'],
> - ['aprutil-0', 'apr_bucket_alloc'],
> + ['apr', 'apr_initialize'],
> + ['aprutil', 'apr_bucket_alloc'],
> ['svn_subr-1', 'svn_pool_create'],
> ['svn_delta-1', 'svn_txdelta_next_window'],
> ['svn_client-1', 'svn_client_commit'],

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Dec 27 01:04:35 2002

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.