From 1d160ed0591fbaabe1ae6d76920da409e238b396 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 21 Nov 2025 14:39:51 +0900 Subject: [PATCH 1/6] Fixed warning for String comparison of Gem::Version --- lib/bundler/definition.rb | 2 +- lib/rubygems/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index ca41d7953d8ea2..437390f3ec448b 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -1114,7 +1114,7 @@ def preload_git_sources end def find_source_requirements - if Gem.ruby_version >= "3.3" + if Gem.ruby_version >= Gem::Version.new("3.3") # Ruby 3.2 has a bug that incorrectly triggers a circular dependency warning. This version will continue to # fetch git repositories one by one. preload_git_sources diff --git a/lib/rubygems/version.rb b/lib/rubygems/version.rb index 43a0e4e78375d5..a88a4a49ee2b94 100644 --- a/lib/rubygems/version.rb +++ b/lib/rubygems/version.rb @@ -345,7 +345,7 @@ def approximate_recommendation def <=>(other) if String === other unless Gem::Deprecate.skip - warn "comparing version objects with strings is deprecated and will be removed" + warn "comparing version objects with strings is deprecated and will be removed", uplevel: 1 end return unless self.class.correct?(other) return self <=> self.class.new(other) From bcc7b2049c45356b11992e095e2f114c02736e24 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 21 Nov 2025 14:52:46 +0900 Subject: [PATCH 2/6] Use assert_match for uplevel option --- test/rubygems/test_gem_version.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/rubygems/test_gem_version.rb b/test/rubygems/test_gem_version.rb index ad2a11c631803f..567a4eb4874333 100644 --- a/test/rubygems/test_gem_version.rb +++ b/test/rubygems/test_gem_version.rb @@ -160,13 +160,11 @@ def test_spaceship [-1, "1.9.3.1"], [nil, "whatever"], ].each do |cmp, string_ver| - expected = "comparing version objects with strings is deprecated and will be removed\n" - actual_stdout, actual_stderr = capture_output do assert_equal(cmp, v("1.9.3") <=> string_ver) end assert_empty actual_stdout - assert_equal expected, actual_stderr + assert_match /comparing version objects with strings is deprecated and will be removed/, actual_stderr end end From eb11b40bb54b11456f88564957ec22c8c08c203c Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 21 Nov 2025 16:20:35 +0900 Subject: [PATCH 3/6] [ruby/rubygems] bin/rubocop -a https://github.com/ruby/rubygems/commit/fbf6fb667e --- test/rubygems/test_gem_version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/rubygems/test_gem_version.rb b/test/rubygems/test_gem_version.rb index 567a4eb4874333..ce38a59113d2d2 100644 --- a/test/rubygems/test_gem_version.rb +++ b/test/rubygems/test_gem_version.rb @@ -164,7 +164,7 @@ def test_spaceship assert_equal(cmp, v("1.9.3") <=> string_ver) end assert_empty actual_stdout - assert_match /comparing version objects with strings is deprecated and will be removed/, actual_stderr + assert_match(/comparing version objects with strings is deprecated and will be removed/, actual_stderr) end end From d4e1f9e1b8621ef92caa5061dbc11e1860fa5eed Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 21 Nov 2025 13:18:54 +0900 Subject: [PATCH 4/6] Win: quote equal sign in command line `cmd.exe` splits the command line also by equal signs, not only by space characters. --- common.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.mk b/common.mk index 648dd00b0252b6..70d61231f278c0 100644 --- a/common.mk +++ b/common.mk @@ -46,7 +46,7 @@ RUN_OPTS = --disable-gems GIT_IN_SRC = $(GIT) -C $(srcdir) GIT_LOG = $(GIT_IN_SRC) log --no-show-signature -GIT_LOG_FORMAT = $(GIT_LOG) --pretty=format: +GIT_LOG_FORMAT = $(GIT_LOG) "--pretty=format:" # GITPULLOPTIONS = --no-tags From b9a213f791eb79372d10f6ba07b3803140b3eb59 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 21 Nov 2025 13:26:43 +0900 Subject: [PATCH 5/6] Fix timezone of `yesterday` Set the `TZ environment variable. `git log` does not recognize UTC offset in `--before` option, unless full datetime is given. --- template/Makefile.in | 2 +- win32/Makefile.sub | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/template/Makefile.in b/template/Makefile.in index bf5281e0df8498..2987c86488cf2f 100644 --- a/template/Makefile.in +++ b/template/Makefile.in @@ -748,4 +748,4 @@ yes-test-syntax-suggest: $(PREPARE_SYNTAX_SUGGEST) no-test-syntax-suggest: yesterday: - $(GIT_IN_SRC) reset --hard `$(GIT_LOG_FORMAT):%H -1 --before=00:00+0900` + $(GIT_IN_SRC) reset --hard `TZ=UTC-9 $(GIT_LOG_FORMAT):%H -1 --before=00:00` diff --git a/win32/Makefile.sub b/win32/Makefile.sub index f95b583fb82a5e..04ec2873275dd5 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -1391,6 +1391,7 @@ rubyspec-capiext: $(RUBYSPEC_CAPIEXT_EXTS) exts: rubyspec-capiext yesterday: + (set TZ=UTC-9) && \ for /f "usebackq" %H in \ - (`$(GIT_LOG_FORMAT):%H -1 "--before=00:00+0900"`) do \ + (`$(GIT_LOG_FORMAT):%H -1 "--before=00:00"`) do \ $(GIT_IN_SRC) reset --hard %%H From 5f5da2c293766b98e543b3215b1af7ad6950977d Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Thu, 20 Nov 2025 21:50:11 -0800 Subject: [PATCH 6/6] Fix stdatomic case in rbimpl_atomic_u64_fetch_add This was failing on crossruby, likely because HAVE_GCC_ATOMIC_BUILTINS was true, but HAVE_GCC_ATOMIC_BUILTINS_64 was false. We probably should have feature detection of 64-bit stdatomics like we do for GCC, but for now let's keep rbimpl_atomic_u64_fetch_add in sync with load/set. --- ruby_atomic.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ruby_atomic.h b/ruby_atomic.h index 9eaa5a9651f96a..c194f7ec3b82fc 100644 --- a/ruby_atomic.h +++ b/ruby_atomic.h @@ -43,6 +43,8 @@ rbimpl_atomic_u64_load_relaxed(const volatile rbimpl_atomic_uint64_t *value) uint64_t val = *value; return atomic_cas_64(value, val, val); #else + // TODO: stdatomic + return *value; #endif } @@ -58,6 +60,8 @@ rbimpl_atomic_u64_set_relaxed(volatile rbimpl_atomic_uint64_t *address, uint64_t #elif defined(__sun) && defined(HAVE_ATOMIC_H) && (defined(_LP64) || defined(_I32LPx)) atomic_swap_64(address, value); #else + // TODO: stdatomic + *address = value; #endif } @@ -72,9 +76,9 @@ rbimpl_atomic_u64_fetch_add(volatile rbimpl_atomic_uint64_t *ptr, uint64_t val) return InterlockedExchangeAdd64((volatile LONG64 *)ptr, val); #elif defined(__sun) && defined(HAVE_ATOMIC_H) && (defined(_LP64) || defined(_I32LPx)) return atomic_add_64_nv(ptr, val) - val; -#elif defined(HAVE_STDATOMIC_H) - return atomic_fetch_add_explicit((_Atomic uint64_t *)ptr, val, memory_order_seq_cst); #else + // TODO: stdatomic + // Fallback using mutex for platforms without 64-bit atomics static rb_native_mutex_t lock = RB_NATIVE_MUTEX_INITIALIZER; rb_native_mutex_lock(&lock);