Permalink
Browse files

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]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 2a5b45d commit a7a0b3ad52e264d08e1b26a6bad9b9bba2a99c1b @nobu nobu committed Mar 3, 2013
Showing with 42 additions and 3 deletions.
  1. +7 −0 ChangeLog
  2. +3 −0 lib/rubygems/ext/ext_conf_builder.rb
  3. +32 −3 test/rubygems/test_gem_installer.rb
View
@@ -1,3 +1,10 @@
+Sun Mar 3 12:17:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@zacharyscott.net>
* ext/socket/tcpserver.c: Grammar for TCPServer.new from r39554
@@ -18,6 +18,9 @@ def self.hack_for_obsolete_style_gems(directory)
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
@@ -1038,9 +1038,6 @@ def test_install_extension_and_script
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 @@ def test_install_extension_and_script
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'

0 comments on commit a7a0b3a

Please sign in to comment.