summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-31 08:39:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-31 08:39:23 +0000
commit7f7aa9d4429256900793bceaef605279ab5e8ccb (patch)
tree1310411a36f1e39d3a4af11a681bef7cd76b5b21
parent1b6a42d968ab4586b51cd1c1e114b46a9f788b94 (diff)
extmk.rb: build_complete
* ext/extmk.rb (create_makefile): make gem.build_complete file under TARGET_SO_DIR and install it only when the gem build succeeded. [ruby-core:77057] [Bug #12681] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rwxr-xr-xext/extmk.rb18
-rwxr-xr-xtool/rbinstall.rb1
3 files changed, 24 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9747d4fcfbf..97bb7363d34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Aug 31 17:39:19 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/extmk.rb (create_makefile): make gem.build_complete file
+ under TARGET_SO_DIR and install it only when the gem build
+ succeeded. [ruby-core:77057] [Bug #12681]
+
Wed Aug 31 15:36:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb: move TARGET_SO_DIR stuffs to mkmf.rb.
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 1b86ff0d718..97533219ee1 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -568,6 +568,24 @@ Dir.chdir('..')
FileUtils::makedirs('gems')
Dir.chdir('gems')
extout = $extout
+unless gems.empty?
+ def self.create_makefile(*args, &block)
+ if super(*args, &block)
+ open("Makefile", "a") do |mf|
+ mf << %{
+
+build_complete = $(TARGET_SO_DIR)gem.build_complete
+install-so: build_complete
+build_complete: $(build_complete)
+$(build_complete): $(TARGET_SO)
+ $(Q) $(TOUCH) $@
+
+}
+ end
+ true
+ end
+ end
+end
gems.each do |d|
$extout = extout.dup
$sodir = "$(extout)/gems/$(arch)/#{d[%r{\A[^/]+}]}"
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index 83e5c7e020f..5cab72fd2bc 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -766,7 +766,6 @@ install?(:ext, :comm, :gem) do
File.chmod($data_mode, File.join(install_dir, "specifications", "#{spec.full_name}.gemspec"))
unless spec.extensions.empty?
install_recursive(ext, spec.extension_dir)
- open_for_install(spec.gem_build_complete_path, $data_mode) {""}
end
installed_gems[spec.full_name] = true
end