rubygems 2.7 and updating devel/ruby-gems port
Thibault Jouan
tj+freebsd_ruby at a13.fr
Sun Nov 5 14:24:56 UTC 2017
hello,
I learned some time ago about important changes in future versions
of ruby and rubygems, regarding bundler usage
(https://bugs.ruby-lang.org/issues/12733). But I took the time to
prepare for those only recently.
I attempted to update the devel/ruby-gems port myself, and thought I
should give some feedback about my attempt and that I could share some
questions I have. But maybe the update is in progress and/or my
questions will be counterproductive, in that case please don't
hesitate to tell me.
My "work" is attached to this mail as a patch, but here are some
comments:
* rubygems 2.7.0 lacks the bundler gemspec, which cause the setup.rb
script to fail in
Gem::Commands::SetupCommand#install_default_bundler_gem,
`bundler_spec.files = ...' would fail as bundler_spec is nil, so I
moved to 2.7.1 directly (fixed by 240b798 commit in upstream git
repository);
* bundler gemspec requires the git program and the git repository, I
worked around this using Dir.glob;
* 909b5fb introduced `--[no-]regenerate-binstubs' option switch to
the `setup' command which in my case failed as there are no gems
installed at this point, since building devel/ruby-gems would be
required before installing any gem. I changed the default for this
option from true to false, as I think it's more sane, but
alternatively --no-regenerate-binstubs could be added to
RUBY_SETUP_OPTIONS in the Makefile I think. The `setup' command
ignores this option, so I added a test before calling
Gem::Commands::SetupCommand#regenerate_binstubs. For those last
two points, I'll try to report a patch upstream, as it's not
related to the FreeBSD port but looks like a bug.
* Then in Gem::Commands::SetupCommand#install_default_bundler_gem
again, I had a failure when calling Dir.entries on an nonexistent
dir, which I changed to test directory existence first.
I don't know if all those changes are correct, but the package
almost build in poudriere. The last (I hope) problem is this error I
get:
====>> Checking for staging violations... done
====>> Error: Filesystem touched during stage (files must install to ${STAGEDIR}):
extra: usr/local/lib/ruby/gems
If I understand correctly this directory is created by
Gem::Commands::SetupCommand#install_rdoc, but as far as I understand,
it's the same with the port currently in the tree (2.6.14), so I must
miss something. I blocked on this issue, and did not yet try to force
building the port to play with it. I hoped to get the testport command
to pass first; I tested only with `DOCS' option enabled so far.
If anyone has any idea about why I get the staging violation error,
I'd be happy to know (I started reading poudriere source code but do
not understand everything yet). I don't want to waste the precious
time of maintainers for ruby-related FreeBSD ports, so I'll understand
if I'll have to wait for the real update to happen.
My update attempt is naive, I questioned myself if the "bundler"
part should stay an independent port, however I don't think it's
possible or easy to handle the fact that new rubygems would depends on
sysutils/rubygem-bundler… which itself would depend on rubygems
itself. I would have preferred rubygems did not start to use bundler,
but I think it's out of our control.
I use this opportunity to thank all maintainers and committers
working on ruby related ports!
--
Thibault Jouan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: devel_ruby-gems-2.7.1.patch
Type: text/x-diff
Size: 15796 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-ruby/attachments/20171105/be8182f8/attachment.patch>
More information about the freebsd-ruby
mailing list