From fe76de905f07c8a5e9322cca4563e7a45aa742d6 Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Mon, 28 Oct 2024 23:27:53 +0100 Subject: [PATCH] Remove cached gems --- .gitlab/install_datadog_deps.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitlab/install_datadog_deps.rb b/.gitlab/install_datadog_deps.rb index 1f9b254f163..2d13bda8242 100755 --- a/.gitlab/install_datadog_deps.rb +++ b/.gitlab/install_datadog_deps.rb @@ -114,6 +114,15 @@ raise "Missing #{libdatadog_so_file} in #{datadog_gem_path}." end +cached_gems = Dir.glob(versioned_path.join("cache/*.gem")) + +FileUtils.rm_r( + [ + *cached_gems, + ], + verbose: true +) + FileUtils.cd(versioned_path.join("extensions/#{Gem::Platform.local}"), verbose: true) do # Symlink those directories to be utilized by Ruby compiled with shared libraries FileUtils.ln_sf Gem.extension_api_version, ruby_api_version