You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Ben Reser <be...@reser.org> on 2013/06/07 17:52:03 UTC

Re: svn commit: r1480412 - /subversion/trunk/subversion/bindings/swig/ruby/test/util.rb

This change breaks the Ruby test suite with out of tree builds:

[[[
[breser@kong svn-trunk]$ make check-swig-rb
if [ "DYLD_LIBRARY_PATH" = "DYLD_LIBRARY_PATH" ]; then for d in
/Users/breser/wandisco/builds/svn-trunk/subversion/bindings/swig/python/libsvn_swig_rb
/Users/breser/wandisco/builds/svn-trunk/subversion/bindings/swig/python/../../../libsvn_*;
do if [ -n "$DYLD_LIBRARY_PATH" ]; then
DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$d/.libs"; else
DYLD_LIBRARY_PATH="$d/.libs"; fi; done; export DYLD_LIBRARY_PATH; fi;
\
cd /Users/breser/wandisco/builds/svn-trunk/subversion/bindings/swig/ruby; \
          if [ "1" -eq 1 -a "8" -lt 9 ] ; then \
            /usr/bin/ruby -I
/Users/breser/wandisco/share-local/wcs/svn-trunk/subversion/bindings/swig/ruby
\
              /Users/breser/wandisco/share-local/wcs/svn-trunk/subversion/bindings/swig/ruby/test/run-test.rb
\
     --verbose=normal; \
          else \
   /usr/bin/ruby -I
/Users/breser/wandisco/share-local/wcs/svn-trunk/subversion/bindings/swig/ruby
\
     /Users/breser/wandisco/share-local/wcs/svn-trunk/subversion/bindings/swig/ruby/test/run-test.rb;
\
          fi
/Users/breser/wandisco/share-local/wcs/svn-trunk/subversion/bindings/swig/ruby/test/util.rb:22:in
`require': no such file to load -- ./svn/util (LoadError)
from /Users/breser/wandisco/share-local/wcs/svn-trunk/subversion/bindings/swig/ruby/test/util.rb:22
from /Users/breser/wandisco/share-local/wcs/svn-trunk/subversion/bindings/swig/ruby/test/run-test.rb:37:in
`require'
from /Users/breser/wandisco/share-local/wcs/svn-trunk/subversion/bindings/swig/ruby/test/run-test.rb:37
make: *** [check-swig-rb] Error 1
]]]

This happens because as you can see above we're cd'ing into the build
tree before running the test and the svn/util.rb file is only in the
source tree.

I really don't understand why this change is necessary at all since as
you can see above the source tree is added to the load path with -I.

On Wed, May 8, 2013 at 8:07 PM,  <pb...@apache.org> wrote:
> Author: pburba
> Date: Wed May  8 19:07:44 2013
> New Revision: 1480412
>
> URL: http://svn.apache.org/r1480412
> Log:
> Ruby 1.9 compatibility fix.
>
> * subversion/bindings/swig/ruby/test/util.rb
>   (util.rb): Explicitly state that the cwd should be searched
>    when requiring "svn/util".  Ruby 1.9 no longer includes the cwd in the
>    load path.
>
> Modified:
>     subversion/trunk/subversion/bindings/swig/ruby/test/util.rb
>
> Modified: subversion/trunk/subversion/bindings/swig/ruby/test/util.rb
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/test/util.rb?rev=1480412&r1=1480411&r2=1480412&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/bindings/swig/ruby/test/util.rb (original)
> +++ subversion/trunk/subversion/bindings/swig/ruby/test/util.rb Wed May  8 19:07:44 2013
> @@ -19,7 +19,7 @@
>
>  require "fileutils"
>  require "pathname"
> -require "svn/util"
> +require "./svn/util"
>  require "tmpdir"
>
>  require "my-assertions"
>

Re: svn commit: r1480412 - /subversion/trunk/subversion/bindings/swig/ruby/test/util.rb

Posted by Ben Reser <be...@reser.org>.
On Wed, Jun 12, 2013 at 7:22 PM, Paul Burba <pt...@gmail.com> wrote:
> Let me know if r1492295 fixes the problem for you.  As you mentioned
> there are other problems running the Ruby tests on Windows on an out
> of tree build so I can't run the tests to completion, but this should
> fix the LoadError you encountered and AFAICT works with [Ruby 1.8 |
> 1.9] x [in-tree | out-of-tree builds].

Thanks Paul, that fixes the problem.  I think a better long term fix
here would be to add an option to win-tests.py to run bindings tests.
If you do that then you can pass -I and you no longer have to jump
through such hoops.  There is of course the benefit of the change you
made is that it's easier to run the tests since I don't think you need
the -I at all anymore.  So if we consider this the permanent fix then
I'd remove the -I entirely from the Unix build.

Re: svn commit: r1480412 - /subversion/trunk/subversion/bindings/swig/ruby/test/util.rb

Posted by Paul Burba <pt...@gmail.com>.
On Tue, Jun 11, 2013 at 7:16 AM, Ben Reser <be...@reser.org> wrote:
> On Fri, Jun 7, 2013 at 4:52 PM, Ben Reser <be...@reser.org> wrote:
>> I really don't understand why this change is necessary at all since as
>> you can see above the source tree is added to the load path with -I.

Sorry Ben, I missed your first email on this until today (cmpilato -
thanks for the heads up!)

> So I think I understand the logic here.  Windows doesn't seem to have
> any wrapper for running the swig tests (like make check-swig-rb on
> Unix) so you're probably running run-test.rb directly.

That's correct.

> Since Windows
> doesn't support out of tree builds you don't see the problem that we
> see on Unix.  I'm not a Ruby expert but if there's a way to add the
> current directory to the load path in the Ruby script like you can
> with -I from the command line I'd suggest that.

Let me know if r1492295 fixes the problem for you.  As you mentioned
there are other problems running the Ruby tests on Windows on an out
of tree build so I can't run the tests to completion, but this should
fix the LoadError you encountered and AFAICT works with [Ruby 1.8 |
1.9] x [in-tree | out-of-tree builds].

--
Paul T. Burba
CollabNet, Inc. -- www.collab.net -- Enterprise Cloud Development
Skype: ptburba

> Unfortunately, I can't seem to get the Ruby bindings to build on
> Windows.  They blow up on a bunch of syntax errors in the Ruby headers
> for me and I can't crib off the buildbots since they don't seem to
> build them either.

Re: svn commit: r1480412 - /subversion/trunk/subversion/bindings/swig/ruby/test/util.rb

Posted by Ben Reser <be...@reser.org>.
On Fri, Jun 7, 2013 at 4:52 PM, Ben Reser <be...@reser.org> wrote:
> I really don't understand why this change is necessary at all since as
> you can see above the source tree is added to the load path with -I.

So I think I understand the logic here.  Windows doesn't seem to have
any wrapper for running the swig tests (like make check-swig-rb on
Unix) so you're probably running run-test.rb directly.  Since Windows
doesn't support out of tree builds you don't see the problem that we
see on Unix.  I'm not a Ruby expert but if there's a way to add the
current directory to the load path in the Ruby script like you can
with -I from the command line I'd suggest that.

Unfortunately, I can't seem to get the Ruby bindings to build on
Windows.  They blow up on a bunch of syntax errors in the Ruby headers
for me and I can't crib off the buildbots since they don't seem to
build them either.

Re: svn commit: r1480412 - /subversion/trunk/subversion/bindings/swig/ruby/test/util.rb

Posted by Ben Reser <be...@reser.org>.
On Fri, Jun 7, 2013 at 4:52 PM, Ben Reser <be...@reser.org> wrote:
> I really don't understand why this change is necessary at all since as
> you can see above the source tree is added to the load path with -I.

So I think I understand the logic here.  Windows doesn't seem to have
any wrapper for running the swig tests (like make check-swig-rb on
Unix) so you're probably running run-test.rb directly.  Since Windows
doesn't support out of tree builds you don't see the problem that we
see on Unix.  I'm not a Ruby expert but if there's a way to add the
current directory to the load path in the Ruby script like you can
with -I from the command line I'd suggest that.

Unfortunately, I can't seem to get the Ruby bindings to build on
Windows.  They blow up on a bunch of syntax errors in the Ruby headers
for me and I can't crib off the buildbots since they don't seem to
build them either.