From ef5af32799b04da61bbd1bdaf464012a755c4936 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Mon, 4 Mar 2024 14:15:10 +0900 Subject: [rubygems/rubygems] Clear `RUBY_CODESIGN` env var while running tests The `RUBY_CODESIGN` environment variable is used by mkmf-generated Makefile to sign extension bundles on macOS. The variable specifies a key identifier to use for signing given by the user. However, the key is usually stored in `$HOME/Library/Keychains` directory, and the test suite creates a fake `$HOME` directory. This causes the test suite to try to find the specified key from the fake home directory, which results in a failure. https://github.com/rubygems/rubygems/commit/ddcfc65bf7 --- spec/bundler/support/rubygems_ext.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'spec') diff --git a/spec/bundler/support/rubygems_ext.rb b/spec/bundler/support/rubygems_ext.rb index 0d1ad2d528..889ebc90c3 100644 --- a/spec/bundler/support/rubygems_ext.rb +++ b/spec/bundler/support/rubygems_ext.rb @@ -38,6 +38,10 @@ module Spec FileUtils.mkdir_p(Path.tmpdir) ENV["HOME"] = Path.home.to_s + # Remove "RUBY_CODESIGN", which is used by mkmf-generated Makefile to + # sign extension bundles on macOS, to avoid trying to find the specified key + # from the fake $HOME/Library/Keychains directory. + ENV.delete "RUBY_CODESIGN" ENV["TMPDIR"] = Path.tmpdir.to_s require "rubygems/user_interaction" -- cgit v1.2.3