You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Julian Foad <ju...@foad.me.uk> on 2018/09/24 17:24:52 UTC

Ruby bindings failure, perhaps related to __?

subversion/bindings/swig/ruby/svn/util.rb:40:in `block in to_ruby_class_name': undefined method `downcase' for nil:NilClass (NoMethodError)

I got that locally, and this buildbot sees it too:
  https://ci.apache.org/builders/svn-bb-openbsd/builds/114

Can anyone help? My Ruby fu is near zero...

-- 
- Julian

Re: Ruby bindings failure, perhaps related to __?

Posted by Julian Foad <ju...@apache.org>.
Branko Čibej wrote:
> On 27.09.2018 19:02, Julian Foad wrote:
> > [...] maybe it would be better to just not create the "XShelf" short name [...]
> >
> > But also I want to remember that the priority right now is to get 1.11 out with something that works, first, and then improve it later.
> 
> If we keep the XName form in, we have to document that these classes are
> experimental and all the usual disclaimers apply.

Now I've changed it to not create a short name like "XShelf" at all. A long name like Svn::Ext::Client::Svn_client__shelf_t is still available.

I think that will be sufficient for 1.11 now, won't it?

Can someone review the updated backport nomination please?

-- 
- Julian

Re: Ruby bindings failure, perhaps related to __?

Posted by Branko Čibej <br...@apache.org>.
On 27.09.2018 19:02, Julian Foad wrote:
> Julian Foad wrote:
>> Svn::Client::XShelf
> Testing it like this:
>
>     $ configure [...] --with-ruby-sitedir=$PREFIX/site_ruby [...]
>     [...]
>     $ make install-swig-rb
>     [...]
>     $ irb -I $PREFIX/site_ruby/2.3.0 -I $PREFIX/site_ruby/usr/local/lib/x86_64-linux-gnu/site_ruby
>     irb(main):001:0> require "svn/client"
>     => true
>     irb(main):002:0> Svn::Client::XShelf
>     => Svn::Ext::Client::Svn_client__shelf_t
>
> ... shows that the long version of the name is exposed anyway, so maybe it would be better to just not create the "XShelf" short name at all, if that works. That might be more consistent with what we do for swig-py. I'll try it.
>
> But also I want to remember that the priority right now is to get 1.11 out with something that works, first, and then improve it later.

If we keep the XName form in, we have to document that these classes are
experimental and all the usual disclaimers apply.

-- Brane

Re: Ruby bindings failure, perhaps related to __?

Posted by Julian Foad <ju...@apache.org>.
Julian Foad wrote:
> Svn::Client::XShelf

Testing it like this:

    $ configure [...] --with-ruby-sitedir=$PREFIX/site_ruby [...]
    [...]
    $ make install-swig-rb
    [...]
    $ irb -I $PREFIX/site_ruby/2.3.0 -I $PREFIX/site_ruby/usr/local/lib/x86_64-linux-gnu/site_ruby
    irb(main):001:0> require "svn/client"
    => true
    irb(main):002:0> Svn::Client::XShelf
    => Svn::Ext::Client::Svn_client__shelf_t

... shows that the long version of the name is exposed anyway, so maybe it would be better to just not create the "XShelf" short name at all, if that works. That might be more consistent with what we do for swig-py. I'll try it.

But also I want to remember that the priority right now is to get 1.11 out with something that works, first, and then improve it later.

-- 
- Julian

Re: Ruby bindings failure, perhaps related to __?

Posted by Julian Foad <ju...@apache.org>.
Julian Foad wrote:
> subversion/bindings/swig/ruby/svn/util.rb:40:in `block in 
> to_ruby_class_name': undefined method `downcase' for nil:NilClass

I learnt enough Ruby to fix it in r1842107, nominated for backport to 1.11.

The problem was it was trying to convert a struct type name like
svn_client__shelf_t
to a CamelCase Ruby class name like
Svn::Client::Shelf
but it couldn't handle the extra underscore.

We had to decide what the class name should be: "Shelf" or "_Shelf" or "XShelf" or "X_Shelf" or something like "svn_client__shelf" or other variants.

I found Ruby doesn't allow a class name to begin with an underscore, and we didn't want to pollute the "stable" namespace with an unstable API by using just "Shelf", so in the end I chose "XShelf":

Svn::Client::XShelf

We should treat this as an interim solution and examine what we are doing with the other language bindings and potentially change to a more widely consistent solution later.

-- 
- Julian