Project

General

Profile

Actions

Bug #7172

closed

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

Added by mpapis (Michal Papis) over 11 years ago. Updated about 11 years ago.

Status:
Closed
Target version:
ruby -v:
2.0.0dev
Backport:
[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 2 (0 open2 closed)

Related to Ruby master - Bug #6903: [[Ruby 1.9:]] --enable-load-relative broken on systems with /lib64Closed08/22/2012Actions
Related to Backport193 - Backport #7115: [[Ruby 1.9:]] fix rbconfig for --enable-load-relativeClosedusa (Usaku NAKAMURA)10/08/2012Actions

Updated by wycats (Yehuda Katz) over 11 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) wrote:

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:

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/

Updated by usa (Usaku NAKAMURA) over 11 years ago

  • Status changed from Open to Closed

Already backport at r37155.

Updated by mpapis (Michal Papis) over 11 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.

Updated by usa (Usaku NAKAMURA) over 11 years ago

  • Status changed from Closed to Open

Oh, sorry, I've mistaken.

Updated by mpapis (Michal Papis) over 11 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 :(

Updated by usa (Usaku NAKAMURA) over 11 years ago

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

maybe next release.

Actions #7

Updated by usa (Usaku NAKAMURA) over 11 years ago

  • Tracker changed from Backport to Bug
  • Project changed from Backport193 to Ruby master
  • 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?

Updated by mpapis (Michal Papis) over 11 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.

Updated by mpapis (Michal Papis) over 11 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)

Updated by nobu (Nobuyoshi Nakada) about 11 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?

Updated by mpapis (Michal Papis) about 11 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.

Updated by mame (Yusuke Endoh) about 11 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

Updated by nobu (Nobuyoshi Nakada) about 11 years ago

  • Status changed from Feedback to Closed

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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0