summaryrefslogtreecommitdiff
path: root/lib/rubygems/ext
diff options
context:
space:
mode:
authorEloy Espinaco <[email protected]>2022-11-29 23:40:02 -0300
committerHiroshi SHIBATA <[email protected]>2022-12-20 13:15:02 +0900
commit0a9544ce4ab86963dde0f3ad0b489b6a354cc8b3 ()
tree11f3504747a04d473ae0a77cc66ddc83922145eb /lib/rubygems/ext
parent9d10b8393e6692d076d79d3b80c6eefb40a65b44 (diff)
[rubygems/rubygems] Cleanup intermediate artifacts after installing built extensions
https://.com/rubygems/rubygems/commit/98b6a959bd
Notes: Merged: https://.com/ruby/ruby/pull/6966
-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
@@ -17,7 +17,7 @@ class Gem::Ext::Builder
$1.downcase
end
- def self.make(dest_path, results, make_dir = Dir.pwd, sitedir = nil)
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|
# Pass DESTDIR via command line to override what's in MAKEFLAGS
cmd = [
*make_program,
@@ -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
ensure
ENV["DESTDIR"] = destdir
end