Bug #7860

Passing --libdir to ./configure causes Gem.ruby to point to an incorrect ruby interpreter path

Added by Chris White about 1 year ago. Updated about 1 year ago.

[ruby-core:52296]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
Category:build
Target version:2.0.0
ruby -v:ruby 2.0.0dev (2013-02-16 trunk 39262) [x86_64-linux] Backport:

Description

How I reproduce:


git clone git://github.com/ruby/ruby.git

autoreconf

./configure --libdir=/usr/local/lib64

make clean && make && make install

/usr/local/bin/ruby -e 'puts Gem.ruby'

/bin/ruby

The problem is how topdir is set with tool/mkconfig.rb. This is a diff between ./configure and ./configure --libdir=/usr/local/lib64:


--- /root/rbconfig.rb 2013-02-15 15:20:15.016942074 -0800
+++ /usr/local/lib64/ruby/2.0.0/x8664-linux/rbconfig.rb 2013-02-15 15:14:20.500932606 -0800
@@ -6,7 +6,7 @@
RUBY
VERSION == "2.0.0" or
raise "ruby lib version (2.0.0) doesn't match executable version (#{RUBY_VERSION})"

  • TOPDIR = File.dirname(FILE).chomp!("/lib/ruby/2.0.0/x86_64-linux")
  • TOPDIR = File.dirname(FILE).chomp!("/usr/local/lib64/ruby/2.0.0/x8664-linux") DESTDIR = '' unless defined? DESTDIR CONFIG = {} CONFIG["DESTDIR"] = DESTDIR @@ -35,7 +35,7 @@ CONFIG["rubyhdrdir"] = "$(includedir)/$(RUBYVERSIONNAME)" CONFIG["UNIVERSALINTS"] = "" CONFIG["UNIVERSAL_ARCHNAMES"] = ""
  • CONFIG["configure_args"] = ""
  • CONFIG["configureargs"] = " '--libdir=/usr/local/lib64'" CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)" CONFIG["vendorlibdir"] = "$(vendordir)/$(rubyversion)" CONFIG["vendordir"] = "$(rubylibprefix)/vendor_ruby" @@ -199,7 +199,7 @@ CONFIG["DEFS"] = "" CONFIG["mandir"] = "$(datarootdir)/man" CONFIG["localedir"] = "$(datarootdir)/locale"
  • CONFIG["libdir"] = "$(exec_prefix)/lib"
  • CONFIG["libdir"] = "$(DESTDIR)/usr/local/lib64" CONFIG["psdir"] = "$(docdir)" CONFIG["pdfdir"] = "$(docdir)" CONFIG["dvidir"] = "$(docdir)" ------------------------------------------------------------------------------------------

Notice how topdir changes. I think this might have been caused by the tool/mkconfig.rb changes here:

https://github.com/ruby/ruby/commit/29c214e4a058fc4017ab0c0bf5c36b5bad203b5b


Related issues

Related to ruby-trunk - Bug #7871: exec_prefix regression breaks mingw Closed 02/17/2013

Associated revisions

Revision 39267
Added by Nobuyoshi Nakada about 1 year ago

configure.in: unexpand exec_prefix etc

  • configure.in: unexpand arch sitearch and exec_prefix values, so directly specified bindir, libdir, rubyprefix, etc can be properly substituted. [Bug #7860]

Revision 39273
Added by Nobuyoshi Nakada about 1 year ago

configure.in: don't substitute exec_prefix itself

  • configure.in (shvartocpp): do not substitute execprefix itself with RUBYEXEC_PREFIX, which cause recursive definition. [Bug #7860]

History

#1 Updated by Nobuyoshi Nakada about 1 year ago

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

This issue was solved with changeset r39267.
Chris, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


configure.in: unexpand exec_prefix etc

  • configure.in: unexpand arch sitearch and exec_prefix values, so directly specified bindir, libdir, rubyprefix, etc can be properly substituted. [Bug #7860]

#2 Updated by Nobuyoshi Nakada about 1 year ago

  • Category set to build
  • Status changed from Closed to Assigned
  • Assignee set to Yusuke Endoh
  • Target version set to 2.0.0

I think this will be necessary for 2.0.0.
revisions are r39267,39273,39294,39298,39313.

#4 Updated by Nobuyoshi Nakada about 1 year ago

Sorry, patches for tool/mkconfig.rb are not necessary as long as libdir is under exec_prefix.

And the case libdir is outside execprefix is not supported in trunk.
TMP
RUBY_PREFIX would be needed to fix it.

#5 Updated by Yusuke Endoh about 1 year ago

  • Assignee changed from Yusuke Endoh to Nobuyoshi Nakada

Too many! Are they all essential?
Could you please show me one minimum and clean patch?

Yusuke Endoh mame@tsg.ne.jp

#6 Updated by Nobuyoshi Nakada about 1 year ago

The former 4 commits are needed, and the last is fix of commit miss in Changelog.

And, I've backported them for [Bug #7871].
Please revert it if wrong.

#7 Updated by Yusuke Endoh about 1 year ago

Please revert it if wrong.

Please don't try to get retrospective approval ;-(

r39320 seems very subtle (actually it caused cascading fixes on trunk).
I'm afraid if it affects other platforms.

Eric Hodel,
Do you understand the fix? It is related to rubygems (according to this ticket).

Chris White, Jon Forums,
Can you check the current ruby20_0 branch and make sure that your issue(s) is really fixed?

Yusuke Endoh mame@tsg.ne.jp

#8 Updated by Eric Hodel about 1 year ago

I don't know enough about autoconf to understand the fix.

I don't believe it will cause any problems with RubyGems though.

#9 Updated by Jon Forums about 1 year ago

Chris White, Jon Forums,
Can you check the current ruby20_0 branch and make sure that your issue(s) is really fixed?

mame-san...ruby20_0@39344 solves these recent issues on my x86_64-linux (ubuntu server 12.10) machine. I will build i686-linux later tonight and report back if any errors.

  • exec_prefix regression
  • gem {install,update} --user-install errors

#10 Updated by Yusuke Endoh about 1 year ago

Oops, this caused #7915...
I'm now keen to revert the bunch of patches. What do you think?

Yusuke Endoh mame@tsg.ne.jp

#11 Updated by Yusuke Endoh about 1 year ago

  • Status changed from Assigned to Closed

I talked with nobu, and he said he could not reproduce #7915.
I decided to leave the backport as is. Sorry if my decision is wrong...

I'm closing this ticket.

Yusuke Endoh mame@tsg.ne.jp

Also available in: Atom PDF