From Fedora Project Wiki
(→‎Owner: Add mtasaka as change owner)
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 25: Line 25:


== Current status ==
== Current status ==
[[Category:ChangeReadyForWrangler]]
[[Category:ChangeReadyforFesco]]
<!-- When your change proposal page is completed and ready for review and announcement -->
<!-- When your change proposal page is completed and ready for review and announcement -->
<!-- remove Category:ChangePageIncomplete and change it to Category:ChangeReadyForWrangler -->
<!-- remove Category:ChangePageIncomplete and change it to Category:ChangeReadyForWrangler -->
Line 42: Line 42:
ON_QA -> change is fully code complete
ON_QA -> change is fully code complete
-->
-->
* [Announced]
* [https://lists.fedoraproject.org/archives/list/devel-announce@lists.fedoraproject.org/thread/VDLFJYNG7QR2AAR45UAFJOMMJFIOJG66/ Announced]
* [<will be assigned by the Wrangler> Discussion thread]
* [https://discussion.fedoraproject.org/t/f42-change-proposal-ruby-3-4-system-wide/138984 Discussion thread]
* FESCo issue: <will be assigned by the Wrangler>
* FESCo issue: [https://pagure.io/fesco/issue/3302 #3302]
* Tracker bug: <will be assigned by the Wrangler>
* Tracker bug: <will be assigned by the Wrangler>
* Release notes tracker: <will be assigned by the Wrangler>
* Release notes tracker: <will be assigned by the Wrangler>

Latest revision as of 20:53, 16 December 2024


Ruby 3.4

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.4 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.3 in Fedora 41 to Ruby 3.4 in Fedora 42, Fedora becomes the superior Ruby development platform.

Owner

Current status

Detailed Description

Ruby 3.4 is upstream's new major release of Ruby. Many new features and improvements are included.

Prism

Switch the default parser from parse.y to Prism to improve maintainability, error tolerance, portability, and performance.

Language changes

  • String literals in files without a frozen_string_literal comment now emit a deprecation warning when they are mutated.
  • it is added to reference a block parameter.
  • Keyword splatting nil when calling methods is now supported.**nil is treated similarly to **{}, passing no keywords, and not calling any conversion methods.
  • Block passing is no longer allowed in index.
  • Keyword arguments are no longer allowed in index.#20218]]

Core classes updates

  • Exception
    • Exception#set_backtrace now accepts an array of Thread::Backtrace::Location. Kernel#raise, Thread#raise and Fiber#raise also accept this new format.
  • Range
    • Range#size now raises TypeError if the range is not iterable.

Compatibility issues

  • Error messages and backtrace displays have been changed.
    • Use a single quote instead of a backtick as a opening quote.
    • Display a class name before a method name (only when the class has a permanent name).
    • Kernel#caller, Thread::Backtrace::Location's methods, etc. are also changed accordingly.
  • Hash#inspect rendering has changed.
    • Symbol keys are displayed using the modern symbol key syntax: "{user: 1}"
    • Other keys now have spaces around =>: '{"user" => 1}', while previously they didn't: '{"user"=>1}'

C API updates

  • rb_newobj and rb_newobj_of (and corresponding macros RB_NEWOBJ, RB_NEWOBJ_OF, NEWOBJ, NEWOBJ_OF) have been removed.
  • Removed deprecated function rb_gc_force_recycle.

Implementation improvements

  • Array#each is rewritten in Ruby for better performance.

Miscellaneous changes

  • Passing a block to a method which doesn't use the passed block will show a warning on verbose mode (-w).
  • Redefining some core methods that are specially optimized by the interpeter and JIT like String.freeze or Integer#+ now emits a performance class warning (-W:performance or Warning[:performance] = true).

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

  • Other developers:
    • 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.4 properly.
  • Release engineering: #12469
    • The packages are going to be rebuild in side-tag, but that does not need releng involvement nowadays.
  • Policies and guidelines: N/A (not needed for this Change)
  • 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)

Do you require 'QA Blueprint' support? No

How To Test

  • No special hardware is needed.
  • To test, install Ruby 3.4. The test builds are published in PR or on Ruby-SIG ML
  • Try to locally rebuild your packages using Ruby 3.4.
  • 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

$ dnf repoquery --disablerepo=* --enablerepo=rawhide --enablerepo=rawhide-source --arch=src --whatrequires 'ruby-devel' | sort | uniq | wc -l
122

Contingency Plan

  • Contingency mechanism: We would like to get a special buildroot tag to be able to rebuild necessary the packages with Ruby 3.4. If anything goes wrong, the tag could be easily dropped and previous version of Ruby 3.3 and its dependencies stays intact. The tag would be merged into F42 after everything is rebuild.
  • Contingency deadline: Mass Rebuild
  • Blocks release? No


Documentation

Release Notes

  • The Ruby 3.4 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/ruby_3_4/NEWS.md