diff --git a/.github/workflows/zjit-macos.yml b/.github/workflows/zjit-macos.yml index f9282d64e84b0a..e68bd897fd55d2 100644 --- a/.github/workflows/zjit-macos.yml +++ b/.github/workflows/zjit-macos.yml @@ -93,7 +93,7 @@ jobs: rustup install ${{ matrix.rust_version }} --profile minimal rustup default ${{ matrix.rust_version }} - - uses: taiki-e/install-action@13608cbb45b01feb47ef444ab1a42dc41ad56f1a # v2.79.11 + - uses: taiki-e/install-action@e49978b799e49ff429d162b7a30601a569ab6538 # v2.81.1 with: tool: nextest@0.9 if: ${{ matrix.test_task == 'zjit-check' }} diff --git a/.github/workflows/zjit-ubuntu.yml b/.github/workflows/zjit-ubuntu.yml index 1e7bec38599911..8d146b7bdc8cf5 100644 --- a/.github/workflows/zjit-ubuntu.yml +++ b/.github/workflows/zjit-ubuntu.yml @@ -119,7 +119,7 @@ jobs: ruby-version: '3.1' bundler: none - - uses: taiki-e/install-action@13608cbb45b01feb47ef444ab1a42dc41ad56f1a # v2.79.11 + - uses: taiki-e/install-action@e49978b799e49ff429d162b7a30601a569ab6538 # v2.81.1 with: tool: nextest@0.9 if: ${{ matrix.test_task == 'zjit-check' }} diff --git a/gc/gc.h b/gc/gc.h index ea8056c6716f08..d147a3122a853a 100644 --- a/gc/gc.h +++ b/gc/gc.h @@ -219,12 +219,14 @@ hash_foreach_replace(st_data_t key, st_data_t value, st_data_t argp, int error) static int hash_replace_ref(st_data_t *key, st_data_t *value, st_data_t argp, int existing) { - if (rb_gc_location((VALUE)*key) != (VALUE)*key) { - *key = rb_gc_location((VALUE)*key); + VALUE new_key = rb_gc_location((VALUE)*key); + if (new_key != (VALUE)*key) { + *key = new_key; } - if (rb_gc_location((VALUE)*value) != (VALUE)*value) { - *value = rb_gc_location((VALUE)*value); + VALUE new_value = rb_gc_location((VALUE)*value); + if (new_value != (VALUE)*value) { + *value = new_value; } return ST_CONTINUE; diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb index 19718829fccbdd..d5e9eb4e33aec6 100644 --- a/lib/rubygems/config_file.rb +++ b/lib/rubygems/config_file.rb @@ -26,9 +26,22 @@ # RubyGems options use symbol keys. Valid options are: # # +:backtrace+:: See #backtrace -# +:sources+:: Sets Gem::sources +# +:bulk_threshold+:: See #bulk_threshold # +:verbose+:: See #verbose +# +:update_sources+:: See #update_sources # +:concurrent_downloads+:: See #concurrent_downloads +# +:cert_expiration_length_days+:: See #cert_expiration_length_days +# +:install_extension_in_lib+:: See #install_extension_in_lib +# +:ipv4_fallback_enabled+:: See #ipv4_fallback_enabled +# +:global_gem_cache+:: See #global_gem_cache +# +:use_psych+:: See #use_psych +# +:gemhome+:: See #home +# +:gempath+:: See #path +# +:sources+:: Sets Gem::sources +# +:disable_default_gem_server+:: See #disable_default_gem_server +# +:ssl_verify_mode+:: See #ssl_verify_mode +# +:ssl_ca_cert+:: See #ssl_ca_cert +# +:ssl_client_cert+:: See #ssl_client_cert # # gemrc files may exist in various locations and are read and merged in # the following order: diff --git a/test/rubygems/test_gem_config_file.rb b/test/rubygems/test_gem_config_file.rb index e85d00530e3089..3c79cb0762d783 100644 --- a/test/rubygems/test_gem_config_file.rb +++ b/test/rubygems/test_gem_config_file.rb @@ -53,6 +53,7 @@ def test_initialize fp.puts ":sources:" fp.puts " - http://more-gems.example.com" fp.puts "install: --wrappers" + fp.puts ":gemhome: /tmp/gems" fp.puts ":gempath:" fp.puts "- /usr/ruby/1.8/lib/ruby/gems/1.8" fp.puts "- /var/ruby/1.8/gem_home" @@ -61,6 +62,7 @@ def test_initialize fp.puts ":cert_expiration_length_days: 28" fp.puts ":install_extension_in_lib: false" fp.puts ":ipv4_fallback_enabled: true" + fp.puts ":use_psych: true" end util_config_file @@ -70,6 +72,7 @@ def test_initialize assert_equal false, @cfg.update_sources assert_equal %w[http://more-gems.example.com], @cfg.sources assert_equal "--wrappers", @cfg[:install] + assert_equal "/tmp/gems", @cfg.home assert_equal(["/usr/ruby/1.8/lib/ruby/gems/1.8", "/var/ruby/1.8/gem_home"], @cfg.path) assert_equal 0, @cfg.ssl_verify_mode @@ -77,6 +80,7 @@ def test_initialize assert_equal 28, @cfg.cert_expiration_length_days assert_equal false, @cfg.install_extension_in_lib assert_equal true, @cfg.ipv4_fallback_enabled + assert_equal true, @cfg.use_psych end def test_initialize_ipv4_fallback_enabled_env @@ -105,7 +109,7 @@ def test_initialize_global_gem_cache_env def test_initialize_global_gem_cache_gemrc File.open @temp_conf, "w" do |fp| - fp.puts "global_gem_cache: true" + fp.puts ":global_gem_cache: true" end util_config_file %W[--config-file #{@temp_conf}] @@ -113,9 +117,19 @@ def test_initialize_global_gem_cache_gemrc assert_equal true, @cfg.global_gem_cache end + def test_initialize_use_psych_env + orig_use_psych = ENV["RUBYGEMS_USE_PSYCH"] + ENV["RUBYGEMS_USE_PSYCH"] = "true" + util_config_file %W[--config-file #{@temp_conf}] + + assert_equal true, @cfg.use_psych + ensure + ENV["RUBYGEMS_USE_PSYCH"] = orig_use_psych + end + def test_initialize_concurrent_downloads File.open @temp_conf, "w" do |fp| - fp.puts "concurrent_downloads: 2" + fp.puts ":concurrent_downloads: 2" end util_config_file %W[--config-file #{@temp_conf}]