diff --git a/ChangeLog b/ChangeLog index 331e261a9f..e13433f774 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sun Mar 3 12:17:47 2013 Nobuyoshi Nakada + + * 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 * ext/socket/tcpserver.c: Grammar for TCPServer.new from r39554 diff --git a/lib/rubygems/ext/ext_conf_builder.rb b/lib/rubygems/ext/ext_conf_builder.rb index 67f1e08a8c..7babf409a0 100644 --- a/lib/rubygems/ext/ext_conf_builder.rb +++ b/lib/rubygems/ext/ext_conf_builder.rb @@ -18,6 +18,9 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder 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 diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb index acbc0447df..fcbe081593 100644 --- a/test/rubygems/test_gem_installer.rb +++ b/test/rubygems/test_gem_installer.rb @@ -1038,9 +1038,6 @@ gem 'other', version 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 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'