Jump to: navigation, search


3,215 bytes added, 5 months ago
no edit summary
* {{c|ruby-single.eclass}}
* {{c|ruby-utils.eclass}}
== The Problem Being Solved ==
These changes were made to solve a specific issue. We have found that in Gentoo, Ruby versions (this also happens with Python versions) can be very "sticky". By "sticky", I mean that it can be very
hard to get rid of an older version of Ruby (or Python), and upstream Gentoo tends to try to handle this by orchestrating a mass purge of all ebuilds that reference this older implementation. Only
then can this older version of the language be removed or deprecated in Gentoo. This involves updating hundreds of ebuilds, which is a lot of manual work, and thus isn't really a great solution. But
it does fit in with the Gentoo model of having a large development team that "shuffles" individual ebuilds along to either add support for new language versions, or drop old versions. For Funtoo,
this isn't really a workable option so a better solution was needed.
For Funtoo, I wanted to have a way to define what versions of Ruby were active in a build of Funtoo, in as central a way as possible, and not have annoying, soul-crushing dependency problems that
users or Funtoo developers had to deal with. The solution used was to modify Ruby eclasses to more aggressively mask the {{c|USE_RUBY}} settings from the ebuilds based on what Ruby implementation
we actually want "active" in Funtoo.
A specific issue I wanted to address was to be able to easily deprecate Ruby 2.5. And yet, many ebuilds still referenced {{c|ruby25}} or even earlier as the maximum version that they support. To fix this issue, I
introduced an idea of a "backup Ruby version" which would get enabled if our more aggressive masking of {{c|USE_RUBY}} resulted in a Ruby package or module not having support for ''any'' Ruby
implementation at all. In this case, the eclass will enable the backup Ruby version -- in this case Ruby 2.6, which has a high degree of compatibility with Ruby 2.5 that we are deprecating so it
is likely to work in the majority of cases for older Ruby ebuilds, and in the few cases where it may not, we can deal with these problems on a case-by-case basis.
This way, we can set Ruby 2.6 as our "baseline", or "compatibility" version that our minimum supported version in Funtoo ebuilds. Ensuring everything works with 2.6 should not be tremendously hard,
and we can move to 2.6 without changing every single ebuild that only references a 2.5 or earlier Ruby version.
These masking changes also have an interesting side-effect where we can make Ruby 3.0 available for developers, but Ruby-using packages will not actually depend on Ruby 3.0, ''even if they reference
{{c|ruby30}} in {{c|USE_RUBY}}, until we "flip the switch" and tweak our eclasses. This allows Ruby 3.0 to be available to merge but not get entangled in system dependencies. This does mean that you
would need to install Ruby 3.0 dependencies using {{c|gem}}, which is a fine solution since no ebuilds in Funtoo will need any ruby-module ebuilds installed. Basically we create a clean-room where
Ruby 3.0 can be used for now, until it becomes the official Ruby implementation in a future version of this kit -- when we choose.
== Change Details ==
The Funtoo changes cause the {{c|USE_RUBY}} settings in ebuilds to be more aggressively ''masked'' based on the Funtoo OS settings for {{c|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.
This gives us the ability to "focus" our Ruby support around specific versions of Ruby.
[[Category:Official Documentation]]
Bureaucrats, Administrators, wiki-admins, wiki-staff

Navigation menu