F42 Change Proposal: Ruby 3.4 (System-Wide)

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.

Wiki
Announced

:link: 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.

:link: Owner

:link: Detailed Description

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

:link: Prism

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

:link: 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]]

:link: 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.

:link: 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}'

:link: 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.

:link: Implementation improvements

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

:link: 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).

:link: Feedback

:link: 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.

:link: Scope

  • Proposal owners:

  • 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:

:link: 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.

:link: Early Testing (Optional)

Do you require ‘QA Blueprint’ support? No

:link: 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.

:link: User Experience

The Ruby programs/scripts should behave as they were used to.

:link: Dependencies

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

:link: 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

:link: Documentation

:link: 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

Last edited by @amoloney 2024-12-03T18:17:53Z

Last edited by @amoloney 2024-12-03T18:17:53Z

How do you feel about the proposal as written?

  • Strongly in favor
  • In favor, with reservations
  • Neutral
  • Opposed, but could be convinced
  • Strongly opposed
0 voters

If you are in favor but have reservations, or are opposed but something could change your mind, please explain in a reply.

We want everyone to be heard, but many posts repeating the same thing actually makes that harder. If you have something new to say, please say it. If, instead, you find someone has already covered what you’d like to express, please simply give that post a :heart: instead of reiterating. You can even do this by email, by replying with the heart emoji or just “+1”. This will make long topics easier to follow.

Please note that this is an advisory “straw poll” meant to gauge sentiment. It isn’t a vote or a scientific survey. See About the Change Proposals category for more about the Change Process and moderation policy.

Looking forward to puppet breaking again. :frowning: (Not that it’s an argument against keeping ruby up to date, just…ugh, puppet.)

Yeah, sorry for that :frowning:

But if you executed at last a bit of test suite during the build of the package, it would at least give us a clue how much broken it is. Because frankly from my POV it looks OK:

https://copr.fedorainfracloud.org/coprs/vondruch/mpb.7/build/8339431/

(sorry, the link could stop working any time)

This change proposal has now been submitted to FESCo with ticket #3302 for voting.

To find out more, please visit our Changes Policy documentation.

I don’t know Ruby well at all – are the symbols and macros that were removed from the C API widely used, i.e. would this affect native Ruby extensions in Fedora? Or do you expect this to go smoothly?

Mini mass rebuild is expected and will be handled by members of Ruby SIG. So far, all native packages build fine according to our testing.

Outside of RPM world, it is a bit harder. But generally, for applications using Bundler, bundler install or similar command should help with refresh of their locked dependencies and gem pristine should help with gems in their home directory. But still, I hope that we provide majority of the common gems with binary extensions in Fedora, so the impact should be hopefully minimal.

2 Likes

This change has been accepted by FESCo for Fedora Linux 42. A full list of approved changes to date can be found on the Change Set Page.

To find out more about how our changes policy works, please visit our docs site.