Bug #7897
closedrubygems 2.0 has an incompatibility about installation of extension libraries if gem package does not contain lib directory
Description
Hi,
rubygems 2.0 has an incompatibility about installation of extension libraries.
If a gem package does not contain lib directory,
an extension library file is copied as a file named "lib".
You can reproduce this problem by installing msgpack version 0.4.7.
Updated by mrkn (Kenta Murata) over 11 years ago
The following patch fixes this problem.
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
index 0865a6d..b8a6d2b 100644
--- a/lib/rubygems/installer.rb
+++ b/lib/rubygems/installer.rb
@@ -672,6 +672,7 @@ TEXT
begin
Dir.chdir extension_dir do
-
FileUtils.mkdir_p(dest_path) results = builder.build(extension, gem_dir, dest_path, results, @build_args)
Updated by mrkn (Kenta Murata) over 11 years ago
I'm sorry, the previous patch is wrong.
The following is right.
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
index 0865a6d..e5a5e0e 100644
--- a/lib/rubygems/installer.rb
+++ b/lib/rubygems/installer.rb
@@ -4,6 +4,7 @@
See LICENSE.txt for permissions.¶
#++
+require 'fileutils'
require 'rubygems/exceptions'
require 'rubygems/package'
require 'rubygems/ext'
@@ -672,6 +673,7 @@ TEXT
begin
Dir.chdir extension_dir do
-
FileUtils.mkdir_p(dest_path) results = builder.build(extension, gem_dir, dest_path, results, @build_args)
Updated by vo.x (Vit Ondruch) over 11 years ago
I guess this regression was introduced in r37016 by dropping this line [1] in mkmf. Not sure what was the intention, since creating directory seems unrelated to the timestamp dependencies IMO
[1] https://github.com/ruby/ruby/commit/ba3d6005837aab1815131512ca4918f17ee12d07#L1L2135
Updated by drbrain (Eric Hodel) over 11 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r39366.
Kenta, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- lib/rubygems/installer.rb (build_extensions): Create extension
install destination before building extension. Patch by Kenta Murata.
[ruby-trunk - Bug #7897] - test/rubygems/test_gem_installer.rb: Test for the above.
Updated by drbrain (Eric Hodel) over 11 years ago
As Vit Ondruch has noted, it seems to be a bug in the Makefile generated by mkmf.rb as ruby 1.9.3 without Murata-san's patch correctly installs lib/msgpack.bundle.
Nobu, can you check it?
Just to be safe, I committed Murata-san's patch and will open a backport request.
Updated by drbrain (Eric Hodel) over 11 years ago
- Status changed from Closed to Assigned
- Assignee changed from drbrain (Eric Hodel) to nobu (Nobuyoshi Nakada)
- % Done changed from 100 to 50
Updated by nobu (Nobuyoshi Nakada) over 11 years ago
It caused by r38864, which removes timestamp files in dependency rules.
Now mkmf uses those files to fix parallel make issues.
Updated by drbrain (Eric Hodel) over 11 years ago
- Status changed from Assigned to Closed
- Assignee changed from nobu (Nobuyoshi Nakada) to drbrain (Eric Hodel)
- % Done changed from 50 to 100
Then RubyGems breaks mkmf.rb's Makefile and Murata-san's patch fixes it.
Thank you for checking!