Bug 199141 - lang/ruby22: [PATCH][feature request] completely cleanup of gem functions
Summary: lang/ruby22: [PATCH][feature request] completely cleanup of gem functions
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Steve Wills
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-04-03 08:29 UTC by ksmakoto
Modified: 2016-08-14 02:07 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (ruby)


Attachments
add config option to cleanup gem functions completely (18.80 KB, patch)
2015-04-03 08:29 UTC, ksmakoto
no flags Details | Diff
patch to fully remove gem from ruby and add ri docs to gem (285.92 KB, patch)
2015-04-12 11:53 UTC, Steve Wills
no flags Details | Diff
fully remove gem from ruby, add ri docs to gem and fix ports broken by change (295.94 KB, patch)
2015-04-13 17:06 UTC, Steve Wills
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ksmakoto 2015-04-03 08:29:40 UTC
Created attachment 155150 [details]
add config option to cleanup gem functions completely

In ports, ruby components of gem is installed by devel/ruby-gems ports, but lang/ruby?? has their components too, it is source of trouble.

This patch add config option to cleanup gem functions completely.
Comment 1 Steve Wills freebsd_committer freebsd_triage 2015-04-12 11:53:27 UTC
Created attachment 155506 [details]
patch to fully remove gem from ruby and add ri docs to gem

Thought this shouldn't be optional, so here's an updated patch which removes it completely. Also made some minor cleanups while here, including adding the ri docs to devel/ruby-gems. So far this breaks a few things, so I'm going to work on cleaning those up before committing. In the mean time, please test.
Comment 2 ksmakoto 2015-04-12 12:59:02 UTC
I've tested new patch with ruby22 in my FreeBSD 10.1-RELEASE-p6, it works well.
Comment 3 Steve Wills freebsd_committer freebsd_triage 2015-04-13 13:02:27 UTC
(In reply to ksmakoto from comment #2)

Thanks for the testing. I've been testing too and found that it breaks a number of ports. Some, such as devel/rubygem-glib2 and devel/rubygem-gio2 just need to have:

require "rubygems"

added in certain places.

Others, such as databases/ruby-bdb break because they call rdoc and rdoc requires gem. I can patch out the requirement of gem in rdoc, but I can't be sure it will work properly. Upstream, ruby, rdoc and gem are all distributed together and it makes sense for them to depend on each other. So I'm a bit hesitant to go changing things too much.

This all makes me unsure that removing the gem bits from ruby is the right thing to do. Can you explain in more detail the original issues that you encountered? What is the trouble you have when gem is included with ruby? (Not saying it's not real, just want to understand all sides of the issue before making a decision which way to go.)
Comment 4 Steve Wills freebsd_committer freebsd_triage 2015-04-13 17:06:35 UTC
Created attachment 155553 [details]
fully remove gem from ruby, add ri docs to gem and fix ports broken by change

Here's an updated patch which fixes some of the issues caused by the change. Still would like more detail on the original issue before I decide if this is the right way forward.
Comment 5 Steve Wills freebsd_committer freebsd_triage 2015-04-13 17:19:46 UTC
Forgot to mention that patch has some other cleanups as well.
Comment 6 ksmakoto 2015-04-14 11:30:39 UTC
A few days ago, I installed rubygems in $HOME/.gem/lib (without ruby-gems ports), and something went wrong. It looks that the environment var RUBYOPT=-I$HOME/.gem/lib does not working well. I was deleted rubygems in /usr/local/lib/ruby/2.2 (and --disable=gems option), it looks working well.

Just now, I try to reproduce it, but RUBYOPT=-I$HOME/.gem/lib looks working correctly, sorry.

If deletion seems overdone, be --disable-rubygems configure arg only, and/or make this optional, how is this?
Comment 7 Steve Wills freebsd_committer freebsd_triage 2015-05-16 20:55:52 UTC
Also it should be noted that irb calls Gem:

https://github.com/ruby/ruby/blob/11b97855c4c1ef756fa1546ff0137aad1a910f34/lib/irb/locale.rb#L149

So I'm really not sure about this. It would seem cleaner to completely remove gem and makes updates to gem easier. But this seems to break irb and is unexpected to many. I think our current situation may be the best compromise. Perhaps if we keep moving ruby forward and gem doesn't change as much it would make sense to install gem with ruby.
Comment 8 Steve Wills freebsd_committer freebsd_triage 2016-08-14 02:07:30 UTC
Closing this as I've decided it's not a good change or direction.