Bug 760000

Summary: libguestfs fails to compile with Ruby >= 1.9
Product: [Fedora] Fedora Reporter: Bohuslav "Slavek" Kabrda <bkabrda>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: mbooth, rjones, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.16.1-1.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-04 08:10:39 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:

Description Bohuslav "Slavek" Kabrda 2011-12-05 07:27:58 UTC
Description of problem:
Hi, we are currently preparing a new version of Ruby (1.9.3) for Rawhide and we are trying to rebuild all the packages that use it. There is a problem with libguestfs, that it uses C functionality, that is no longer supported in Ruby >= 1.9:

compiling _guestfs.c
_guestfs.c:5416:9: warning: "/*" within comment [-Wcomment]
_guestfs.c:16095:43: warning: "/*" within comment [-Wcomment]
_guestfs.c: In function ‘ruby_guestfs_test0’:
_guestfs.c:347:56: error: ‘struct RString’ has no member named ‘ptr’
_guestfs.c:351:56: error: ‘struct RString’ has no member named ‘len’
_guestfs.c: In function ‘ruby_guestfs_write’:
_guestfs.c:14414:54: error: ‘struct RString’ has no member named ‘ptr’
_guestfs.c:14418:54: error: ‘struct RString’ has no member named ‘len’
_guestfs.c: In function ‘ruby_guestfs_pwrite’:
_guestfs.c:14466:54: error: ‘struct RString’ has no member named ‘ptr’
_guestfs.c:14470:54: error: ‘struct RString’ has no member named ‘len’
_guestfs.c: In function ‘ruby_guestfs_pwrite_device’:
_guestfs.c:15573:54: error: ‘struct RString’ has no member named ‘ptr’
_guestfs.c:15577:54: error: ‘struct RString’ has no member named ‘len’
_guestfs.c: In function ‘ruby_guestfs_write_append’:
_guestfs.c:16293:54: error: ‘struct RString’ has no member named ‘ptr’
_guestfs.c:16297:54: error: ‘struct RString’ has no member named ‘len’
make[1]: *** [_guestfs.o] Error 1

I wasn't able to find any official documentation for C extensions for Ruby 1.9.3 (the page [1] on ruby-doc.org that should contain the documentation doesn't seem to work), but I was able to find a related thread on ruby-forum [2].
Would it be possible to make libguestfs work with both Ruby 1.8.x and 1.9.x?


Version-Release number of selected component (if applicable):
$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
libguestfs-1.15.9-2.fc17


How reproducible:
always


Steps to Reproduce:
Compile with Ruby >= 1.9


Thank you!

[1] http://www.ruby-doc.org/doxygen/current/index.html
[2] http://www.ruby-forum.com/topic/134350

Comment 1 Richard W.M. Jones 2011-12-05 10:37:28 UTC
I pushed this patch upstream, which although untested with
Ruby 1.9 seems like it should work:

http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=2972987d0257d9c3d26b53f961e802d121b436cd

It will be in libguestfs 1.15.10 in Rawhide in a few days.

Comment 2 Bohuslav "Slavek" Kabrda 2011-12-05 10:41:23 UTC
Thank you, I will test it as soon as it lands in Rawhide.

Comment 3 Bohuslav "Slavek" Kabrda 2012-01-04 08:10:39 UTC
Thank you very much Richard, it seems to work good now. Closing the issue.

Comment 4 Fedora Update System 2012-01-24 22:44:53 UTC
libguestfs-1.16.1-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/libguestfs-1.16.1-1.fc16

Comment 5 Fedora Update System 2012-01-30 21:03:31 UTC
libguestfs-1.16.1-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.