Bug #7897

rubygems 2.0 has an incompatibility about installation of extension libraries if gem package does not contain lib directory

Added by Kenta Murata about 1 year ago. Updated about 1 year ago.

[ruby-core:52614]
Status:Closed
Priority:Urgent
Assignee:Eric Hodel
Category:lib
Target version:2.0.0
ruby -v:ruby 2.0.0dev (2013-02-08 trunk 39161) [x86_64-darwin11.4.2] Backport:

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.


Related issues

Related to Backport200 - Backport #7909: Backport r39366 - Create extension install directory befo... Closed 02/22/2013

Associated revisions

Revision 39366
Added by Eric Hodel about 1 year ago

  • lib/rubygems/installer.rb (build_extensions): Create extension install destination before building extension. Patch by Kenta Murata. [ruby-trunk - Bug #7897]
  • test/rubygems/testgeminstaller.rb: Test for the above.

History

#1 Updated by Kenta Murata about 1 year 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.mkdirp(destpath) results = builder.build(extension, gemdir, destpath, results, @build_args)

#2 Updated by Kenta Murata about 1 year 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.mkdirp(destpath) results = builder.build(extension, gemdir, destpath, results, @build_args)

#3 Updated by Vit Ondruch about 1 year 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

#4 Updated by Eric Hodel about 1 year 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/testgeminstaller.rb: Test for the above.

#5 Updated by Eric Hodel about 1 year 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.

#6 Updated by Eric Hodel about 1 year ago

  • Status changed from Closed to Assigned
  • Assignee changed from Eric Hodel to Nobuyoshi Nakada
  • % Done changed from 100 to 50

#7 Updated by Nobuyoshi Nakada about 1 year ago

It caused by r38864, which removes timestamp files in dependency rules.
Now mkmf uses those files to fix parallel make issues.

#8 Updated by Eric Hodel about 1 year ago

  • Status changed from Assigned to Closed
  • Assignee changed from Nobuyoshi Nakada to 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!

Also available in: Atom PDF