From fbb4dd0405ddfcea8ebe1c3460cd9c4798bcdf56 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 20 Jul 2026 10:06:55 +0900 Subject: [PATCH 1/3] [Win32] Define warnflags in RbConfig::CONFIG On mswin, config.status did not contain warnflags, so RbConfig::CONFIG["warnflags"] returned nil. Extensions that modify warnflags in extconf.rb, such as oj and ox, failed with NoMethodError. Define it from WARNFLAGS as on other platforms. Co-Authored-By: Claude Fable 5 --- win32/Makefile.sub | 1 + 1 file changed, 1 insertion(+) diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 4f95c10bcb5690..d7b2218d9b7a06 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -952,6 +952,7 @@ s,@SHELL@,$$(COMSPEC),;t t s,@BUILD_FILE_SEPARATOR@,\,;t t s,@PATH_SEPARATOR@,;,;t t s,@CFLAGS@,$(CFLAGS),;t t +s,@warnflags@,$(WARNFLAGS),;t t s,@WERRORFLAG@,$(WERRORFLAG),;t t s,@DEFS@,$(DEFS),;t t s,@CPPFLAGS@,$(CPPFLAGS),;t t From e42fb9492e214cdeafac44d68b649c543c0e40ff Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 26 Jul 2026 23:19:08 +0900 Subject: [PATCH 2/3] Scale ModGC test timeouts by runner and GC Apply independent timeout factors for macOS runners and the MMTk collector. This extends Ubuntu MMTk subprocess timeouts without retaining an excessive scale for the default collector on macOS. --- .github/workflows/modgc.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/modgc.yml b/.github/workflows/modgc.yml index d0a980700821a8..6cf4760a1d3cc5 100644 --- a/.github/workflows/modgc.yml +++ b/.github/workflows/modgc.yml @@ -137,8 +137,14 @@ jobs: if: ${{ matrix.test_task == 'check' && matrix.skipped_tests }} - name: Set timeout scale - run: echo "RUBY_TEST_TIMEOUT_SCALE=10" >> $GITHUB_ENV # subprocess assertion timeouts flake on slower/contended macOS runners, especially with the slower MMTk GC - if: ${{ contains(matrix.os, 'macos') }} + run: | + scale=$((os_scale * gc_scale)) + echo "RUBY_TEST_TIMEOUT_SCALE=$scale" >> "$GITHUB_ENV" + env: + # Subprocess assertion timeouts flake on slower or contended macOS + # runners and with the slower MMTk GC. + os_scale: ${{ contains(matrix.os, 'macos') && 3 || 1 }} + gc_scale: ${{ matrix.gc.name == 'mmtk' && 3 || 1 }} - name: Set up Launchable id: launchable From 28f1bbc0bc42edd00286fd68f667b1feae276ae2 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Mon, 27 Jul 2026 15:47:08 +0900 Subject: [PATCH 3/3] [ruby/strscan] Add missing shrunk check in integer_at (https://github.com/ruby/strscan/pull/212) https://github.com/ruby/strscan/commit/3032e38cb5 --- ext/strscan/strscan.c | 5 +++++ test/strscan/test_stringscanner.rb | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c index da02291478c3c4..1894ed7fb3088a 100644 --- a/ext/strscan/strscan.c +++ b/ext/strscan/strscan.c @@ -1862,8 +1862,13 @@ strscan_integer_at(int argc, VALUE *argv, VALUE self) return Qnil; beg = adjust_register_position(p, p->regs.beg[i]); + if (beg > S_LEN(p)) + return Qnil; end = adjust_register_position(p, p->regs.end[i]); + end = minl(end, S_LEN(p)); len = end - beg; + if (len == 0) + return Qnil; ptr = S_PBEG(p) + beg; #ifdef HAVE_RB_INT_PARSE_CSTR { diff --git a/test/strscan/test_stringscanner.rb b/test/strscan/test_stringscanner.rb index 96a1badb1f1087..966d62b22689b8 100644 --- a/test/strscan/test_stringscanner.rb +++ b/test/strscan/test_stringscanner.rb @@ -578,6 +578,26 @@ def test_integer_at_base_auto assert_integer_at(s, 0, 0) # 0xaf end + def test_integer_at_shrunk + omit("not supported on TruffleRuby") if RUBY_ENGINE == "truffleruby" + + s = create_string_scanner(+"before 29 after") + s.skip_until(" ") + assert_equal("29", s.scan(/\d+/)) + s.string.replace("before ") + assert_nil(s.integer_at(0)) + end + + def test_integer_at_shrunk_partial + omit("not supported on TruffleRuby") if RUBY_ENGINE == "truffleruby" + + s = create_string_scanner(+"before 29 after") + s.skip_until(" ") + assert_equal("29", s.scan(/\d+/)) + s.string.replace("before 2") + assert_integer_at(s, 2) + end + def test_pre_match s = create_string_scanner('a b c d e') s.scan(/\w/)