Skip to content

⬆️ Updates ruby to v4 - #696

Open
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/ruby-4.x
Open

renovate[bot] wants to merge 1 commit into
masterfrom
renovate/ruby-4.x

Conversation

@renovate

@renovate renovate Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Type Update Change
ruby (source) uses-with major 2.4.1 → 4.1.0-preview1
ruby (source) uses-with major 3 → 4

Warning

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-preview1

Compare 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
  • super in a module method that was called via super from a refinement
    method now works correctly.
    [Feature #​22309]

  • Module#clone and Module#dup no longer rewrite the lexical scope of
    copied methods. Constants and class variables resolve through the
    original class, consistent with inheritance and mixins.
    [Feature #​21981]

  • alias and Module#alias_method in a module emit a deprecation warning
    when 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 be
    removed in Ruby 4.3, and such an alias will raise a NameError.
    [Bug #​22276]

  • alias and Module#alias_method emit a deprecation warning when the
    original 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_FAIL is added as a flag for rb_nogvl.
      rb_nogvl does not enter the blocking region (and does not call the
      given function), returning 0, if the current thread has pending
      interrupts, including interrupts masked by Thread.handle_interrupt.
      As with the existing skip path, errno is 0 because the function was
      never called.
    • RHASH_TBL is deprecated. [Feature #​22232]
  • Array

    • Array#pack accepts new formats R and r for unsigned and signed
      LEB128 encoded integers. [Feature #​21785]
    • Array#pack accepts new formats x! and @! to align the current
      offset to a byte boundary or to the ABI alignment of another
      directive. [Feature #​22185]
  • Dir

    • Dir.glob supports ***/ for recursive matching that follows
      directory symbolic links, stopping at links to ancestor directories.
      [Feature #​17548]
  • ENV

    • ENV.fetch_values is added. It returns an array of values for the
      given names, raising KeyError for missing names unless a block is
      given. [Feature #​21781]
  • Fiber::Scheduler

    • The fiber_interrupt hook is now required. Schedulers which do not
      implement it can no longer be installed with Fiber.set_scheduler.
  • GC

    • GC.stat accepts scope: :ractor (the default), scope: :local
      (a synonym for :ractor), and scope: :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, and GC.total_time retain their
      current-Ractor behavior.
    • GC.stat reports a new key, :global_gc_count: the number of
      stop-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 of
      terminated Ractors.
    • A global garbage collection is not counted in :major_gc_count.
      :count equals :minor_gc_count plus :major_gc_count plus
      :global_gc_count in both scopes. When another Ractor's object space
      exists, including one left by a terminated Ractor that is not yet
      absorbed, or one was absorbed since the last global collection,
      GC.start runs a global collection by default, so it increments
      :global_gc_count rather than :major_gc_count; pass global: false
      for a local major collection.
    • Global compaction no longer counts overlapping CPU intervals in scalar GC
      timing statistics. Profiler wall-time intervals are unchanged.
  • Hash

    • Hash.ruby2_keywords_hash? and Hash.ruby2_keywords_hash are
      deprecated and will be removed in Ruby 4.5. [Feature #​22205]
  • Integer

    • Integer#bit_count is added. It returns the number of 1 bits in the
      binary representation of a non-negative integer (its population count).
      [Feature #​20163]
  • IO::Buffer

    • read, write, pread, and pwrite now perform one IO operation using
      (offset, length), where length is the maximum transfer size. Short
      transfers are returned directly.

    • The corresponding fiber scheduler hooks are no longer experimental and
      now use the same (offset, length) argument order and single-operation
      semantics.

  • Kernel

    • Kernel#autoload_relative and Module#autoload_relative are added.
      These methods work like autoload, but resolve the file path relative
      to 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_at is added. It converts the matched substring to
      integer and return the result. [Feature #​21932]
  • Module

    • Module#descendants is added. It returns an array of classes and
      modules that have the receiver in their ancestors. [Feature #​9779]
    • Module#ruby2_keywords and top-level ruby2_keywords are
      deprecated and will be removed in Ruby 4.4. [Feature #​22205]
    • Module#method_defined? now accepts a third optional argument to also
      match private methods. [Feature #​22297]
  • ObjectSpace

  • Proc

    • Proc#refined is added. It returns a new Proc that behaves like the
      receiver but with the refinements activated by the given modules
      in effect inside its body, without affecting the original Proc.
      [Feature #​22097]
    • Proc#ruby2_keywords is deprecated and will be removed in Ruby 4.4.
      [Feature #​22205]
  • Range

    • Range#clamp is added. It returns a new Range instance whose
      begin and end values are clamped to the given bounds. [Feature #​22175]
  • Regexp

    • All instances of Regexp are now frozen, not just literals.
      Subclasses of Regexp are not frozen for compatibility.
      [Feature #​8948]
  • Set

    • A deprecated behavior, Set#to_set, Range#to_set, and
      Enumerable#to_set accepting arguments, was removed. [Feature #​21390]
  • String

    • String#unpack and String#unpack1 accept new formats R and r
      for unsigned and signed LEB128 encoded integers. [Feature #​21785]
    • String#unpack and String#unpack1 accept a new format ^ that
      returns the current offset. Useful when combined with variable
      width formats like LEB128. [Feature #​21796]
    • String#unpack and String#unpack1 accept new formats x! and
      @! to align the current offset to a byte boundary or to the ABI
      alignment of another directive. [Feature #​22185]
    • Basic bit operations are added. String#bit_get, String#bit_set?,
      String#bit_set, String#bit_clear, String#bit_flip and
      String#bit_count handle individual bits, and String#bitwise_not,
      String#bitwise_and, String#bitwise_or, String#bitwise_xor
      (with their ! variants) handle whole strings. [Feature #​22118]
    • String#tr now accept a Hash for multi-character replacement.
      [Feature #​22238]
  • Symbol

  • Thread

    • Assigning nil with Thread#thread_variable_set now deletes the
      thread-local variable. [[Feature #​19333]]
  • Thread::Backtrace::Location

    • Thread::Backtrace::Location#source_range is added. It returns a
      Ruby::SourceRange for the Ruby expression associated with the frame.
Stdlib updates
  • Psych

    • An experimental libfyaml backend has been added. It is only
      enabled when psych is built with --enable-libfyaml, and the
      default libyaml backend remains unchanged otherwise. It is not
      supported on Windows. [GH-psych #​805]
  • Ruby::Prism

    • Ruby::Prism is added. It is the prism parser built into the
      interpreter, i.e., the very parser that parsed the running program,
      independent of the prism gem. It is autoloaded.
      Method#syntax_tree and others return its nodes. Its API may change
      between Ruby minor versions; use the prism gem unless you need the
      parser 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.
  • prism 1.9.0
  • tsort 0.2.0
  • win32-registry 0.1.2
The following bundled gems are removed.
  • net-ftp 0.3.9
  • net-pop 0.1.2

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.

    • AmigaOS
    • AtheOS
    • BSD/OS (BSDi)
    • ESIX
    • EWS-UX (NEC EWS4800)
    • FreeBSD, NetBSD and OpenBSD with a.out binaries
    • GNU/kFreeBSD
    • GNU/kOpenSolaris
    • HI-UX/MPP
    • HP-UX on the HP 9000 Series 300
    • Interix (Windows Services for UNIX)
    • IRIX
    • MirOS BSD
    • NeXTSTEP, OpenStep and Rhapsody
    • OSF/1 (Tru64 UNIX)
    • QNX Neutrino
    • SunOS 4 (Solaris, i.e. SunOS 5, is unaffected)
    • System V Release 4
    • UNICOS/mp (Cray X1)
    • UX/PDS
  • Support code for the following old versions has been removed.

    • Cygwin 1.3 and earlier
    • Solaris 9 and earlier
    • Linux 2.6.23 and earlier (RHEL 5)
  • Windows 10 1703 or later no longer needs the LongPathsEnabled registry
    value 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_PATH limited current directory. [Bug #​18947]

  • Building Ruby with MSVC now requires Visual Studio 2017 version 15.8
    (_MSC_VER 1915) 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, changing
    visibility, include/prepend, Module#refine, defining or removing
    constants, registering an autoload, writing the class's own instance
    variables and class variables, Module#freeze and
    Module#set_temporary_name raise Ractor::IsolationError in any other
    Ractor. Reading is unchanged. Everything defined at boot or by the main
    Ractor, required libraries included, is owned by the main Ractor, so a
    non-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_exit and END {} now raise Ractor::IsolationError when called
    in a non-main Ractor. Previously the registered handler ran in the main
    Ractor at process exit, which was confusing. [Feature #​22139]

  • Ractor.make_shareable now raises Ractor::Error for an IO object, and
    Ractor.shareable? returns false for it. A frozen IO used to be
    shareable, but almost all of its methods raise FrozenError and it can
    still refer to unshareable objects through the members of rb_io_t.

  • Random.urandom now raises RangeError for every size too large for a
    long, as Random#bytes does. A size that still fit in an unsigned long
    used to raise ArgumentError. [Feature #​22400]

  • Struct#[] and Struct#[]= now raise IndexError for every out-of-range
    Integer index that fits in a long. An index past the int range used to
    raise RangeError. [Feature #​22400]

Stdlib compatibility issues
  • prism is now a bundled gem. Under Bundler, require "prism" needs prism
    in the Gemfile. Use Ruby::Prism for the parser of the running
    interpreter. [Bug #​22379]

  • Etc.getlogin on Windows now returns the login name determined when the
    process starts, from the USER or USERNAME environment variable or
    GetUserName(). It used to follow later changes to ENV['USER'].

  • Socket

    • On Windows, a connection that is refused or unreachable now raises the
      matching Errno class as soon as Winsock reports it, instead of
      Errno::ETIMEDOUT once the whole connect_timeout has passed. Code
      rescuing Errno::ETIMEDOUT there has to rescue the real error instead.

    • On Windows, BasicSocket#getsockopt(:SOCKET, :ERROR) now reports an
      errno as it does on the other platforms, instead of the raw WinSock
      error code. Code comparing it with a WSAE* value has to compare it
      with the matching Errno::*::Errno instead.

    [Bug #​18661]

C API updates
Embedded TypedData
  • The RUBY_TYPED_EMBEDDABLE flag 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_address and rb_global_variable now register the address
    with 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, remaining
    registrations 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_t and rb_ulen_t are added as the types of the lengths and indices
    of String, Array and MatchData, with LEN2NUM, NUM2LEN, ULEN2NUM,
    rb_len2int, PRIdLEN and its siblings, RB_LEN_MAX, RB_LEN_MIN,
    RB_ULEN_MAX, SIZEOF_RB_LEN_T and HAVE_RB_LEN_T. RbConfig::SIZEOF["rb_len_t"]
    gives its size to an extconf.rb. They are long on every platform for now, and
    the C API that carries such lengths, such as RSTRING_LEN and
    rb_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_len2long is added to convert an rb_len_t to long, raising
    RangeError via the new rb_out_of_long when it does not fit, for
    extensions that keep a length in long. [Feature #​22400]

Removed APIs

The following APIs, which have been deprecated for many years, are removed.
[Feature #​21768]

  • old postponed job functions,
  • untyped data object type/functions,
  • old APIs to allocate a data object,
  • taintedness/trustedness enums/macros,
  • rb_gc_force_recycle function,
  • rb_iterate function,
  • and some functions and constants for internal use.
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.warmup loads them
    eagerly 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 force
    a Ractor-local GC. By default, GC.start runs a global GC (all Ractors) like
    before. This can also be triggered with GC.start(global: true). The global
    keyword argument has no effect when a single Ractor is running.

    Visible behavior changes:

    • Ractor#value returns the value only once; a second call raises
      Ractor::Error.
    • GC.disable/GC.enable act as per-Ractor holds on a process-wide
      switch: one Ractor's GC.enable no longer overrides another Ractor's
      GC.disable.
    • ObjectSpace.each_object enumerates the calling Ractor's own objects
      plus other Ractors' shareable objects (ObjectSpace.dump_all still
      covers everything).
    • ObjectSpace.define_finalizer on another Ractor's object raises
      Ractor::IsolationError.
  • Ractor#monitor now sends an Array naming the Ractor and what happened to
    it, [ractor, :exited] or [ractor, :aborted], where it used to send the
    bare Symbol :exited or :aborted. Several Ractors can then report to one
    port 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.

    r = Ractor.new { :ok }
    r.monitor(port = Ractor::Port.new)
    port.receive #=> [r, :exited]
    

    One port can therefore watch a whole group, which is all a supervisor
    needs:

    workers.each { |r| r.monitor port }
    
    until workers.empty?
      r, status = port.receive
      workers.delete(r)
      workers << restart(r) if status == :aborted
    end
    
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:

    • A timed wait sits in a hierarchical timer wheel rather than on a list
      sorted by deadline, which was inserted into by a linear scan.
    • An fd stays armed in the backend between waits, instead of being added
      before each wait and removed after each wake.
    • The io-wait bookkeeping is sharded by fd, rather than serialized on one
      lock across every fd.
    • A timed wait on an fd rides the scheduler instead of going to a blocking
      region, which cost a native thread handoff per wait.
    • A context switch, and leaving or rejoining the shared pool, no longer take
      the scheduler's global lock.
  • The RUBY_MN_THREADS environment variable now runs from no M:N scheduling
    at all to all of it. -1 is new: a Ractor's threads have been M:N since
    the scheduler was added, with no way to turn that off. 0 and 1 are
    unchanged.

    main thread the main Ractor's other threads a Ractor's threads
    -1 1:1 1:1 1:1
    0 or unset 1:1 1:1 M:N
    1 1:1 M:N M:N
    2 M:N M:N M:N
  • RUBY_MN_THREADS=2 is new. The main thread is resumed like any other M:N
    thread 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:

    • A C extension that keeps state per OS thread has to call
      rb_thread_lock_native_thread().
    • What must run on the process's initial thread does not work at all,
      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= was
    already skipped for the same reason.

JIT
YJIT
  • YJIT now supports Windows (mswin) on x64 CPUs. Configure with
    win32\configure.bat --enable-yjit, which requires rustc with the
    x86_64-pc-windows-msvc target. Only the release build is supported,
    and MinGW is not. [Feature #​18439]

v4.0.7: 4.0.7

Compare Source

What's Changed

Note: 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.6

Compare Source

What's Changed

Note: 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.5

Compare Source

What's Changed

Note: 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.4

Compare Source

What's Changed

[!IMPORTANT]
✂ PR body was truncated to here.


Configuration

📅 Schedule: (in timezone Europe/Moscow)

  • Branch creation
    • "after 10pm every weekday,before 5am every weekday,every weekend"
  • Automerge
    • At any time (no schedule defined)

🚦 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@github-actions

Copy link
Copy Markdown

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.

@github-actions

Copy link
Copy Markdown

🏷️ [bumpr]
Next version:v1.12.1
Changes:v1.12.0...AlexRogalskiy:renovate/ruby-4.x

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
renovate Bot force-pushed the renovate/ruby-4.x branch from 8b61631 to 93091e6 Compare October 13, 2026 02:53

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants