Project

General

Profile

Bug #7172

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

Added by mpapis (Michal Papis) about 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
2.0.0dev
[ruby-core:48027]

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 /lib64Closed2012-08-22

History

#1 [ruby-core:48029] Updated by wycats (Yehuda Katz) about 5 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 [ruby-core:48084] Updated by usa (Usaku NAKAMURA) about 5 years ago

  • Status changed from Open to Closed

Already backport at r37155.

#3 [ruby-core:48289] Updated by mpapis (Michal Papis) about 5 years ago

usa (Usaku NAKAMURA) 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 [ruby-core:49089] Updated by usa (Usaku NAKAMURA) about 5 years ago

  • Status changed from Closed to Open

Oh, sorry, I've mistaken.

#5 [ruby-core:51138] Updated by mpapis (Michal Papis) almost 5 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 [ruby-core:51143] Updated by usa (Usaku NAKAMURA) almost 5 years ago

  • Status changed from Open to Assigned
  • Assignee set to usa (Usaku NAKAMURA)

maybe next release.

#7 Updated by usa (Usaku NAKAMURA) almost 5 years ago

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

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

#8 [ruby-core:51432] Updated by mpapis (Michal Papis) almost 5 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 [ruby-core:51478] Updated by mpapis (Michal Papis) almost 5 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 [ruby-core:51733] Updated by nobu (Nobuyoshi Nakada) almost 5 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 [ruby-core:51782] Updated by mpapis (Michal Papis) almost 5 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 [ruby-core:52469] Updated by mame (Yusuke Endoh) almost 5 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 [ruby-core:52506] Updated by nobu (Nobuyoshi Nakada) almost 5 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