Wiki: https://fedoraproject.org/wiki/Changes/Ruby_3.5
Discussion Thread: https://discussion.fedoraproject.org/t/f44-change-proposal-ruby-3-5-systemwide/172367
**This is a proposed Change for Fedora Linux.**
This document represents a proposed Change. As part of the Changes process, proposals are publicly announced in order to receive community feedback. This proposal will only be implemented if approved by the Fedora Engineering Steering Committee.
== Summary ==
Ruby 3.5 is the latest stable version of Ruby. Many new features and improvements are included for the increasingly diverse and expanding demands for Ruby. With this major update from Ruby 3.4 in Fedora 43 to Ruby 3.5 in Fedora 44, Fedora becomes the superior Ruby development platform.
== Owner ==
* Name: [[User:Jackorp1| Jaroslav Prokop]]
* Email: jprokop@redhat.com
* Name: [[User:Vondruch| Vít Ondruch]]
* Email: vondruch@redhat.com
* Name: [[User:mtasaka| Mamoru Tasaka]]
* Email: mtasaka@fedoraproject.org
== Detailed Description ==
Ruby 3.5 is upstream's new major release of Ruby. Many new features and improvements are included.
=== Language changes ===
* `*nil` no longer calls `nil.to_a`, similar to how `**nil` does not call `nil.to_hash`.
* Logical binary operators (`||`, `&&`, `and` and `or`) at the beginning of a line continue the previous line, like fluent dot.
=== Core classes updates ===
Note: We're only listing outstanding class updates.
* Kernel
* `Kernel#inspect` now checks for the existence of a `#instance_variables_to_inspect` method, allowing control over which instance variables are displayed in the `#inspect` string.
* Binding
* `Binding#local_variables` does no longer include numbered parameters. Also, `Binding#local_variable_get` and `Binding#local_variable_set` reject to handle numbered parameters.
* IO
* `IO.select` accepts `Float::INFINITY` as a timeout argument.
* Math
* `Math.log1p` and `Math.expm1` are added.
* Socket
* `Socket.tcp` & `TCPSocket.new` accepts `open_timeout` as a keyword argument to specify the timeout for the initial connection.
* Ractor
* `Ractor::Port` class was added for a new synchronization mechanism to communicate between Ractors.
* `Ractor::Port` provides the following methods:
* `Ractor::Port#receive`
* `Ractor::Port#send` (or `Ractor::Port#<<`)
* `Ractor::Port#close`
* `Ractor::Port#closed?`
* As result, `Ractor.yield` and `Ractor#take` were removed.
* `Ractor#join` and `Ractor#value` were added to wait for the termination of a Ractor. These are similar to `Thread#join` and `Thread#value`.
* `Ractor#monitor` and `Ractor#unmonitor` were added as low-level interfaces used internally to implement `Ractor#join`.
* `Ractor.select` now only accepts Ractors and Ports. If Ractors are given, it returns when a Ractor terminates.
* `Ractor#default_port` was added. Each `Ractor` has a default port, which is used by `Ractor.send`, `Ractor.receive`.
* `Ractor#close_incoming` and `Ractor#close_outgoing` were removed.
* `Ractor.shareable_proc` and `Ractor.shareable_lambda` is introduced to make shareable Proc or lambda.
* `Set`
* `Set` is now a core class, instead of an autoloaded stdlib class.
* String
* Update Unicode to Version 16.0.0 and Emoji Version 16.0. (also applies to Regexp)
* Thread
* Introduce support for `Thread#raise(cause:)` argument similar to `Kernel#raise`.
* Fiber
* Introduce support for `Fiber#raise(cause:)` argument similar to `Kernel#raise`.
* Fiber::Scheduler
* Introduce `Fiber::Scheduler#fiber_interrupt` to interrupt a fiber with a given exception. The initial use case is to interrupt a fiber that is waiting on a blocking IO operation when the IO operation is closed.
* Pathname
* Pathname has been promoted from a default gem to a core class of Ruby.
=== Stdlib updates ===
The following bundled gems are promoted from default gems.
* ostruct 0.6.3
* pstore 0.2.0
* benchmark 0.5.0
* logger 1.7.0
* rdoc 6.15.0
* win32ole 1.9.2
* irb 1.15.2
* reline 0.6.2
* readline 0.0.4
* fiddle 1.1.8
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.3.0 if it has GitHub releases.
The following default gem is added.
* win32-registry 0.1.1
The following default gems are updated.
* RubyGems 4.0.0.dev
* bundler 4.0.0.dev
* date 3.5.0
* digest 3.2.1
* english 0.8.1
* erb 5.1.3
* etc 1.4.6
* fcntl 1.3.0
* fileutils 1.8.0
* io-console 0.8.1
* io-nonblock 0.3.2
* io-wait 0.3.2
* json 2.15.2
* net-http 0.7.0
* openssl 4.0.0.pre
* optparse 0.8.0
* pp 0.6.3
* prism 1.6.0
* psych 5.2.6
* resolv 0.6.3
* stringio 3.1.8.dev
* strscan 3.1.6.dev
* timeout 0.4.4
* uri 1.1.0
* weakref 0.1.4
* zlib 3.2.2
The following bundled gems are added.
The following bundled gems are updated.
* minitest 5.26.0
* rake 13.3.1
* test-unit 3.7.0
* rexml 3.4.4
* net-ftp 0.3.9
* net-imap 0.5.12
* net-smtp 0.5.1
* matrix 0.4.3
* prime 0.1.4
* rbs 3.9.5
* debug 1.11.0
* base64 0.3.0
* bigdecimal 3.3.1
* drb 2.2.3
* syslog 0.3.0
* csv 3.3.5
* repl_type_completor 0.1.11
=== Supported platforms ===
=== Compatibility issues ===
* The following methods were removed from Ractor due because of `Ractor::Port`:
* `Ractor.yield`
* `Ractor#take`
* `Ractor#close_incoming`
* `Ractor#close_outgoging`
* `ObjectSpace._id2ref` is deprecated.
=== Stdlib compatibility issues ===
* CGI library is removed from the default gems. Now we only provide `cgi/escape` for the following methods:
* `CGI.escape` and `CGI.unescape`
* `CGI.escapeHTML` and `CGI.unescapeHTML`
* `CGI.escapeURIComponent` and `CGI.unescapeURIComponent`
* `CGI.escapeElement` and `CGI.unescapeElement`
* With the move of `Set` from stdlib to core class, `set/sorted_set.rb` has been removed, and `SortedSet` is no longer an autoloaded constant. Please install the `sorted_set` gem and `require 'sorted_set'` to use `SortedSet`.
=== C API updates ===
* IO
** <code>rb_thread_fd_close</code> is deprecated and now a no-op. If you need to expose file descriptors from C extensions to Ruby code, create an <code>IO</code> instance using <code>RUBY_IO_MODE_EXTERNAL</code> and use <code>rb_io_close(io)</code> to close it (this also interrupts and waits for all pending operations on the <code>IO</code> instance). Directly closing file descriptors does not interrupt pending operations, and may lead to undefined behaviour. In other words, if two <code>IO</code> objects share the same file descriptor, closing one does not affect the other.
=== Implementation improvements ===
==== Ractor ====
A lot of work has gone into making Ractors more stable, performant, and usable. These improvements bring Ractors implementation closer to leaving experimental status.
* Performance improvements
** Frozen strings and the symbol table internally use a lock-free hash set
** Method cache lookups avoid locking in most cases
** Class (and geniv) instance variable access is faster and avoids locking
** Cache contention is avoided during object allocation
** <code>object_id</code> avoids locking in most cases
* Bug fixes and stability
** Fixed possible deadlocks when combining Ractors and Threads
** Fixed issues with require and autoload in a Ractor
** Fixed encoding/transcoding issues across Ractors
** Fixed race conditions in GC operations and method invalidation
** Fixed issues with processes forking after starting a Ractor
=== JIT ===
* YJIT
** YJIT stats
*** <code>ratio_in_yjit</code> no longer works in the default build. Use <code>--enable-yjit=stats</code> on <code>configure</code> to enable it on <code>--yjit-stats</code>.
*** Add <code>invalidate_everything</code> to default stats, which is incremented when every code is invalidated by TracePoint.
** Add <code>mem_size:</code> and <code>call_threshold:</code> options to <code>RubyVM::YJIT.enable</code>.
* ZJIT
** Add an experimental method-based JIT compiler. Use <code>--enable-zjit</code> on <code>configure</code> to enable the <code>--zjit</code> support.
** As of Ruby 3.5.0-preview2, ZJIT is not yet ready for speeding up most benchmarks. Please refrain from evaluating ZJIT just yet. Stay tuned for the Ruby 3.5 release.
* RJIT
** <code>--rjit</code> is removed. We will move the implementation of the third-party JIT API to the [https://github.com/ruby/rjit ruby/rjit] repository.
== Feedback ==
== Benefit to Fedora ==
With a latest release, Ruby language is supporting the newest language features, which enables even faster and easier development of Ruby applications.
== Scope ==
* Proposal owners:
** Finish packaging of Ruby 3.5. Current changes available in branch https://src.fedoraproject.org/fork/jackorp/rpms/ruby/commits/ruby-3.5
** Rebuilding of Ruby packages providing native extensions (i.e. packages which depends on libruby).
** Rebuild of packages with binary extensions (i.e. packages which depends on libruby) will be handled automatically, but some packages might need fixes/updates to support Ruby 3.5 properly.
** The packages are going to be rebuild in side-tag, but that does not need releng involvement nowadays.
* Trademark approval: N/A (not needed for this Change)
* Alignment with the Fedora Strategy:
== Upgrade/compatibility impact ==
* User specific Ruby binary extensions need to be rebuild.
* Adjustments to new language features will be needed.
* Ruby packages/application dependencies might need to be adjusted if newly bundled gems are used.
== Early Testing (Optional) ==
== How To Test ==
* No special hardware is needed.
* To test, install Ruby 3.5. The test builds are published in copr https://copr.fedorainfracloud.org/coprs/jackorp/ruby-3.5/
* Try to locally rebuild your packages using Ruby 3.5.
* Use the packages with your applications previously written in Ruby.
* If something doesn't work as it should, let us know.
== User Experience ==
The Ruby programs/scripts should behave as they were used to.
== Dependencies ==
<pre>
$ dnf repoquery --disablerepo='*' --enablerepo=rawhide --enablerepo=rawhide-source --arch=src --whatrequires 'ruby-devel' | sort | uniq | wc -l
116
</pre>
== Contingency Plan ==
== Documentation ==
* [http://www.ruby-doc.org/ Help and documentation for the Ruby programming language]
* [https://github.com/ruby/ruby/blob/master/NEWS.md Ruby 3.5.0 NEWS]
* [https://www.ruby-lang.org/en/news/2025/04/18/ruby-3-5-0-preview1-released/ Ruby 3.5.0 preview1 release announcement]
== Release Notes ==
* The Ruby 3.5 bumps soname, therefore Ruby packages, which use binary extensions, should be rebuilt. Nevertheless, since upstream paid great attention to source compatibility, no changes to your code are needed.
https://github.com/ruby/ruby/blob/master/NEWS.md
Discussion Thread: https://discussion.fedoraproject.org/t/f44-change-proposal-ruby-3-5-systemwide/172367
**This is a proposed Change for Fedora Linux.**
This document represents a proposed Change. As part of the Changes process, proposals are publicly announced in order to receive community feedback. This proposal will only be implemented if approved by the Fedora Engineering Steering Committee.
== Summary ==
Ruby 3.5 is the latest stable version of Ruby. Many new features and improvements are included for the increasingly diverse and expanding demands for Ruby. With this major update from Ruby 3.4 in Fedora 43 to Ruby 3.5 in Fedora 44, Fedora becomes the superior Ruby development platform.
== Owner ==
* Name: [[User:Jackorp1| Jaroslav Prokop]]
* Email: jprokop@redhat.com
* Name: [[User:Vondruch| Vít Ondruch]]
* Email: vondruch@redhat.com
* Name: [[User:mtasaka| Mamoru Tasaka]]
* Email: mtasaka@fedoraproject.org
== Detailed Description ==
Ruby 3.5 is upstream's new major release of Ruby. Many new features and improvements are included.
=== Language changes ===
* `*nil` no longer calls `nil.to_a`, similar to how `**nil` does not call `nil.to_hash`.
* Logical binary operators (`||`, `&&`, `and` and `or`) at the beginning of a line continue the previous line, like fluent dot.
=== Core classes updates ===
Note: We're only listing outstanding class updates.
* Kernel
* `Kernel#inspect` now checks for the existence of a `#instance_variables_to_inspect` method, allowing control over which instance variables are displayed in the `#inspect` string.
* Binding
* `Binding#local_variables` does no longer include numbered parameters. Also, `Binding#local_variable_get` and `Binding#local_variable_set` reject to handle numbered parameters.
* IO
* `IO.select` accepts `Float::INFINITY` as a timeout argument.
* Math
* `Math.log1p` and `Math.expm1` are added.
* Socket
* `Socket.tcp` & `TCPSocket.new` accepts `open_timeout` as a keyword argument to specify the timeout for the initial connection.
* Ractor
* `Ractor::Port` class was added for a new synchronization mechanism to communicate between Ractors.
* `Ractor::Port` provides the following methods:
* `Ractor::Port#receive`
* `Ractor::Port#send` (or `Ractor::Port#<<`)
* `Ractor::Port#close`
* `Ractor::Port#closed?`
* As result, `Ractor.yield` and `Ractor#take` were removed.
* `Ractor#join` and `Ractor#value` were added to wait for the termination of a Ractor. These are similar to `Thread#join` and `Thread#value`.
* `Ractor#monitor` and `Ractor#unmonitor` were added as low-level interfaces used internally to implement `Ractor#join`.
* `Ractor.select` now only accepts Ractors and Ports. If Ractors are given, it returns when a Ractor terminates.
* `Ractor#default_port` was added. Each `Ractor` has a default port, which is used by `Ractor.send`, `Ractor.receive`.
* `Ractor#close_incoming` and `Ractor#close_outgoing` were removed.
* `Ractor.shareable_proc` and `Ractor.shareable_lambda` is introduced to make shareable Proc or lambda.
* `Set`
* `Set` is now a core class, instead of an autoloaded stdlib class.
* String
* Update Unicode to Version 16.0.0 and Emoji Version 16.0. (also applies to Regexp)
* Thread
* Introduce support for `Thread#raise(cause:)` argument similar to `Kernel#raise`.
* Fiber
* Introduce support for `Fiber#raise(cause:)` argument similar to `Kernel#raise`.
* Fiber::Scheduler
* Introduce `Fiber::Scheduler#fiber_interrupt` to interrupt a fiber with a given exception. The initial use case is to interrupt a fiber that is waiting on a blocking IO operation when the IO operation is closed.
* Pathname
* Pathname has been promoted from a default gem to a core class of Ruby.
=== Stdlib updates ===
The following bundled gems are promoted from default gems.
* ostruct 0.6.3
* pstore 0.2.0
* benchmark 0.5.0
* logger 1.7.0
* rdoc 6.15.0
* win32ole 1.9.2
* irb 1.15.2
* reline 0.6.2
* readline 0.0.4
* fiddle 1.1.8
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.3.0 if it has GitHub releases.
The following default gem is added.
* win32-registry 0.1.1
The following default gems are updated.
* RubyGems 4.0.0.dev
* bundler 4.0.0.dev
* date 3.5.0
* digest 3.2.1
* english 0.8.1
* erb 5.1.3
* etc 1.4.6
* fcntl 1.3.0
* fileutils 1.8.0
* io-console 0.8.1
* io-nonblock 0.3.2
* io-wait 0.3.2
* json 2.15.2
* net-http 0.7.0
* openssl 4.0.0.pre
* optparse 0.8.0
* pp 0.6.3
* prism 1.6.0
* psych 5.2.6
* resolv 0.6.3
* stringio 3.1.8.dev
* strscan 3.1.6.dev
* timeout 0.4.4
* uri 1.1.0
* weakref 0.1.4
* zlib 3.2.2
The following bundled gems are added.
The following bundled gems are updated.
* minitest 5.26.0
* rake 13.3.1
* test-unit 3.7.0
* rexml 3.4.4
* net-ftp 0.3.9
* net-imap 0.5.12
* net-smtp 0.5.1
* matrix 0.4.3
* prime 0.1.4
* rbs 3.9.5
* debug 1.11.0
* base64 0.3.0
* bigdecimal 3.3.1
* drb 2.2.3
* syslog 0.3.0
* csv 3.3.5
* repl_type_completor 0.1.11
=== Supported platforms ===
=== Compatibility issues ===
* The following methods were removed from Ractor due because of `Ractor::Port`:
* `Ractor.yield`
* `Ractor#take`
* `Ractor#close_incoming`
* `Ractor#close_outgoging`
* `ObjectSpace._id2ref` is deprecated.
=== Stdlib compatibility issues ===
* CGI library is removed from the default gems. Now we only provide `cgi/escape` for the following methods:
* `CGI.escape` and `CGI.unescape`
* `CGI.escapeHTML` and `CGI.unescapeHTML`
* `CGI.escapeURIComponent` and `CGI.unescapeURIComponent`
* `CGI.escapeElement` and `CGI.unescapeElement`
* With the move of `Set` from stdlib to core class, `set/sorted_set.rb` has been removed, and `SortedSet` is no longer an autoloaded constant. Please install the `sorted_set` gem and `require 'sorted_set'` to use `SortedSet`.
=== C API updates ===
* IO
** <code>rb_thread_fd_close</code> is deprecated and now a no-op. If you need to expose file descriptors from C extensions to Ruby code, create an <code>IO</code> instance using <code>RUBY_IO_MODE_EXTERNAL</code> and use <code>rb_io_close(io)</code> to close it (this also interrupts and waits for all pending operations on the <code>IO</code> instance). Directly closing file descriptors does not interrupt pending operations, and may lead to undefined behaviour. In other words, if two <code>IO</code> objects share the same file descriptor, closing one does not affect the other.
=== Implementation improvements ===
==== Ractor ====
A lot of work has gone into making Ractors more stable, performant, and usable. These improvements bring Ractors implementation closer to leaving experimental status.
* Performance improvements
** Frozen strings and the symbol table internally use a lock-free hash set
** Method cache lookups avoid locking in most cases
** Class (and geniv) instance variable access is faster and avoids locking
** Cache contention is avoided during object allocation
** <code>object_id</code> avoids locking in most cases
* Bug fixes and stability
** Fixed possible deadlocks when combining Ractors and Threads
** Fixed issues with require and autoload in a Ractor
** Fixed encoding/transcoding issues across Ractors
** Fixed race conditions in GC operations and method invalidation
** Fixed issues with processes forking after starting a Ractor
=== JIT ===
* YJIT
** YJIT stats
*** <code>ratio_in_yjit</code> no longer works in the default build. Use <code>--enable-yjit=stats</code> on <code>configure</code> to enable it on <code>--yjit-stats</code>.
*** Add <code>invalidate_everything</code> to default stats, which is incremented when every code is invalidated by TracePoint.
** Add <code>mem_size:</code> and <code>call_threshold:</code> options to <code>RubyVM::YJIT.enable</code>.
* ZJIT
** Add an experimental method-based JIT compiler. Use <code>--enable-zjit</code> on <code>configure</code> to enable the <code>--zjit</code> support.
** As of Ruby 3.5.0-preview2, ZJIT is not yet ready for speeding up most benchmarks. Please refrain from evaluating ZJIT just yet. Stay tuned for the Ruby 3.5 release.
* RJIT
** <code>--rjit</code> is removed. We will move the implementation of the third-party JIT API to the [https://github.com/ruby/rjit ruby/rjit] repository.
== Feedback ==
== Benefit to Fedora ==
With a latest release, Ruby language is supporting the newest language features, which enables even faster and easier development of Ruby applications.
== Scope ==
* Proposal owners:
** Finish packaging of Ruby 3.5. Current changes available in branch https://src.fedoraproject.org/fork/jackorp/rpms/ruby/commits/ruby-3.5
** Rebuilding of Ruby packages providing native extensions (i.e. packages which depends on libruby).
** Rebuild of packages with binary extensions (i.e. packages which depends on libruby) will be handled automatically, but some packages might need fixes/updates to support Ruby 3.5 properly.
** The packages are going to be rebuild in side-tag, but that does not need releng involvement nowadays.
* Trademark approval: N/A (not needed for this Change)
* Alignment with the Fedora Strategy:
== Upgrade/compatibility impact ==
* User specific Ruby binary extensions need to be rebuild.
* Adjustments to new language features will be needed.
* Ruby packages/application dependencies might need to be adjusted if newly bundled gems are used.
== Early Testing (Optional) ==
== How To Test ==
* No special hardware is needed.
* To test, install Ruby 3.5. The test builds are published in copr https://copr.fedorainfracloud.org/coprs/jackorp/ruby-3.5/
* Try to locally rebuild your packages using Ruby 3.5.
* Use the packages with your applications previously written in Ruby.
* If something doesn't work as it should, let us know.
== User Experience ==
The Ruby programs/scripts should behave as they were used to.
== Dependencies ==
<pre>
$ dnf repoquery --disablerepo='*' --enablerepo=rawhide --enablerepo=rawhide-source --arch=src --whatrequires 'ruby-devel' | sort | uniq | wc -l
116
</pre>
== Contingency Plan ==
== Documentation ==
* [http://www.ruby-doc.org/ Help and documentation for the Ruby programming language]
* [https://github.com/ruby/ruby/blob/master/NEWS.md Ruby 3.5.0 NEWS]
* [https://www.ruby-lang.org/en/news/2025/04/18/ruby-3-5-0-preview1-released/ Ruby 3.5.0 preview1 release announcement]
== Release Notes ==
* The Ruby 3.5 bumps soname, therefore Ruby packages, which use binary extensions, should be rebuilt. Nevertheless, since upstream paid great attention to source compatibility, no changes to your code are needed.
https://github.com/ruby/ruby/blob/master/NEWS.md
No comments:
Post a Comment