Bug 589801 - rubygem-json requires gtk...why?
rubygem-json requires gtk...why?
Status: CLOSED ERRATA
Product: Fedora EPEL
Classification: Fedora
Component: rubygem-json (Show other bugs)
el5
All Linux
low Severity medium
: ---
: ---
Assigned To: Xavier Lamien
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks: 588364
  Show dependency treegraph
 
Reported: 2010-05-06 18:04 EDT by Michael Stahnke
Modified: 2010-09-14 13:30 EDT (History)
2 users (show)

See Also:
Fixed In Version: rubygem-json-1.4.3-3.el5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-09-14 13:30:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Stahnke 2010-05-06 18:04:28 EDT
Description of problem:
when I try to install rubygem-json it tries to pull in gtk libs.  Json is text formatting and I can't understand at all why it would need GTK2 libs. I have rebuilt it locally without the requires on GTK and everything seems to be ok.  Also when I build from gems upstream (gem install json) it does not complain about the lack of gtk libs.  


Version-Release number of selected component (if applicable):
1.1.7


How reproducible:
Always


Steps to Reproduce:
1. yum install rubygem-json
notice it requires ruby-gtk2

  
Actual results:
notice it requires ruby-gtk2


Expected results:
It does not require graphic libs for a text parsing gem. 

Additional info:  If you'd like me to fix this bug, I am happy to.  If there is some reason for GTK to be in the requires and I have missed it, please let me know.  I am also happy to co-maintain the package in EPEL5 if you'd like.

I need this fixed to fix bug 588364
Comment 1 Mamoru TASAKA 2010-05-07 00:24:46 EDT
Hello, I was the reviewer of rubygem-json.

This is because /usr/bin/edit_json.rb surely requires gtk2.
https://bugzilla.redhat.com/show_bug.cgi?id=504424#c3
- /usr/bin/edit_json.rb:
    19  load Gem.bin_path('json', 'edit_json.rb', version)
- /usr/lib/ruby/gems/1.8/gems/json-1.1.9/lib/json/editor.rb
     1  # To use the GUI JSON editor, start the edit_json.rb executable script. It
     2  # requires ruby-gtk to be installed.
     3  
     4  require 'gtk2'

However installing ruby-gtk2 surely adds many additional dependency.
Also I am not sure how often edit_json.rb is used. So the possible
solution is:

- seave this dependency as it is
- split out edit_json.rb related files into subpackage

How do you think, Xavier and Michael? (Maybe it is better that
this is discussed on ruby-sig mailing list)
Comment 2 Mamoru TASAKA 2010-05-07 00:43:44 EDT
(By the way splitting out edit_json.rb related files means that
 on EL-5 these files should be _deleted_ if ruby-gnome2 does not
 exist on EL-5)
Comment 3 Michael Stahnke 2010-05-07 09:36:11 EDT
I think at minimum we should split out edit_json.rb into another sub-package.  It still seems odd to me to require it.  Things like puppet can use ruby-ldap for certain feature, or active_record, but the puppet package doesn't require them to install, only if you want to use certain features would you need those. 

I'll vote for sub-packaging in this case.   I am happy to discuss on ruby-sig list also.
Comment 4 Xavier Lamien 2010-05-07 10:43:32 EDT
Hey,

Yeah, split it out would be good.
Will take care of this this weekend.
Comment 5 Mamoru TASAKA 2010-05-07 11:13:29 EDT
Okay, then let's split out the 2 files
- /usr/bin/edit_json.rb
- /usr/lib/ruby/gems/1.8/gems/json-1.1.9/lib/json/editor.rb
into -gui subpackage or so.
(Note that ruby-gnome2 does not exist on EPEL-5 currently, so
 on EPEL-5 these files should be removed because these files
 won't work anyway due to missing dependency)
Comment 6 Xavier Lamien 2010-05-09 13:22:31 EDT
Fixed.
Comment 7 Mamoru TASAKA 2010-05-09 15:21:10 EDT
2 issues:

A. for EL-5 package:
--------------------------------------------------------------
# rpm -qp --requires rubygem-json-1.4.3-1.el5.i386.rpm | grep gtk2
ruby(gtk2)  
--------------------------------------------------------------
   So ruby(gtk2) dependency still remains.

B. for F-14/13 package:
--------------------------------------------------------------
# env LANG=C rpm -Uvh rubygem-json-1.4.3-1.fc13.i686.rpm ruby-json-1.4.3-1.fc13.i686.rpm 
Preparing...                ########################################### [100%]
   1:rubygem-json           ########################################### [ 50%]
   2:ruby-json              ########################################### [100%]
# rpm -ql ruby-json | grep edit 
/usr/lib/ruby/site_ruby/1.8/json/editor.rb
# ls -al /usr/lib/ruby/site_ruby/1.8/json/editor.rb
lrwxrwxrwx 1 root root 52 2010-05-10 04:13 /usr/lib/ruby/site_ruby/1.8/json/editor.rb -> ../../../gems/1.8/gems/json-1.4.3/lib/json/editor.rb
# env LANG=C cat /usr/lib/ruby/site_ruby/1.8/json/editor.rb
cat: /usr/lib/ruby/site_ruby/1.8/json/editor.rb: No such file or directory
--------------------------------------------------------------
   With only rubygem-json and ruby-json installed, 
   /usr/lib/ruby/site_ruby/1.8/json/editor.rb (in ruby-json) becomes
   a broken symlink because 
   /usr/lib/ruby/gems/1.8/gems/json-1.4.3/lib/json/editor.rb is
   in rubygem-json-gui.
Comment 8 Mamoru TASAKA 2010-05-09 15:26:14 EDT
By the way for F-13 / EPEL-5, the rebuilt packages have to
be submitted on bodhi.
Comment 9 Xavier Lamien 2010-05-10 03:50:01 EDT
#comment 7
Craps, forget to remove it as well in epel

#comment 8
Yeah, know that. I was just waiting a review from you before push anything.
Will fix this today.
Comment 10 Xavier Lamien 2010-05-11 07:44:08 EDT
Mamoru,

I did a rebuild yesterday, could you test before i request a push?

thx,
Comment 11 Mamoru TASAKA 2010-05-11 08:42:27 EDT
Hi:

For EL-5:
---------------------------------------------------
# Also remove gtk2 editor as ruby-gnome2 is not in rhel5
find $RPM_BUILD_ROOT -name "editor.rb" -a -name "edit_json.rb" -exec rm {} \;
---------------------------------------------------
I guess this does nothing... (I guess "-or" instead of "-a")

For F-13:
When only rubygem-json and rubygem-json-gui are installed:
----------------------------------------------------
# rubygem-json-1.4.3-2.fc13.i686.rpm rubygem-json-gui-1.4.3-2.fc13.i686.rpm 
Preparing...                ########################################### [100%]
   1:rubygem-json           ########################################### [ 50%]
   2:rubygem-json-gui       ########################################### [100%]
# rpm -qf /usr/lib/ruby/site_ruby/1.8/json/editor.rb
rubygem-json-gui-1.4.3-2.fc13.i686
# rpm -qf /usr/lib/ruby/site_ruby/1.8/json          
file /usr/lib/ruby/site_ruby/1.8/json is not owned by any package
-----------------------------------------------------
With -2, the directory /usr/lib/ruby/site_ruby/1.8/json is owned
by ruby-json (and rubygem-json-gui should not require ruby-json)

One resolution is to create ruby-json-gui package, move
/usr/lib/ruby/site_ruby/1.8/json/editor.rb to ruby-json-gui, and
make ruby-json-gui have "Requires: ruby-json" (although
in this case ruby-json-gui has only one file...)
Comment 12 Michael Stahnke 2010-05-19 18:38:52 EDT
>One resolution is to create ruby-json-gui package, move
>/usr/lib/ruby/site_ruby/1.8/json/editor.rb to ruby-json-gui, and
>make ruby-json-gui have "Requires: ruby-json" (although
>in this case ruby-json-gui has only one file...)   

I'd vote for this.  It would be much easier for EPEL, I think.
Comment 13 Xavier Lamien 2010-05-19 18:42:11 EDT
nod.
will fix this asap
Comment 14 Michael Stahnke 2010-06-11 12:31:32 EDT
Any update on this for EPEL?  It's blocking a bug I have open.
Comment 15 Xavier Lamien 2010-06-11 14:08:37 EDT
Ho craps, thanks for the head's up.
Will look at it in a few hours.
Comment 16 Xavier Lamien 2010-06-11 17:01:27 EDT
(In reply to comment #11)
> Hi:
> 
> For EL-5:
> ---------------------------------------------------
> # Also remove gtk2 editor as ruby-gnome2 is not in rhel5
> find $RPM_BUILD_ROOT -name "editor.rb" -a -name "edit_json.rb" -exec rm {} \;
> ---------------------------------------------------
> I guess this does nothing... (I guess "-or" instead of "-a")

looks like this option doesn't work as expected.
Fixed.

> 
> For F-13:
> When only rubygem-json and rubygem-json-gui are installed:
> ----------------------------------------------------
> # rubygem-json-1.4.3-2.fc13.i686.rpm rubygem-json-gui-1.4.3-2.fc13.i686.rpm 
> Preparing...                ########################################### [100%]
>    1:rubygem-json           ########################################### [ 50%]
>    2:rubygem-json-gui       ########################################### [100%]
> # rpm -qf /usr/lib/ruby/site_ruby/1.8/json/editor.rb
> rubygem-json-gui-1.4.3-2.fc13.i686
> # rpm -qf /usr/lib/ruby/site_ruby/1.8/json          
> file /usr/lib/ruby/site_ruby/1.8/json is not owned by any package
> -----------------------------------------------------
> With -2, the directory /usr/lib/ruby/site_ruby/1.8/json is owned
> by ruby-json (and rubygem-json-gui should not require ruby-json)

moved to ruby-json-gui
And rubygem-json-gui requires rubygem-json

> 
> One resolution is to create ruby-json-gui package, move
> /usr/lib/ruby/site_ruby/1.8/json/editor.rb to ruby-json-gui, and
> make ruby-json-gui have "Requires: ruby-json" (although
> in this case ruby-json-gui has only one file...)    

alrighty, there's a scratch build at http://koji.fedoraproject.org/koji/taskinfo?taskID=2245664
Could you test it so that I can re-tag and build for live.
Comment 17 Michael Stahnke 2010-06-15 17:40:00 EDT
I'll try to grab this tonight for testing.  I don't have F13 at work. The needs I have are primarily for EPEL.
Comment 18 Michael Stahnke 2010-06-21 14:28:47 EDT
I apparently missed the window that had that scratch build live.  I am sorry.  As long as the requirements for GTK were removed, I'll probably be happy.  I just want to be able to install the json gem on servers without pulling in the entire gtk stack.
Comment 19 Michael Stahnke 2010-07-22 10:39:58 EDT
any update on this?
Comment 20 Xavier Lamien 2010-07-22 10:55:05 EDT
Yeah, can you try this one so that I can push this to bodhi?

http://koji.fedoraproject.org/koji/taskinfo?taskID=2340697
Comment 21 Michael Stahnke 2010-07-22 11:14:01 EDT
Working fine.  Was it intentional to have ruby-json require rubygem-json?  They appear to provide different files, which is mildly confusing to me.  Either way, my main concern was having to pull in GTK libs to parse json.  That looks like it is fixed.  Thanks.
Comment 22 Mamoru TASAKA 2010-07-22 11:37:17 EDT
(In reply to comment #21)
> Was it intentional to have ruby-json require rubygem-json?
- It is because files in ruby-json are actually symlinks to files
  in rubygem-json, and also this is a must item on:
  https://fedoraproject.org/wiki/Packaging/Ruby#Packaging_for_Gem_and_non-Gem_use

For EPEL-5, it looks good.
For devel and F-13, one need fixing.
- Currently with only rubygem-json and rubygem-json-gui installed,
  * the directory %{ruby_sitelib}/%{gemname} is not owned by
    any packages (this directory is owned by ruby-json)
  * however rubygem-json-gui has one file (editor.rb) under
    %{ruby_sitelib}/%{gemname}

One possible solution is to move "%dir %{ruby_sitelib}/%{gemname}" from
ruby-%{gemname} to main package.
Comment 23 Michael Stahnke 2010-08-04 10:09:02 EDT
Any update?  This is still blocking a bug I have open in EPEL.
Comment 24 Xavier Lamien 2010-08-04 11:38:06 EDT
I will update to latest release later tonight and merge the fix as well.

in reply to comment #22
Fixed as well in F-12 and F-13 just not committed yet.
Comment 25 Xavier Lamien 2010-08-04 21:22:40 EDT
alright thing has been pushed to scm, however, fedpkg won't let me build due to broken python attribute and I can't request build directly from koji.

Will check that closer tomorrow hopefully.
Comment 26 Mamoru TASAKA 2010-08-05 13:59:17 EDT
(In reply to comment #25)
> alright thing has been pushed to scm, however, fedpkg won't let me build due to
> broken python attribute and I can't request build directly from koji.
> 
> Will check that closer tomorrow hopefully.    

Install the newest koji package:
https://admin.fedoraproject.org/updates/koji-1.4.0-4.fc14
Comment 27 Xavier Lamien 2010-08-12 19:49:48 EDT
alrighty, thing are back ok.

build has been done and will hit updates/testing and other soon(ish).
sorry for the late.
Comment 28 Fedora Update System 2010-08-29 18:23:23 EDT
rubygem-json-1.4.3-3.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/rubygem-json-1.4.3-3.el5
Comment 29 Michael Stahnke 2010-08-29 18:25:07 EDT
I decided to create an update for EL5.  It will resolve several bugs when completed.
Comment 30 Fedora Update System 2010-08-30 13:55:07 EDT
rubygem-json-1.4.3-3.el5 has been pushed to the Fedora EPEL 5 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update rubygem-json'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/rubygem-json-1.4.3-3.el5
Comment 31 Fedora Update System 2010-09-14 13:30:39 EDT
rubygem-json-1.4.3-3.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.