Project

General

Profile

Actions

Bug #11002

closed

Don't abuse ruby_version

Added by vo.x (Vit Ondruch) over 9 years ago. Updated over 9 years ago.

Status:
Closed
Target version:
-
[ruby-core:<unknown>]

Description

This is what configure help says about ruby_version:

$ ./configure --help

... snip ...

  --with-ruby-version=STR ruby version string for version specific directories
                          [[full]] (full|minor|STR)

So according to this, it might be anything (the STR option).

If you look into history [1], why this configuration variable was introduced, it was IMO introduced to allow installation of several rubies of the same version side by side and it indeed could be anything.

Interesting, as time goes, this variable propagated into RbConfig and various people started to believe that they can trust to this variable and they can do some configuration or whatever based on this value. And recently, even ruby-core people forgot what was once purpose and semantics of the variable and starts to use the variable in various places freely and impose some assumptions [2, 3].

Could you please clean up this mess? The best would be if you can return the original meaning without any restrictions to the configuration option and the variable, although I agree that since the beginning, this was wrongly chosen name.

And just to illustrate, currently you can do:

./configure --with-ruby-version=2.3.my-ruby
./configure --with-ruby-version=2.3.333333333
./configure --with-ruby-version=2.3.

while you can't do:

./configure --with-ruby-version=1.8.7
./configure --with-ruby-version=my-special-configuration

since it fails during compilation:

generating enc.mk
./miniruby -I./lib -I. -I.ext/common  ./enc/make_encmake.rb --builtin-encs="enc/ascii.o enc/us_ascii.o enc/unicode.o enc/utf_8.o" --builtin-transes="enc/trans/newline.o" --module enc.mk 
/builddir/build/BUILD/ruby-2.3.0-r50089/rbconfig.rb:6:in `<module:RbConfig>': ruby lib version (1.8.7) doesn't match executable version (2.3.0) (RuntimeError)
	from /builddir/build/BUILD/ruby-2.3.0-r50089/rbconfig.rb:4:in `<top (required)>'
	from /builddir/build/BUILD/ruby-2.3.0-r50089/lib/mkmf.rb:5:in `require'
	from /builddir/build/BUILD/ruby-2.3.0-r50089/lib/mkmf.rb:5:in `<top (required)>'
	from ./enc/make_encmake.rb:8:in `load'
	from ./enc/make_encmake.rb:8:in `<main>'
uncommon.mk:626: recipe for target 'enc.mk' failed
make: *** [enc.mk] Error 1

[1] https://github.com/ruby/ruby/commit/6bc480e059b0b9a6a24dceaa96e2d0717cceca51
[2] https://github.com/ruby/ruby/commit/7d248667462c240257e0e9ddaf25f372532660d1
[3] https://github.com/ruby/ruby/commit/6268830ba87bf80852f9a30d4cff7ad250c379dd

Actions #2

Updated by vo.x (Vit Ondruch) over 9 years ago

  • Assignee set to nobu (Nobuyoshi Nakada)

I submitted PR [1] which tries to fix this situation. Basically

  • The "ruby_version" can't be modified by configuration options anymore and it should be always equal to ruby -e 'puts RUBY_VERSION'.
  • The version will always have three digits X.Y.Z. The RUBY_LIB_VERSION_STYLE is explicitly set to 3 now, but it might be good idea to drop the RUBY_LIB_VERSION_STYLE entirely (I can prepare patch if you like).

Could you please consider accepting this PR?

[1] https://github.com/ruby/ruby/pull/861

Actions #3

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r50152.


rbconfig.rb: use program version

  • common.mk, tool/mkconfig.rb: check the running ruby version in
    rbconfig.rb with the program version, as RUBY_VERSION has never
    been affected by --with-ruby-version option.
    [ruby-core:68639] [Bug #11002]
  • configure.in (LIBRUBY_DLDFLAGS): compatibility_version must be
    valid version numbers, not an arbitrary string.
Actions #4

Updated by usa (Usaku NAKAMURA) over 9 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: REQUIRED
Actions #5

Updated by usa (Usaku NAKAMURA) over 9 years ago

  • Backport changed from 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONTNEED
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0