Difference between revisions of "Ruby-kit"

From Funtoo
Jump to navigation Jump to search
Line 28: Line 28:
* {{c|ruby-single.eclass}}
* {{c|ruby-single.eclass}}
* {{c|ruby-utils.eclass}}
* {{c|ruby-utils.eclass}}
== Change Details ==

The most notable changes are in the following files:
The most notable changes are in the following files:

Revision as of 02:45, January 5, 2021

Ruby-kit is a Funtoo kit (see FAQ:What Are Funtoo Kits) which contains the Ruby language itself as well as Ruby modules.


The currently-active branch of Ruby-kit is 2.7-prime, created in early January 2021 by Funtoo, and is based on a snapshot of Gentoo Ruby ebuilds from late December 2020. It is an auto-generated kit which will allow more frequent updates.

At the time 2.7-prime was created, the Gentoo Ruby Team was focusing on integrating support for Ruby 3.0 into Gentoo. Another notable event happening at around this time was the deprecation of Ruby 2.5 by the Ruby team itself, as it is currently in maintenance mode and nearing EOL. These events were factored into the plan for Ruby-kit related to supported versions.

Supported Ruby Versions

The Ruby versions available in 2.7-prime are:

This is the Funtoo OS "preferred" Ruby for satisfying system dependencies. This is the Ruby version that applications will try to use if 2.7 support is actually available in ebuilds and dependencies.
This is the Funtoo OS "compatible" Ruby for satisfying system dependencies. This is the version that all applications are likely to support and is more universally supported in ebuilds. 2.6 is also our **backup** version of Ruby that is used by our eclass logic.
This version of Ruby is being made available but is not currently used for resolving dependencies for Funtoo systems. It can be installed by Ruby developers and Ruby modules can be installed via gem.

Funtoo Changes

Ruby-kit 2.7-prime has a number of important Funtoo changes which are documented here.

The ruby-*.eclass eclasses have been forked and are stored in our kit-fixups repository, in core-kit/curated/eclasses, so they will end up on end-user systems inside Core-kit and will be available to all kits.

The forked eclasses are:

  • ruby-fakegem.eclass
  • ruby-ng.eclass
  • ruby-ng-gnome2.eclass
  • ruby-single.eclass
  • ruby-utils.eclass

Change Details

The most notable changes are in the following files:

Aggressively mask USE_RUBY based on our RUBY_TARGETS settings. If we mask all implementations, add BACKUP_RUBY as backup implementation (currently 2.6).
In _ruby_get_all_impls(), aggressively mask USE_RUBY ebuild settings based on our RUBY_TARGETS settings. Implement BACKUP_RUBY logic. Also change IUSE calculation to not aggressively mask IUSE settings, since the ebuild could have some logic based on some of the Ruby targets we masked out, and not having these targets in IUSE will cause Portage to complain.

The eclass changes, taken as a whole, allow Funtoo to set the Ruby implementation(s) active in Funtoo more easily. Traditionally, in Gentoo, Ruby implementations are set based on RUBY_TARGETS, which is defined in the profiles and set to something like this:

   make.defaults (bash source code)
RUBY_TARGETS="ruby27 ruby26"

In addition, Ruby-using ebuilds that leverage the Ruby eclasses will set something like this:

   ruby-using.ebuild (bash source code)
USE_RUBY="ruby25 ruby26 ruby27 ruby30"

The Funtoo changes cause the USE_RUBY settings in ebuilds to be more aggressively masked based on the Funtoo OS settings for RUBY_TARGETS. In addition, if our more aggressive masking causes a Ruby module or package to not have any valid Ruby implementations, a "backup" typically safe Ruby implementation will be enabled automatically.