Bug 975332 - Even if rubygem-ffi is installed, the gem cannot be used
Summary: Even if rubygem-ffi is installed, the gem cannot be used
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: rubygem-ffi
Version: el6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Bryan Kearney
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-18 06:46 UTC by Jan Pazdziora
Modified: 2014-03-31 18:24 UTC (History)
4 users (show)

Fixed In Version: rubygem-ffi-1.0.9-9.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-03-31 18:24:32 UTC


Attachments (Terms of Use)
dist-git patch (2.40 KB, patch)
2014-03-26 12:49 UTC, Dominic Cleal
no flags Details | Diff
dist-git patch #2 (3.15 KB, patch)
2014-03-26 15:11 UTC, Dominic Cleal
no flags Details | Diff

Description Jan Pazdziora 2013-06-18 06:46:14 UTC
Description of problem:

When I install rubygem-ffi-1.0.9-8.el6.x86_64.rpm from EPEL, gem list does not show the gem and attempt to install gem which requires ffi fails:

# gem install --local /root/rpmbuild/SOURCES/gssapi-1.1.2.gem
ERROR:  While executing gem ... (Gem::DependencyError)
    Unable to resolve dependencies: gssapi requires ffi (>= 1.0.1)

When I install the package from Katello koji http://koji.katello.org/koji/buildinfo?buildID=2072, things work.

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

rubygem-ffi-1.0.9-8.el6.x86_64

How reproducible:

Deterministic.

Steps to Reproduce:
1. Install rubygem-ffi from EPEL.
2. Run gem list

Actual results:

# gem list

*** LOCAL GEMS ***

archive-tar-minitar (0.5.2)
commander (4.0.3)
gssapi (1.1.2)
highline (1.6.16)
httpclient (2.3.2)
net-ssh (2.5.2)
open4 (1.3.0)
parseconfig (0.5.2)
rhc (1.10.1)
test-unit (2.2.0)

Expected results:

# gem list

*** LOCAL GEMS ***

archive-tar-minitar (0.5.2)
commander (4.0.3)
ffi (1.0.9)
gssapi (1.1.2)
highline (1.6.16)
httpclient (2.3.2)
net-ssh (2.5.2)
open4 (1.3.0)
parseconfig (0.5.2)
rhc (1.10.1)
test-unit (2.2.0)

Additional info:

When I unpack the two rpms and diff them, the difference is

# diff -ru rubygem-ffi-1.0.9-5.el6.x86_64 rubygem-ffi-1.0.9-8.el6.x86_64
Only in rubygem-ffi-1.0.9-5.el6.x86_64/usr: lib
Only in rubygem-ffi-1.0.9-8.el6.x86_64/usr/lib64: gems
Only in rubygem-ffi-1.0.9-5.el6.x86_64/usr/lib64: ruby
Only in rubygem-ffi-1.0.9-8.el6.x86_64/usr: share

And since gem env shows

# gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.16
  - RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: /usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/lib/ruby/gems/1.8
     - /root/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

I assume rubygem-ffi-1.0.9-8.el6.x86_64's lack of the /usr/lib directory is the cause of the problem.

Comment 1 Dominic Cleal 2014-03-26 12:49:51 UTC
Created attachment 878984 [details]
dist-git patch

Attached is a patch against the el6 git branch that fixes the build issues with placement of the library and gemspec.

Scratch build: http://koji.fedoraproject.org/koji/taskinfo?taskID=6675314 (works for me)

Comment 2 Vít Ondruch 2014-03-26 13:24:47 UTC
Dominic, there is possible to use the Fedora approach, i.e. to require rubygems-devel with all the macros. The only difference between should be the ruby(abi).

Comment 3 Dominic Cleal 2014-03-26 15:11:09 UTC
Created attachment 879035 [details]
dist-git patch #2

(In reply to Vít Ondruch from comment #2)
> Dominic, there is possible to use the Fedora approach, i.e. to require
> rubygems-devel with all the macros. The only difference between should be
> the ruby(abi).

Thanks, I forgot rubygems-devel is now available in EL6.  It seems that neither ruby_sitearch or gem_extdir* are defined though, so unless I'm missing something, I'll still need to define and use ruby_sitearch.

Attached a new patch which removes lots of %globals and relies on rubygems-devel.

Comment 4 Vít Ondruch 2014-03-27 08:41:07 UTC
You don't need to move the extension anywhere, since it is already installed into platform specific directory => You don't need gem_extdir nor ruby_sitearch.

Comment 5 Dominic Cleal 2014-03-27 11:21:36 UTC
The .so gets installed into this path inside an x86_64 buildroot:
/builddir/build/BUILDROOT/rubygem-ffi-1.0.9-9.el6.x86_64/usr/lib/ruby/gems/1.8/gems/ffi-1.0.9/lib/ffi_c.so

Is that acceptable?  I thought it'd have to be under /usr/lib64 at least, hence the mv to /usr/lib64/ruby/site_ruby/1.8/x86_64-linux.

If there's a reference (native) rubygem I could base this on, that'd be useful, as I'm looking at rubygem-nokogiri at the moment.  Or if you have the time to fix it yourself, that'd be great too.  Thanks.

Comment 6 Vít Ondruch 2014-03-27 11:58:58 UTC
Hm, interesting. I thought that the gems were installed into platform specific directories, but apparently, I was wrong. Then the sitearch dir is the right one. Sorry for confusion.

Comment 7 Fedora Update System 2014-03-28 18:21:50 UTC
rubygem-ffi-1.0.9-9.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/rubygem-ffi-1.0.9-9.el6

Comment 8 Fedora Update System 2014-03-29 19:16:39 UTC
Package rubygem-ffi-1.0.9-9.el6:
* should fix your issue,
* was pushed to the Fedora EPEL 6 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing rubygem-ffi-1.0.9-9.el6'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2014-0991/rubygem-ffi-1.0.9-9.el6
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2014-03-31 18:24:32 UTC
rubygem-ffi-1.0.9-9.el6 has been pushed to the Fedora EPEL 6 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.