You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Andreas Stieger <an...@gmx.de> on 2012/05/12 01:20:35 UTC

[PATCH] fix Ruby 1.9 deprecation warning for Config, use RbConfig

Hello,

[[[
 fix Ruby 1.9 deprecation warning for Config, use RbConfig
 * configure.ac
   replace Config with RbConfig
 *  build/ac-macros/swig.m4
  replace Config with RbConfig
]]]

The configure script reads the Ruby major and minor version to reject
configuring swig bindings for Ruby 1.9. It does this by accessing
Config::CONFIG which is deprecated in that release.

ruby -rrbconfig -e 'print Config::CONFIG.fetch(%q(MAJOR))'
ruby -rrbconfig -e 'print Config::CONFIG.fetch(%q(MINOR))'

So instead of meaningful message we get:

checking for Ruby major version... -e:1: Use RbConfig instead of
obsolete and deprecated Config.
checking for Ruby minor version... -e:1: Use RbConfig instead of
obsolete and deprecated Config.

The same warning is triggered when trying to configure SWIG_RB_COMPILE
and SWIG_RB_LINK, although that is moot as these are useless with Ruby
1.9 anyway for now. The following works with at least Ruby 1.8:

ruby -rrbconfig -e 'print Config::RbCONFIG.fetch(%q(MAJOR))'
ruby -rrbconfig -e 'print Config::RbCONFIG.fetch(%q(MINOR))'

This was found during work on the openSUSE package. Please review,
especially concerning backwards compatibility with Ruby versions older
than 1.8.

Andreas

Re: [PATCH] fix Ruby 1.9 deprecation warning for Config, use RbConfig

Posted by Greg Stein <gs...@gmail.com>.
On Fri, May 11, 2012 at 7:20 PM, Andreas Stieger <an...@gmx.de> wrote:
> Hello,
>
> [[[
>  fix Ruby 1.9 deprecation warning for Config, use RbConfig
>  * configure.ac
>   replace Config with RbConfig
>  *  build/ac-macros/swig.m4
>  replace Config with RbConfig
> ]]]
>
> The configure script reads the Ruby major and minor version to reject
> configuring swig bindings for Ruby 1.9. It does this by accessing
> Config::CONFIG which is deprecated in that release.
>
> ruby -rrbconfig -e 'print Config::CONFIG.fetch(%q(MAJOR))'
> ruby -rrbconfig -e 'print Config::CONFIG.fetch(%q(MINOR))'
>
> So instead of meaningful message we get:
>
> checking for Ruby major version... -e:1: Use RbConfig instead of
> obsolete and deprecated Config.
> checking for Ruby minor version... -e:1: Use RbConfig instead of
> obsolete and deprecated Config.
>
> The same warning is triggered when trying to configure SWIG_RB_COMPILE
> and SWIG_RB_LINK, although that is moot as these are useless with Ruby
> 1.9 anyway for now. The following works with at least Ruby 1.8:
>
> ruby -rrbconfig -e 'print Config::RbCONFIG.fetch(%q(MAJOR))'
> ruby -rrbconfig -e 'print Config::RbCONFIG.fetch(%q(MINOR))'
>
> This was found during work on the openSUSE package. Please review,
> especially concerning backwards compatibility with Ruby versions older
> than 1.8.

Well... it looks like 1.8.0 was released on Aug 4, 2003. I'm not sure
that we need to test for older versions (tho it wouldn't hurt). But
whatever... more people are going to have 1.9 and hit that warning
message, than people with older Ruby.

+1 for you to commit [1]

Cheers,
-g

[1] http://subversion.apache.org/docs/community-guide/roles.html#partial-commit-access