diff --git a/ext/io/wait/wait.c b/ext/io/wait/wait.c index cf36346cf2f955..f7575191fedf2d 100644 --- a/ext/io/wait/wait.c +++ b/ext/io/wait/wait.c @@ -17,8 +17,6 @@ * IO wait methods are built in ruby now, just for backward compatibility. */ -#include "ruby.h" - void Init_wait(void) { diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index 2631c860a010ba..e1e030ffc8992f 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -8,7 +8,7 @@ class Rubygems < Source autoload :Remote, File.expand_path("rubygems/remote", __dir__) # Ask for X gems per API request - API_REQUEST_SIZE = 50 + API_REQUEST_SIZE = 100 attr_accessor :remotes @@ -211,7 +211,11 @@ def install(spec, options = {}) message += " with native extensions" if spec.extensions.any? Bundler.ui.confirm message - installed_spec = installer.install + installed_spec = nil + + Gem.time("Installed #{spec.name} in", 0, true) do + installed_spec = installer.install + end spec.full_gem_path = installed_spec.full_gem_path spec.loaded_from = installed_spec.loaded_from @@ -478,7 +482,10 @@ def download_gem(spec, download_cache_path, previous_spec = nil) uri = spec.remote.uri Bundler.ui.confirm("Fetching #{version_message(spec, previous_spec)}") gem_remote_fetcher = remote_fetchers.fetch(spec.remote).gem_remote_fetcher - Bundler.rubygems.download_gem(spec, uri, download_cache_path, gem_remote_fetcher) + + Gem.time("Downloaded #{spec.name} in", 0, true) do + Bundler.rubygems.download_gem(spec, uri, download_cache_path, gem_remote_fetcher) + end end # Returns the global cache path of the calling Rubygems::Source object. diff --git a/spec/bundler/bundler/fetcher/dependency_spec.rb b/spec/bundler/bundler/fetcher/dependency_spec.rb index c420b7c07f2022..61e32acfd969ee 100644 --- a/spec/bundler/bundler/fetcher/dependency_spec.rb +++ b/spec/bundler/bundler/fetcher/dependency_spec.rb @@ -212,7 +212,7 @@ let(:dep_api_uri) { double(:dep_api_uri) } let(:unmarshalled_gems) { double(:unmarshalled_gems) } let(:fetch_response) { double(:fetch_response, body: double(:body)) } - let(:rubygems_limit) { 50 } + let(:rubygems_limit) { 100 } before { allow(subject).to receive(:dependency_api_uri).with(gem_names).and_return(dep_api_uri) } diff --git a/spec/bundler/bundler/source/rubygems_spec.rb b/spec/bundler/bundler/source/rubygems_spec.rb index 884fa810465f96..dde4e4ed47693e 100644 --- a/spec/bundler/bundler/source/rubygems_spec.rb +++ b/spec/bundler/bundler/source/rubygems_spec.rb @@ -44,4 +44,22 @@ end end end + + describe "log debug information" do + it "log the time spent downloading and installing a gem" do + build_repo2 do + build_gem "warning" + end + + gemfile_content = <<~G + source "https://gem.repo2" + gem "warning" + G + + stdout = install_gemfile(gemfile_content, env: { "DEBUG" => "1" }) + + expect(stdout).to match(/Downloaded warning in: \d+\.\d+s/) + expect(stdout).to match(/Installed warning in: \d+\.\d+s/) + end + end end diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb index 8506005746a25b..c3d0f281a0c1da 100644 --- a/spec/bundler/commands/install_spec.rb +++ b/spec/bundler/commands/install_spec.rb @@ -118,7 +118,7 @@ it "does not state that it's constantly reinstalling empty gems" do build_repo4 do - build_gem "empty", "1.0.0", no_default: true, allowed_warning: "no files specified" + build_gem "empty", "1.0.0", no_default: true end install_gemfile <<~G diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb index 719a6e65d2626c..12ff09b714a0fb 100644 --- a/spec/bundler/support/helpers.rb +++ b/spec/bundler/support/helpers.rb @@ -192,13 +192,7 @@ def gem_command(command, options = {}) # command is expired too. So give `gem install` commands a bit more time. options[:timeout] = 120 - allowed_warning = options.delete(:allowed_warning) - - output = sys_exec("#{Path.gem_bin} #{command}", options) - stderr = last_command.stderr - - raise stderr if stderr.include?("WARNING") && !allowed_rubygems_warning?(stderr, allowed_warning) - output + sys_exec("#{Path.gem_bin} #{command}", options) end def sys_exec(cmd, options = {}, &block) @@ -537,14 +531,6 @@ def empty_repo4 private - def allowed_rubygems_warning?(text, extra_allowed_warning) - allowed_warnings = ["open-ended", "is a symlink", "rake based", "expected RubyGems version"] - allowed_warnings << extra_allowed_warning if extra_allowed_warning - allowed_warnings.any? do |warning| - text.include?(warning) - end - end - def match_source(contents) match = /source ["']?(?http[^"']+)["']?/.match(contents) return unless match diff --git a/tool/lib/core_assertions.rb b/tool/lib/core_assertions.rb index 5d4c733a73d3be..a9eb9ec3dceb69 100644 --- a/tool/lib/core_assertions.rb +++ b/tool/lib/core_assertions.rb @@ -390,7 +390,8 @@ def assert_separately(args, file = nil, line = nil, src, ignore_stderr: nil, **o # Run Ractor-related test without influencing the main test suite def assert_ractor(src, args: [], require: nil, require_relative: nil, file: nil, line: nil, ignore_stderr: nil, **opt) - return unless defined?(Ractor) + omit unless defined?(Ractor) + omit if windows? # https://bugs.ruby-lang.org/issues/21262 shim_value = "class Ractor; alias value take; end" unless Ractor.method_defined?(:value) diff --git a/tool/test/test_commit_email.rb b/tool/test/test_commit_email.rb index 674275279efd08..ffe28b8e57d28b 100644 --- a/tool/test/test_commit_email.rb +++ b/tool/test/test_commit_email.rb @@ -15,7 +15,7 @@ def setup git('config', 'user.email', 'johan@example.com') env = { 'GIT_AUTHOR_DATE' => '2025-10-08T12:00:00Z', - 'GIT_CONFIG_GLOBAL' => IO::NULL, + 'GIT_CONFIG_GLOBAL' => @ruby + "/gitconfig", 'TZ' => 'UTC', } git('commit', '--allow-empty', '-m', 'New repository initialized by cvs2svn.', env:) diff --git a/zjit.rb b/zjit.rb index 396f52d4b44b20..7cdf84cfbe4328 100644 --- a/zjit.rb +++ b/zjit.rb @@ -192,7 +192,6 @@ def stats_string :dynamic_getivar_count, :dynamic_setivar_count, - :patch_point_count, :compiled_iseq_count, :failed_iseq_count, diff --git a/zjit/src/invariants.rs b/zjit/src/invariants.rs index 2855d7d592abe2..b6f5abe58bcd8e 100644 --- a/zjit/src/invariants.rs +++ b/zjit/src/invariants.rs @@ -2,10 +2,10 @@ use std::{collections::{HashMap, HashSet}, mem}; -use crate::{backend::lir::{Assembler, asm_comment}, cast::IntoU64, cruby::{ID, IseqPtr, RedefinitionFlag, VALUE, iseq_name, rb_callable_method_entry_t, rb_gc_location, ruby_basic_operators, src_loc, with_vm_lock}, hir::Invariant, options::debug, state::{ZJITState, zjit_enabled_p}, stats::{decr_counter_by, incr_counter}, virtualmem::CodePtr}; +use crate::{backend::lir::{Assembler, asm_comment}, cruby::{ID, IseqPtr, RedefinitionFlag, VALUE, iseq_name, rb_callable_method_entry_t, rb_gc_location, ruby_basic_operators, src_loc, with_vm_lock}, hir::Invariant, options::debug, state::{ZJITState, zjit_enabled_p}, virtualmem::CodePtr}; use crate::payload::IseqPayload; use crate::stats::with_time_stat; -use crate::stats::Counter::{invalidation_time_ns, patch_point_count}; +use crate::stats::Counter::invalidation_time_ns; use crate::gc::remove_gc_offsets; macro_rules! compile_patch_points { @@ -37,20 +37,14 @@ struct PatchPoint { } impl PatchPoint { - /// PatchPointer constructor, which also increments `patch_point_count` + /// PatchPointer constructor fn new(patch_point_ptr: CodePtr, side_exit_ptr: CodePtr, payload_ptr: *mut IseqPayload) -> PatchPoint { - incr_counter!(patch_point_count); Self { patch_point_ptr, side_exit_ptr, payload_ptr, } } - - /// Decrease `patch_point_count` by the size of a given `HashSet` - fn decr_counter(patch_points: HashSet) { - decr_counter_by(patch_point_count, patch_points.len().as_u64()); - } } /// Used to track all of the various block references that contain assumptions @@ -100,17 +94,17 @@ impl Invariants { // generated code referencing the ISEQ are unreachable. We mark the ISEQs baked into // generated code. self.ep_escape_iseqs.remove(&iseq); - self.no_ep_escape_iseq_patch_points.remove(&iseq).map(PatchPoint::decr_counter); + self.no_ep_escape_iseq_patch_points.remove(&iseq); } /// Forget a CME when freeing it. See [Self::forget_iseq] for reasoning. pub fn forget_cme(&mut self, cme: *const rb_callable_method_entry_t) { - self.cme_patch_points.remove(&cme).map(PatchPoint::decr_counter); + self.cme_patch_points.remove(&cme); } /// Forget a class when freeing it. See [Self::forget_iseq] for reasoning. pub fn forget_klass(&mut self, klass: VALUE) { - self.no_singleton_class_patch_points.remove(&klass).map(PatchPoint::decr_counter); + self.no_singleton_class_patch_points.remove(&klass); } /// Update ISEQ references in Invariants::ep_escape_iseqs diff --git a/zjit/src/stats.rs b/zjit/src/stats.rs index 6fd0ac7bb02232..5103a549ba8e93 100644 --- a/zjit/src/stats.rs +++ b/zjit/src/stats.rs @@ -114,7 +114,6 @@ macro_rules! make_counters { make_counters! { // Default counters that are available without --zjit-stats default { - patch_point_count, compiled_iseq_count, failed_iseq_count,