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

[PATCH] ruby <= 1.8.5 fix

From: Rupert Wood <me_at_rupey.net>
Date: Mon, 16 Feb 2009 19:25:28 -0000

The commit to fix Ruby 1.9 (35852) broke 1.8.5 and below lower because they don't define RARRAY_PTR and LEN or RSTRING_PTR and LEN. AFAICS there's no minimum Ruby version documented (although there is a configure check for >= 1.8.2) so 1.8.5 should still be OK.

The following patch adds the missing defines. As far as I can see swigutil_rb.h isn't used outside the libsvn_swig_ruby build so it's safe to modify for this (if you did prefer to avoid changing the .h then both swigutil_rb.c and the ruby svn_client.c need patching). Ideally I would also wrap the checks and definitions in a #if that tests Ruby's version but I can't see an easy way to pull in Ruby's version.h and I think it's overkill to write a configure check for this. However I think it's a safe bet that all future Ruby versions will define RARRAY_PTR. The RArray structure is the same in versions 1.8.2, -3 and -4 so this patch should work for those versions too.

Tested against trunk r35879 on i686-linux with Ruby 1.8.5. I do see the following check-swig-rb failures but then I see the same failures building against 1.8.6 without this patch.

  1) Failure:
test_dirs_changed(SvnInfoTest) [/.../subversion/bindings/swig/ruby/test/test_info.rb:50]:
<48> expected but was
<1>.

  2) Error:
test_info(SvnInfoTest):
Svn::Error::BadDate: subversion/libsvn_subr/time.c:199: Svn::Error::BadDate:
/.../subversion/bindings/swig/ruby/svn/util.rb:86:in `svn_time_from_cstring'
/.../subversion/bindings/swig/ruby/svn/util.rb:86:in `time_from_cstring'
/.../subversion/bindings/swig/ruby/svn/core.rb:22:in `from_svn_format'
/.../subversion/bindings/swig/ruby/svn/core.rb:683:in `date'
/.../subversion/bindings/swig/ruby/test/test_info.rb:29:in `test_info'

219 tests, 1488 assertions, 1 failures, 1 errors
gmake: *** [check-swig-rb] Error 1

[[[
Define RARRAY_PTR,LEN and RSTRING_PTR,LEN if missing to support Ruby <= 1.8.5.

* subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h:
  Define RARRAY_PTR, RARRAY_LEN, RSTRING_PTR and RSTRING_LEN if missing.
  Use Ruby 1.8.6's definitions.
]]]

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1172688

Received on 2009-02-16 20:25:46 CET

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