Repository navigation
⬆️ Updates ruby to v4 - #696
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
|
Thanks for the PR! This section of the codebase is owner by https://github.com/AlexRogalskiy/ - if they write a comment saying "LGTM" then it will be merged. |
|
🏷️ [bumpr] |
There was a problem hiding this comment.
Scan Summary
| Tool | Critical | High | Medium | Low | Status |
|---|---|---|---|---|---|
| Secrets Audit | 0 | 427 | 0 | 0 | ❌ |
Recommendation
Please review the findings from Code scanning alerts before approving this pull request. You can also configure the build rules or add suppressions to customize this bot 👍
renovate
Bot
force-pushed
the
renovate/ruby-4.x
branch
from
October 13, 2026 02:53
8b61631 to
93091e6
Compare
There was a problem hiding this comment.
Scan Summary
| Tool | Critical | High | Medium | Low | Status |
|---|---|---|---|---|---|
| Secrets Audit | 0 | 428 | 0 | 0 | ❌ |
Recommendation
Please review the findings from Code scanning alerts before approving this pull request. You can also configure the build rules or add suppressions to customize this bot 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
2.4.1→4.1.0-preview13→4Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
ruby/ruby (ruby)
v4.1.0-preview1: 4.1.0-preview1Compare Source
NEWS for Ruby 4.1.0-preview1
This document is a list of user-visible feature changes
since the 4.0.0 release, except for bug fixes.
Note that each entry is kept to a minimum, see links for details.
Language changes
superin a module method that was called viasuperfrom a refinementmethod now works correctly.
[Feature #22309]
Module#cloneandModule#dupno longer rewrite the lexical scope ofcopied methods. Constants and class variables resolve through the
original class, consistent with inheritance and mixins.
[Feature #21981]
aliasandModule#alias_methodin a module emit a deprecation warningwhen the original method is not a method of the module or its ancestors
and is only found through the fallback to
Object. The fallback will beremoved in Ruby 4.3, and such an alias will raise a
NameError.[Bug #22276]
aliasandModule#alias_methodemit a deprecation warning when theoriginal method is defined in a prepended module. This behavior will
be removed in Ruby 4.3, and alias lookup will start at the origin
class (after prepended modules).
[Bug #22273]
Core classes updates
Note: We're only listing outstanding class updates.
C API
RB_NOGVL_PENDING_INTR_FAILis added as a flag forrb_nogvl.rb_nogvldoes not enter the blocking region (and does not call thegiven function), returning
0, if the current thread has pendinginterrupts, including interrupts masked by
Thread.handle_interrupt.As with the existing skip path,
errnois0because the function wasnever called.
RHASH_TBLis deprecated. [Feature #22232]Array
Array#packaccepts new formatsRandrfor unsigned and signedLEB128 encoded integers. [Feature #21785]
Array#packaccepts new formatsx!and@!to align the currentoffset to a byte boundary or to the ABI alignment of another
directive. [Feature #22185]
Dir
Dir.globsupports***/for recursive matching that followsdirectory symbolic links, stopping at links to ancestor directories.
[Feature #17548]
ENV
ENV.fetch_valuesis added. It returns an array of values for thegiven names, raising
KeyErrorfor missing names unless a block isgiven. [Feature #21781]
Fiber::Scheduler
fiber_interrupthook is now required. Schedulers which do notimplement it can no longer be installed with
Fiber.set_scheduler.GC
GC.statacceptsscope: :ractor(the default),scope: :local(a synonym for
:ractor), andscope: :global.With the default collector, the global scope reports cumulative collection
counts and measured marking/sweeping CPU time across Ractors, including
history from destroyed object spaces, without requesting a stop-the-world
snapshot. Unscoped
GC.stat,GC.count, andGC.total_timeretain theircurrent-Ractor behavior.
GC.statreports a new key,:global_gc_count: the number ofstop-the-world global garbage collection cycles the current Ractor
initiated. Each global collection is attributed to exactly one Ractor,
so the values sum across Ractors.
GC.stat(:global_gc_count, scope: :global)reports the process total, including the counts ofterminated Ractors.
:major_gc_count.:countequals:minor_gc_countplus:major_gc_countplus:global_gc_countin both scopes. When another Ractor's object spaceexists, including one left by a terminated Ractor that is not yet
absorbed, or one was absorbed since the last global collection,
GC.startruns a global collection by default, so it increments:global_gc_countrather than:major_gc_count; passglobal: falsefor a local major collection.
timing statistics. Profiler wall-time intervals are unchanged.
Hash
Hash.ruby2_keywords_hash?andHash.ruby2_keywords_hasharedeprecated and will be removed in Ruby 4.5. [Feature #22205]
Integer
Integer#bit_countis added. It returns the number of1bits in thebinary representation of a non-negative integer (its population count).
[Feature #20163]
IO::Buffer
read,write,pread, andpwritenow perform one IO operation using(offset, length), wherelengthis the maximum transfer size. Shorttransfers are returned directly.
The corresponding fiber scheduler hooks are no longer experimental and
now use the same
(offset, length)argument order and single-operationsemantics.
Kernel
Kernel#autoload_relativeandModule#autoload_relativeare added.These methods work like
autoload, but resolve the file path relativeto the file where the method is called, similar to
require_relative.This makes it easier to autoload constants from files in the same
directory without hardcoding absolute paths or manipulating
$LOAD_PATH.[Feature #15330]
MatchData
MatchData#integer_atis added. It converts the matched substring tointeger and return the result. [Feature #21932]
Module
Module#descendantsis added. It returns an array of classes andmodules that have the receiver in their ancestors. [Feature #9779]
Module#ruby2_keywordsand top-levelruby2_keywordsaredeprecated and will be removed in Ruby 4.4. [Feature #22205]
Module#method_defined?now accepts a third optional argument to alsomatch private methods. [Feature #22297]
ObjectSpace
ObjectSpace._id2refwas removed. [Feature #22135]Proc
Proc#refinedis added. It returns a newProcthat behaves like thereceiver but with the refinements activated by the given modules
in effect inside its body, without affecting the original
Proc.[Feature #22097]
Proc#ruby2_keywordsis deprecated and will be removed in Ruby 4.4.[Feature #22205]
Range
Range#clampis added. It returns a newRangeinstance whosebegin and end values are clamped to the given bounds. [Feature #22175]
Regexp
Regexpare now frozen, not just literals.Subclasses of
Regexpare not frozen for compatibility.[Feature #8948]
Set
Set#to_set,Range#to_set, andEnumerable#to_setaccepting arguments, was removed. [Feature #21390]String
String#unpackandString#unpack1accept new formatsRandrfor unsigned and signed LEB128 encoded integers. [Feature #21785]
String#unpackandString#unpack1accept a new format^thatreturns the current offset. Useful when combined with variable
width formats like LEB128. [Feature #21796]
String#unpackandString#unpack1accept new formatsx!and@!to align the current offset to a byte boundary or to the ABIalignment of another directive. [Feature #22185]
String#bit_get,String#bit_set?,String#bit_set,String#bit_clear,String#bit_flipandString#bit_counthandle individual bits, andString#bitwise_not,String#bitwise_and,String#bitwise_or,String#bitwise_xor(with their
!variants) handle whole strings. [Feature #22118]String#trnow accept a Hash for multi-character replacement.[Feature #22238]
Symbol
Symbol#to_snow returns a frozen string. [Feature #22137]Thread
nilwithThread#thread_variable_setnow deletes thethread-local variable. [[Feature #19333]]
Thread::Backtrace::Location
Thread::Backtrace::Location#source_rangeis added. It returns aRuby::SourceRangefor the Ruby expression associated with the frame.Stdlib updates
Psych
enabled when psych is built with
--enable-libfyaml, and thedefault libyaml backend remains unchanged otherwise. It is not
supported on Windows. [GH-psych #805]
Ruby::Prism
Ruby::Prismis added. It is the prism parser built into theinterpreter, i.e., the very parser that parsed the running program,
independent of the prism gem. It is autoloaded.
Method#syntax_treeand others return its nodes. Its API may changebetween Ruby minor versions; use the
prismgem unless you need theparser of the running interpreter. [Bug #22379]
The following bundled gems are added.
We only list stdlib changes that are notable feature changes.
Other changes are listed in the following sections. We also listed release
history from the previous bundled version that is Ruby 3.4.0 if it has GitHub
releases.
The following bundled gems are promoted from default gems.
The following bundled gems are removed.
They are still available on rubygems.org and can be installed with
gem install. [Feature #21835]The following default gem is added.
The following default gems are updated.
The following bundled gems are updated.
RubyGems and Bundler
Ruby 4.0 bundled RubyGems and Bundler version 4. see the following links for details.
Supported platforms
Support code for the following platforms has been removed. Their
vendors or distributors have ended support, there is no environment to
test Ruby on them, and none of them has a platform maintainer.
Support code for the following old versions has been removed.
Windows 10 1703 or later no longer needs the
LongPathsEnabledregistryvalue to use paths longer than 260 characters. This applies to any process
running the interpreter, including a program which embeds libruby. Each path
component is still limited to 255 characters, and a child process still
starts with the
MAX_PATHlimited current directory. [Bug #18947]Building Ruby with MSVC now requires Visual Studio 2017 version 15.8
(
_MSC_VER1915) or later.Ruby built with MSVC now requires Windows 10 version 1809 (build 17763)
or Windows Server 2019 or later. Earlier Windows 10 releases and Windows
Server 2016 are no longer supported.
Ruby on macOS now requires Mac OS X 10.6 or later. Mac OS X 10.5 and
PowerPC Macs are no longer supported.
Compatibility issues
A class or module can now be modified only by the Ractor which created it,
its owner. Defining, removing or undefining methods,
alias, changingvisibility,
include/prepend,Module#refine, defining or removingconstants, registering an
autoload, writing the class's own instancevariables and class variables,
Module#freezeandModule#set_temporary_nameraiseRactor::IsolationErrorin any otherRactor. Reading is unchanged. Everything defined at boot or by the main
Ractor,
required libraries included, is owned by the main Ractor, so anon-main Ractor can no longer monkey-patch it; and since defining a constant
in a foreign class is prohibited, it can not define a top-level class or
module name either. In exchange a Ractor has full use of the classes it
creates itself, including unshareable constant, instance variable and class
variable values, which not even the main Ractor could do before. See
doc/language/ractor.md. [Feature #22226]
Kernel#at_exitandEND {}now raiseRactor::IsolationErrorwhen calledin a non-main Ractor. Previously the registered handler ran in the main
Ractor at process exit, which was confusing. [Feature #22139]
Ractor.make_shareablenow raisesRactor::Errorfor anIOobject, andRactor.shareable?returnsfalsefor it. A frozenIOused to beshareable, but almost all of its methods raise
FrozenErrorand it canstill refer to unshareable objects through the members of
rb_io_t.Random.urandomnow raisesRangeErrorfor every size too large for along, asRandom#bytesdoes. A size that still fit in anunsigned longused to raise
ArgumentError. [Feature #22400]Struct#[]andStruct#[]=now raiseIndexErrorfor every out-of-rangeInteger index that fits in a
long. An index past theintrange used toraise
RangeError. [Feature #22400]Stdlib compatibility issues
prism is now a bundled gem. Under Bundler,
require "prism"needs prismin the Gemfile. Use
Ruby::Prismfor the parser of the runninginterpreter. [Bug #22379]
Etc.getloginon Windows now returns the login name determined when theprocess starts, from the
USERorUSERNAMEenvironment variable orGetUserName(). It used to follow later changes toENV['USER'].Socket
On Windows, a connection that is refused or unreachable now raises the
matching
Errnoclass as soon as Winsock reports it, instead ofErrno::ETIMEDOUTonce the wholeconnect_timeouthas passed. Coderescuing
Errno::ETIMEDOUTthere has to rescue the real error instead.On Windows,
BasicSocket#getsockopt(:SOCKET, :ERROR)now reports anerrno as it does on the other platforms, instead of the raw WinSock
error code. Code comparing it with a
WSAE*value has to compare itwith the matching
Errno::*::Errnoinstead.[Bug #18661]
C API updates
Embedded TypedData
The
RUBY_TYPED_EMBEDDABLEflag is now public and documented and can be used by C extensions.It allows allocating C structs directly into Ruby object slots, which reduces pointer chasing,
and in some case memory usage.
See the C extension documentation for details. [Feature #21853]
Added new C23 inspired allocator functions, that takes the previous memory size.
This allow the Ruby GC to better keep track of memory usage, improving its heuristics.
It also improves the performance of system allocators that support C23
free_sized.However, it is important to note that passing an incorrect size to these function is undefined
behavior and may result in crashes or memory leaks.
ruby_xfree_sized(void *ptr, size_t size)ruby_xrealloc_sized(void *ptr, size_t newsiz, size_t oldsiz)ruby_xrealloc2_sized(void *ptr, size_t newelems, size_t newsiz, size_t oldelems)[Feature #21861]
Ractor-scoped GC address registration
rb_gc_register_addressandrb_global_variablenow register the addresswith the calling Ractor, and only that Ractor's GC marks the stored object.
Any Ractor may register an address, but the value stored through it must be a
special constant, a shareable object, or an unshareable object owned by the
registering Ractor. Storing another Ractor's unshareable object can result in
the object being freed while the address still refers to it (use-after-free).
If the address has process lifetime (a static VALUE), register it from the
main Ractor or keep the stored values shareable.
When the registering Ractor is joined with
Ractor#value, remainingregistrations move to the joining Ractor; otherwise they move to the main
Ractor once the dead Ractor is collected.
[[Feature #22277]]
Type for lengths and indices
rb_len_tandrb_ulen_tare added as the types of the lengths and indicesof String, Array and MatchData, with
LEN2NUM,NUM2LEN,ULEN2NUM,rb_len2int,PRIdLENand its siblings,RB_LEN_MAX,RB_LEN_MIN,RB_ULEN_MAX,SIZEOF_RB_LEN_TandHAVE_RB_LEN_T.RbConfig::SIZEOF["rb_len_t"]gives its size to an extconf.rb. They are
longon every platform for now, andthe C API that carries such lengths, such as
RSTRING_LENandrb_range_beg_len, uses them. A later change will makes them 64 bits on mswin,so extensions should keep these lengths in
rb_len_t. [Feature #22400]rb_len2longis added to convert anrb_len_ttolong, raisingRangeErrorvia the newrb_out_of_longwhen it does not fit, forextensions that keep a length in
long. [Feature #22400]Removed APIs
The following APIs, which have been deprecated for many years, are removed.
[Feature #21768]
rb_gc_force_recyclefunction,rb_iteratefunction,Implementation improvements
The default garbage collector has been switched from a freelist allocator to a bump pointer allocator. [PR #17201]
The error_highlight, did_you_mean, and syntax_suggest gems are now
loaded lazily on the first error display instead of at interpreter
boot, which reduces startup time.
Process.warmuploads themeagerly so that pre-forking servers keep their code in
copy-on-write shared memory. [Feature #21951]
Ractor
A lot of work has gone into making Ractors more stable, performant, and usable. These improvements bring Ractor implementation closer to leaving experimental status.
The default GC now runs per Ractor: each Ractor collects its own heap
on its own thread without stopping the others, and a stop-the-world
collection only runs when it is really needed (explicit full
GC.start,shareable-object growth, reclaiming dead Ractors' heaps). Allocation-heavy
Ractor programs now scale like forked processes.
GC.start(global: false)can be used when multiple Ractors are running to forcea Ractor-local GC. By default,
GC.startruns a global GC (all Ractors) likebefore. This can also be triggered with
GC.start(global: true). Theglobalkeyword argument has no effect when a single Ractor is running.
Visible behavior changes:
Ractor#valuereturns the value only once; a second call raisesRactor::Error.GC.disable/GC.enableact as per-Ractor holds on a process-wideswitch: one Ractor's
GC.enableno longer overrides another Ractor'sGC.disable.ObjectSpace.each_objectenumerates the calling Ractor's own objectsplus other Ractors' shareable objects (
ObjectSpace.dump_allstillcovers everything).
ObjectSpace.define_finalizeron another Ractor's object raisesRactor::IsolationError.Ractor#monitornow sends an Array naming the Ractor and what happened toit,
[ractor, :exited]or[ractor, :aborted], where it used to send thebare Symbol
:exitedor:aborted. Several Ractors can then report to oneport and the receiver still knows which one finished. The Array is built for
the receiving Ractor, so watching many Ractors leaves no shareable objects
behind.
One port can therefore watch a whole group, which is all a supervisor
needs:
M:N thread scheduler
The scheduler scales with the number of waiters and of Ractors, where it
used to walk a list or take one lock for all of them:
sorted by deadline, which was inserted into by a linear scan.
before each wait and removed after each wake.
lock across every fd.
region, which cost a native thread handoff per wait.
the scheduler's global lock.
The
RUBY_MN_THREADSenvironment variable now runs from no M:N schedulingat all to all of it.
-1is new: a Ractor's threads have been M:N sincethe scheduler was added, with no way to turn that off.
0and1areunchanged.
-10or unset12RUBY_MN_THREADS=2is new. The main thread is resumed like any other M:Nthread rather than woken on a native thread of its own, which costs an order
of magnitude more. It pays off when the main thread drives the work, and
does nothing for one that only starts other threads and waits.
The main thread is then no longer bound to one OS thread, which is what the
M:N scheduler already meant for every other thread:
rb_thread_lock_native_thread().pinning included: macOS AppKit and CFRunLoop, and hosts that embed Ruby
and return into their own main loop.
The OS thread name is no longer set from the Ruby thread for M:N threads:
one native thread runs many of them over its life.
Thread#name=wasalready skipped for the same reason.
JIT
YJIT
win32\configure.bat --enable-yjit, which requiresrustcwith thex86_64-pc-windows-msvctarget. Only the release build is supported,and MinGW is not. [Feature #18439]
v4.0.7: 4.0.7Compare Source
What's Changed
Coverage.startand ruby/debug - Ruby - Ruby Issue Tracking SystemBUNDLER_SETUPcan evaluate gemspecs before main-box RubyGems initialization - Ruby - Ruby Issue Tracking Systemaws-sdk-ec2in Ruby 4.0.6 - Ruby - Ruby Issue Tracking Systemfiber_switchwith transfer-terminated async tasks on 3.4.10 - Ruby - Ruby Issue Tracking Systemvm_call_iseq_setup_kwparm_nokwarg/def_iseq_ptr) on Ruby 4.0.6 — Rails CI - Ruby - Ruby Issue Tracking SystemCoverage.line_stubclobbers already-collected coverage data - Ruby - Ruby Issue Tracking SystemNote: This list is automatically generated by tool/gen-github-release.rb. Because of this, some commits may be missing.
Full Changelog
v4.0.6: 4.0.6Compare Source
What's Changed
Thread.each_caller_location(1, 1)segfaults when called from a cfunc - Ruby - Ruby Issue Tracking Systemrb_vm_ci_lookupunder parallel Ractors - Ruby - Ruby Issue Tracking SystemArray#sumtakes slow path, does not perform compensated summation of Float elements when init argument is a Float - Ruby - Ruby Issue Tracking System$!stays as the first exception in Ruby Box - Ruby - Ruby Issue Tracking SystemThread.handle_interruptmasking. - Ruby - Ruby Issue Tracking SystemEnumerator::Lazy#to_enumdoes not accept method names as strings - Ruby - Ruby Issue Tracking SystemSignal.trap(:EXIT)exception only shown ifat_exitalso raises - Ruby - Ruby Issue Tracking SystemNote: This list is automatically generated by tool/gen-github-release.rb. Because of this, some commits may be missing.
Full Changelog
v4.0.5: 4.0.5Compare Source
What's Changed
make rdocfails withinvalid byte sequence in US-ASCIIon Ruby 4.0.4 under C locale - Ruby - Ruby Issue Tracking SystemNote: This list is automatically generated by tool/gen-github-release.rb. Because of this, some commits may be missing.
Full Changelog
v4.0.4: 4.0.4Compare Source
What's Changed
Fiber#transfer: machine stack not released when fiber terminates, causingFiberError: can't set a guard page- Ruby - Ruby Issue Tracking SystemConfiguration
📅 Schedule: (in timezone Europe/Moscow)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.