Bug 589801

Summary: rubygem-json requires gtk...why?
Product: [Fedora] Fedora EPEL Reporter: Michael Stahnke <mastahnke>
Component: rubygem-jsonAssignee: Xavier Lamien <lxtnow>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: el5CC: lxtnow, mtasaka
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
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 17:30:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 588364    

Description Michael Stahnke 2010-05-06 22:04:28 UTC
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 04:24:46 UTC
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 04:43:44 UTC
(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 13:36:11 UTC
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 14:43:32 UTC
Hey,

Yeah, split it out would be good.
Will take care of this this weekend.

Comment 5 Mamoru TASAKA 2010-05-07 15:13:29 UTC
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 17:22:31 UTC
Fixed.

Comment 7 Mamoru TASAKA 2010-05-09 19:21:10 UTC
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 19:26:14 UTC
By the way for F-13 / EPEL-5, the rebuilt packages have to
be submitted on bodhi.

Comment 9 Xavier Lamien 2010-05-10 07:50:01 UTC
#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 11:44:08 UTC
Mamoru,

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

thx,

Comment 11 Mamoru TASAKA 2010-05-11 12:42:27 UTC
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 22:38:52 UTC
>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 22:42:11 UTC
nod.
will fix this asap

Comment 14 Michael Stahnke 2010-06-11 16:31:32 UTC
Any update on this for EPEL?  It's blocking a bug I have open.

Comment 15 Xavier Lamien 2010-06-11 18:08:37 UTC
Ho craps, thanks for the head's up.
Will look at it in a few hours.

Comment 16 Xavier Lamien 2010-06-11 21:01:27 UTC
(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 21:40:00 UTC
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 18:28:47 UTC
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 14:39:58 UTC
any update on this?

Comment 20 Xavier Lamien 2010-07-22 14:55:05 UTC
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 15:14:01 UTC
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 15:37:17 UTC
(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 14:09:02 UTC
Any update?  This is still blocking a bug I have open in EPEL.

Comment 24 Xavier Lamien 2010-08-04 15:38:06 UTC
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-05 01:22:40 UTC
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 17:59:17 UTC
(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 23:49:48 UTC
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 22:23:23 UTC
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 22:25:07 UTC
I decided to create an update for EL5.  It will resolve several bugs when completed.

Comment 30 Fedora Update System 2010-08-30 17:55:07 UTC
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 17:30:39 UTC
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.