Bug #7860
closedPassing --libdir to ./configure causes Gem.ruby to point to an incorrect ruby interpreter path
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/x86_64-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/x86_64-linux")
DESTDIR = '' unless defined? DESTDIR
CONFIG = {}
CONFIG["DESTDIR"] = DESTDIR
@@ -35,7 +35,7 @@
CONFIG["rubyhdrdir"] = "$(includedir)/$(RUBY_VERSION_NAME)"
CONFIG["UNIVERSAL_INTS"] = ""
CONFIG["UNIVERSAL_ARCHNAMES"] = ""
- CONFIG["configure_args"] = ""
+ CONFIG["configure_args"] = " '--libdir=/usr/local/lib64'"
CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
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
Updated by nobu (Nobuyoshi Nakada) over 11 years 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. [ruby-core:52296] [Bug #7860]
Updated by nobu (Nobuyoshi Nakada) over 11 years ago
- Category set to build
- Status changed from Closed to Assigned
- Assignee set to mame (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.
Updated by nobu (Nobuyoshi Nakada) over 11 years ago
And r39284,r39297.
Updated by nobu (Nobuyoshi Nakada) over 11 years ago
Sorry, patches for tool/mkconfig.rb are not necessary as long as libdir is under exec_prefix.
And the case libdir is outside exec_prefix is not supported in trunk.
TMP_RUBY_PREFIX would be needed to fix it.
Updated by mame (Yusuke Endoh) over 11 years ago
- Assignee changed from mame (Yusuke Endoh) to nobu (Nobuyoshi Nakada)
Too many! Are they all essential?
Could you please show me one minimum and clean patch?
--
Yusuke Endoh mame@tsg.ne.jp
Updated by nobu (Nobuyoshi Nakada) over 11 years 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.
Updated by mame (Yusuke Endoh) over 11 years 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 ruby_2_0_0 branch and make sure that your issue(s) is really fixed?
--
Yusuke Endoh mame@tsg.ne.jp
Updated by drbrain (Eric Hodel) over 11 years ago
I don't know enough about autoconf to understand the fix.
I don't believe it will cause any problems with RubyGems though.
Updated by jonforums (Jon Forums) over 11 years ago
Chris White, Jon Forums,
Can you check the current ruby_2_0_0 branch and make sure that your issue(s) is really fixed?
mame-san...ruby_2_0_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
Updated by mame (Yusuke Endoh) over 11 years 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
Updated by mame (Yusuke Endoh) over 11 years 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
Updated by nobu (Nobuyoshi Nakada) almost 3 years ago
- Description updated (diff)
Updated by nobu (Nobuyoshi Nakada) almost 3 years ago
- Related to Bug #18373: Bundled gem (RBS, debug) extensions are not properly built added