This Time Self-Hosted
dark mode light mode Search

Gentoo Ruby: less is more

Yesterday, after a mostly unrelated bug report, Alex and me noticed that Ruby 1.9.2_rc2 was still bundling a few gems. Bundling, as I have written too many times to link properly, is a bad habit, but an unfortunately common one in the Ruby landscape; luckily the use of more modern methods, such as bundler, can make it more manageable (bundler will reuse the installed copies, and is designed not to let the gems be versioned with the rest of the code in the same repository; but this is getting off topic so let’s stop here).

The problem with the Ruby interpreter bundling code is mostly tied to two problems: with a few exceptions, the bundled libraries are still developed standalone, causing some extension to require a standalone copy of the libraries (because they added functions or fixed bugs); when that happens, we also risk that the code does not mix too well. Funnily enough, Ruby 1.9 stopped bundling Test::Unit, and now that it’s developed standalone, it’s causing enough headaches (not all software works fine with Test::Unit 2; we’ve had to resuscitate version 1.2.3 for Ruby 1.9 only, and we block version 2 from those packages who fail to build when it’s installed).

Doing this unbundling also caused two changes to the handling of virtuals: removing RDoc (version 2.5.8) from Ruby 1.9.2_rc2 means that Ruby 1.9 is no longer providing rdoc (but 1.8, EE and JRuby do), so we need a new virtual/ruby-rdoc; removing minitest instead means the only provider of that interface is dev-ruby/minitest, and thus we no longer need the standalone virtual. This simplifies a lot because there are a number of packages that really need the 1.7.0 version of minitest, while Ruby 1.9 still bundles 1.6.0.

But looking at it, also shown that there are two further packages that were bundled before (and are no longer, thankfully): racc and json. The latter is quite unexpected to me, given that a lot of gems needed it separated anyway, and it’s not registered as a gem at all.

And finally, while I was at it, I also removed the remaining code of RubyGems from the interpreter-installed libraries (given that way too many packages needed a full-blown copy of rubygems with Rake tasks and all the shizzle).

The end of the story is that now we got a slimmer, smaller Ruby 1.9 install, and the declaration of dependencies should be all correctly set. Having unbundled RDoc also means that we might have less work to do to make API doc generation to work on Ruby 1.9.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.