Bug #7172

[[Ruby 1.9:]] fix rbconfig for --enable-load-relative (v2)

Added by Michal Papis over 2 years ago. Updated about 2 years ago.

[ruby-core:48027]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
ruby -v:2.0.0dev Backport:

Description

continuation of http://bugs.ruby-lang.org/issues/6903 and http://bugs.ruby-lang.org/issues/7115

Checked with http://bugs.ruby-lang.org/projects/ruby-193/repository/entry/tool/mkconfig.rb and p286,
there is still missing fix for rbconfig, it can be found here:

https://github.com/wayneeseguin/rvm/blob/master/patches/ruby/1.9.3/p286/ruby-multilib.patch

it does two things important for movable rubies:

  1. https://github.com/wayneeseguin/rvm/blob/master/patches/ruby/1.9.3/p286/ruby-multilib.patch#L27-28 - properly detect libruby prefix on system with lib64
  2. https://github.com/wayneeseguin/rvm/blob/master/patches/ruby/1.9.3/p286/ruby-multilib.patch#L36 - replace all occurrences of application prefix with $(prefix) so after moving ruby to other location final system paths are used instead of the build system paths, this solves number of issues, especially with compilation gem native extensions.

Related issues

Related to Ruby trunk - Bug #6903: [[Ruby 1.9:]] --enable-load-relative broken on systems with /lib64 Closed 08/22/2012
Related to Backport193 - Backport #7115: [[Ruby 1.9:]] fix rbconfig for --enable-load-relative Closed 10/08/2012

History

#1 Updated by Yehuda Katz over 2 years ago

Thanks mpapis for moving the ball forward on this. I rely on
--enable-load-relative for Tokaido, and getting/keeping it working reliably
will make me very happy.

Yehuda Katz
(ph) 718.877.1325

On Tue, Oct 16, 2012 at 9:14 AM, mpapis (Michal Papis) mpapis@gmail.comwrote:

Issue #7172 has been reported by mpapis (Michal Papis).


Backport #7172: [[Ruby 1.9:]] fix rbconfig for --enable-load-relative (v2)
https://bugs.ruby-lang.org/issues/7172

Author: mpapis (Michal Papis)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:

continuation of http://bugs.ruby-lang.org/issues/6903 and
http://bugs.ruby-lang.org/issues/7115

Checked with
http://bugs.ruby-lang.org/projects/ruby-193/repository/entry/tool/mkconfig.rband p286,
there is still missing fix for rbconfig, it can be found here:

https://github.com/wayneeseguin/rvm/blob/master/patches/ruby/1.9.3/p286/ruby-multilib.patch

it does two things important for movable rubies:

1.
https://github.com/wayneeseguin/rvm/blob/master/patches/ruby/1.9.3/p286/ruby-multilib.patch#L27-28- properly detect libruby prefix on system with lib64
2.
https://github.com/wayneeseguin/rvm/blob/master/patches/ruby/1.9.3/p286/ruby-multilib.patch#L36- replace all occurrences of application prefix with $(prefix) so after
moving ruby to other location final system paths are used instead of the
build system paths, this solves number of issues, especially with
compilation gem native extensions.

http://bugs.ruby-lang.org/

#2 Updated by Usaku NAKAMURA over 2 years ago

  • Status changed from Open to Closed

Already backport at r37155.

#3 Updated by Michal Papis over 2 years ago

@usa I'm sorry but http://bugs.ruby-lang.org/projects/ruby-193/repository/revisions/37155 does not backport tool/mkconfig.rb please check again the description.

#4 Updated by Usaku NAKAMURA over 2 years ago

  • Status changed from Closed to Open

Oh, sorry, I've mistaken.

#5 Updated by Michal Papis over 2 years ago

any chance on getting it merged for 1.9.3? I just found out p362 was released and do not see it included :(

#6 Updated by Usaku NAKAMURA over 2 years ago

  • Status changed from Open to Assigned
  • Assignee set to Usaku NAKAMURA

maybe next release.

#7 Updated by Usaku NAKAMURA about 2 years ago

  • Assignee changed from Usaku NAKAMURA to Nobuyoshi Nakada
  • Tracker changed from Backport to Bug
  • Project changed from Backport193 to Ruby trunk

... This problem is not fixed at trunk (and 2.0.0-rc1), isn't it?

#8 Updated by Michal Papis about 2 years ago

partial and a bit improved version is applied here: http://bugs.ruby-lang.org/projects/ruby-trunk/repository/entry/tool/mkconfig.rb - but it is not available in the 2.0.0-rc1: http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-rc1.tar.gz

still missing:

this replaces all occurrences of application prefix with $(prefix) so after moving ruby to other location final system paths are used instead of the build system paths, this solves number of issues, especially with compilation gem native extensions.

#9 Updated by Michal Papis about 2 years ago

just took another look on ruby-trunk and there are still two changes missing:

they are required to allow proper compilation of gems/extensions after ruby is moved to a new location.

would it be possible to get this into 2.0.0-p0 as it was reported already on 1.9.3-p194 (https://bugs.ruby-lang.org/issues/7115)

#10 Updated by Nobuyoshi Nakada about 2 years ago

  • Category set to build
  • Status changed from Assigned to Feedback
  • Target version set to 2.0.0
  • ruby -v set to 2.0.0dev

How do you run the configure script and which element in RbConfig has prefix expanded?

#11 Updated by Michal Papis about 2 years ago

So running:

rvm install ruby-head --debug --movable

Executes:

autoreconf
./configure --disable-install-doc --prefix=/home/mpapis/.rvm/rubies/ruby-head --enable-shared --enable-load-relative --sysconfdir=/etc --with-opt-dir=/home/mpapis/.rvm/rubies/ruby-head --with-baseruby=/home/mpapis/.rvm/wrappers/ruby-1.9.3-p374/ruby
make
make install

And this ends up with /home/mpapis/.rvm/rubies/ruby-head/lib64/ruby/2.0.0/x86_64-linux/rbconfig.rb:

CONFIG["configure_args"] = " '--disable-install-doc' '--prefix=/home/mpapis/.rvm/rubies/ruby-head' '--enable-shared' '--enable-load-relative' '--sysconfdir=/etc' '--with-opt-dir=/home/mpapis/.rvm/rubies/ruby-head' '--with-baseruby=/home/mpapis/.rvm/wrappers/ruby-1.9.3-p374/ruby' 'CC=ccache gcc'"
CONFIG["DLDFLAGS"] = "-L/home/mpapis/.rvm/rubies/ruby-head/lib -Wl,-R/home/mpapis/.rvm/rubies/ruby-head/lib "
CONFIG["CPPFLAGS"] = " -I/home/mpapis/.rvm/rubies/ruby-head/include $(DEFS) $(cppflags)"
CONFIG["LDFLAGS"] = "-L. -fstack-protector -rdynamic -Wl,-export-dynamic -L/home/mpapis/.rvm/rubies/ruby-head/lib -Wl,-R/home/mpapis/.rvm/rubies/ruby-head/lib "

I understand that is not the usual use case, but any time some libs will be compiled in ruby prefix or using relative path to ruby prefix (assuming lib was copied along to ruby) - after moving ruby it will not be possible to find those libs.

#12 Updated by Yusuke Endoh about 2 years ago

Sorry but I don't understand both the issue and the status at all.
Any action needed for 2.0.0-p0?

Yusuke Endoh mame@tsg.ne.jp

#13 Updated by Nobuyoshi Nakada about 2 years ago

  • Status changed from Feedback to Closed

Try --with-opt-dir='${prefix}'.
r39176 is needed for `make reconfig' to work, though.

Also available in: Atom PDF