summaryrefslogtreecommitdiff
path: root/lib/rubygems
diff options
context:
space:
mode:
authorEloy Espinaco <eloyesp@gmail.com>2022-11-29 23:40:02 -0300
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-12-20 13:15:02 +0900
commit0a9544ce4ab86963dde0f3ad0b489b6a354cc8b3 (patch)
tree11f3504747a04d473ae0a77cc66ddc83922145eb /lib/rubygems
parent9d10b8393e6692d076d79d3b80c6eefb40a65b44 (diff)
[rubygems/rubygems] Cleanup intermediate artifacts after installing built extensions
https://github.com/rubygems/rubygems/commit/98b6a959bd
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6966
Diffstat (limited to 'lib/rubygems')
-rw-r--r--lib/rubygems/ext/builder.rb4
-rw-r--r--lib/rubygems/ext/ext_conf_builder.rb2
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb
index b46f9b5cd5..98d354183c 100644
--- a/lib/rubygems/ext/builder.rb
+++ b/lib/rubygems/ext/builder.rb
@@ -17,7 +17,7 @@ class Gem::Ext::Builder
$1.downcase
end
- def self.make(dest_path, results, make_dir = Dir.pwd, sitedir = nil)
+ def self.make(dest_path, results, make_dir = Dir.pwd, sitedir = nil, targets = ["clean", "", "install"])
unless File.exist? File.join(make_dir, "Makefile")
raise Gem::InstallError, "Makefile not found"
end
@@ -40,7 +40,7 @@ class Gem::Ext::Builder
env << "sitelibdir=%s" % sitedir
end
- ["clean", "", "install"].each do |target|
+ targets.each do |target|
# Pass DESTDIR via command line to override what's in MAKEFLAGS
cmd = [
*make_program,
diff --git a/lib/rubygems/ext/ext_conf_builder.rb b/lib/rubygems/ext/ext_conf_builder.rb
index ebe398f56c..27ebd8c62b 100644
--- a/lib/rubygems/ext/ext_conf_builder.rb
+++ b/lib/rubygems/ext/ext_conf_builder.rb
@@ -55,6 +55,8 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
destent = ent.class.new(dest_path, ent.rel)
destent.exist? || FileUtils.mv(ent.path, destent.path)
end
+
+ make dest_path, results, extension_dir, tmp_dest_relative, ["clean"]
ensure
ENV["DESTDIR"] = destdir
end