From 2dd267f0e49a91b9e22cc24b1b14b9f9e4c65080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Thu, 25 Feb 2021 17:06:01 +0100 Subject: [PATCH] Revert "Remove spec file before building" This reverts commit af604436d8141c34cb2e1e645b9b0d47bfd55a55. The issue that led to introducing it was never reproduced. I tried to repro with this patch and it still works just fine. Since this removal is getting in the middle for some race conditions I'm facing, I'm reverting the patch. --- lib/rubygems/installer.rb | 2 -- test/rubygems/test_gem_installer.rb | 3 --- 2 files changed, 5 deletions(-) diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb index 10341a9398c8..38642ee8ef41 100644 --- a/lib/rubygems/installer.rb +++ b/lib/rubygems/installer.rb @@ -293,8 +293,6 @@ def spec def install pre_install_checks - FileUtils.rm_f File.join gem_home, 'specifications', spec.spec_name - run_pre_install_hooks # Set loaded_from to ensure extension_dir is correct diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb index 77652909c176..8874577aa8ad 100644 --- a/test/rubygems/test_gem_installer.rb +++ b/test/rubygems/test_gem_installer.rb @@ -948,7 +948,6 @@ def test_install Gem.pre_install do assert_path_not_exist cache_file, 'cache file must not exist yet' - assert_path_not_exist spec_file, 'spec file must not exist yet' true end @@ -956,13 +955,11 @@ def test_install assert_path_exist gemdir, 'gem install dir must exist' assert_path_exist rakefile, 'gem executable must exist' assert_path_not_exist stub_exe, 'gem executable must not exist' - assert_path_not_exist spec_file, 'spec file must not exist yet' true end Gem.post_install do assert_path_exist cache_file, 'cache file must exist' - assert_path_exist spec_file, 'spec file must exist' end @newspec = nil