[前][次][番号順一覧][スレッド一覧]

ruby-changes:27520

From: nobu <ko1@a...>
Date: Sun, 3 Mar 2013 12:18:02 +0900 (JST)
Subject: [ruby-changes:27520] nobu:r39572 (trunk): ext_conf_builder.rb: remove circular dependency in install-so

nobu	2013-03-03 12:17:50 +0900 (Sun, 03 Mar 2013)

  New Revision: 39572

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39572

  Log:
    ext_conf_builder.rb: remove circular dependency in install-so
    
    * lib/rubygems/ext/ext_conf_builder.rb
      (Gem::Ext::ExtConfBuilder.hack_for_obsolete_style_gems): remove
      circular dependencies in install-so too.  [ruby-core:52882]
      [Bug #7698]

  Modified files:
    trunk/ChangeLog
    trunk/lib/rubygems/ext/ext_conf_builder.rb
    trunk/test/rubygems/test_gem_installer.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39571)
+++ ChangeLog	(revision 39572)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Mar  3 12:17:47 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/rubygems/ext/ext_conf_builder.rb
+	  (Gem::Ext::ExtConfBuilder.hack_for_obsolete_style_gems): remove
+	  circular dependencies in install-so too.  [ruby-core:52882]
+	  [Bug #7698]
+
 Sun Mar  3 07:33:00 2013  Zachary Scott  <zachary@z...>
 
 	* ext/socket/tcpserver.c: Grammar for TCPServer.new from r39554
Index: lib/rubygems/ext/ext_conf_builder.rb
===================================================================
--- lib/rubygems/ext/ext_conf_builder.rb	(revision 39571)
+++ lib/rubygems/ext/ext_conf_builder.rb	(revision 39572)
@@ -18,6 +18,9 @@ class Gem::Ext::ExtConfBuilder < Gem::Ex https://github.com/ruby/ruby/blob/trunk/lib/rubygems/ext/ext_conf_builder.rb#L18
     changed |= mf.gsub!(/^(install-rb-default:)(.*)/) {
       "#$1#{$2.gsub(/(?:^|\s+)\$\(RUBY(?:ARCH|LIB)DIR\)\/\S+(?=\s|$)/, '')}"
     }
+    changed |= mf.gsub!(/^(install-so:.*DLLIB.*\n)((?:\t.*\n)+)/) {
+      "#$1#{$2.gsub(/.*INSTALL.*DLLIB.*\n/, '')}"
+    }
     if changed
       File.open('Makefile', 'wb') {|f| f.print mf}
     end
Index: test/rubygems/test_gem_installer.rb
===================================================================
--- test/rubygems/test_gem_installer.rb	(revision 39571)
+++ test/rubygems/test_gem_installer.rb	(revision 39572)
@@ -1038,9 +1038,6 @@ gem 'other', version https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L1038
       RUBY
     end
 
-    # make sure timestamp file will become newer than the script file.
-    sleep 2
-
     assert !File.exist?(File.join(@spec.gem_dir, rb))
     use_ui @ui do
       path = Gem::Package.build @spec
@@ -1051,6 +1048,38 @@ gem 'other', version https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L1048
     assert File.exist?(File.join(@spec.gem_dir, rb))
   end
 
+  def test_install_extension_flat
+    @spec.require_paths = ["."]
+
+    @spec.extensions << "extconf.rb"
+
+    write_file File.join(@tempdir, "extconf.rb") do |io|
+      io.write <<-RUBY
+        require "mkmf"
+
+        CONFIG['CC'] = '$(TOUCH) $@ ||'
+        CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
+
+        create_makefile("#{@spec.name}")
+      RUBY
+    end
+
+    # empty depend file for no auto dependencies
+    @spec.files += %W"depend #{@spec.name}.c".each {|file|
+      write_file File.join(@tempdir, file)
+    }
+
+    so = File.join(@spec.gem_dir, "#{@spec.name}.#{RbConfig::CONFIG["DLEXT"]}")
+    assert !File.exist?(so)
+    use_ui @ui do
+      path = Gem::Package.build @spec
+
+      @installer = Gem::Installer.new path
+      @installer.install
+    end
+    assert File.exist?(so)
+  end
+
   def test_installation_satisfies_dependency_eh
     quick_spec 'a'
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]