By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.

Bug 597

Summary: Build issue: tdebindings FTBFS on Ruby 1.9 without patches
Product: TDE Reporter: Darrell <darrella>
Component: non-core programsAssignee: Timothy Pearson <kb9vqf>
Status: RESOLVED FIXED    
Severity: major CC: bugwatch, darrella, mutantturkey
Priority: P1    
Version: R14.0.0 [Trinity]   
Hardware: Other   
OS: Slackware 13   
Compiler Version: TDE Version String:
Application Version: Application Name: kdebindings
Attachments: Patch to build kdebindings
Patch to build kdebindings
Patch to build kdebindings
Patch to build kdebindings
Patch to build kdebindings
Patch to build kdebindings
Patch to build kdebindings
Patch to build kdebindings
Updated patch for GIT 2678
Updated patch for GIT 2678
Updated patch to build kdebindings
Updated patch to build kdebindings
Consolidated ruby 1.9.x patch to replace previous patches
Patch to build tdebindings
Patch to allow building with ruby 1.9.1

Description Darrell 2011-11-08 17:06:22 CST
Patches found here:

http://humanreadable.nfshost.com/trinity/patches/kdebindings/3.5.13/
Comment 1 Darrell 2011-11-28 22:09:32 CST
Created attachment 172 [details]
Patch to build kdebindings

Patch added as an attachment rather than a link that might disappear.
Comment 2 Darrell 2011-11-28 22:10:10 CST
Created attachment 173 [details]
Patch to build kdebindings

Patch added as an attachment rather than a link that might disappear.
Comment 3 Darrell 2011-11-28 22:10:36 CST
Created attachment 174 [details]
Patch to build kdebindings

Patch added as an attachment rather than a link that might disappear.
Comment 4 Darrell 2011-11-28 22:11:02 CST
Created attachment 175 [details]
Patch to build kdebindings

Patch added as an attachment rather than a link that might disappear.
Comment 5 Darrell 2011-11-28 22:11:24 CST
Created attachment 176 [details]
Patch to build kdebindings

Patch added as an attachment rather than a link that might disappear.
Comment 6 Darrell 2011-11-28 22:11:53 CST
Created attachment 177 [details]
Patch to build kdebindings

Patch added as an attachment rather than a link that might disappear.
Comment 7 Darrell 2011-11-28 22:12:22 CST
Created attachment 178 [details]
Patch to build kdebindings

Patch added as an attachment rather than a link that might disappear.
Comment 8 Darrell 2011-11-28 22:13:02 CST
Created attachment 179 [details]
Patch to build kdebindings

Patch added as an attachment rather than a link that might disappear.
Comment 9 Darrell 2012-01-17 14:41:35 CST
Created attachment 278 [details]
Updated patch for GIT 2678
Comment 10 Darrell 2012-01-17 14:42:24 CST
Created attachment 279 [details]
Updated patch for GIT 2678
Comment 11 Darrell 2012-01-17 14:44:06 CST
Apply the patches in this order:

Qt_cpp.diff
Qt_cpp2a.diff
Qt_cpp3.diff
handlers_cpp2.diff
qtrubyinit_cpp.diff
krubyinit_cpp.diff
Korundum_cpp3.diff
kdehandlers_cpp2.diff
Comment 12 Darrell 2012-02-22 02:20:00 CST
Created attachment 405 [details]
Updated patch to build kdebindings
Comment 13 Darrell 2012-02-22 02:21:00 CST
Created attachment 406 [details]
Updated patch to build kdebindings
Comment 14 Timothy Pearson 2012-02-22 11:48:46 CST
Many of these patches appear to be fixing Ruby 1.9 build failures, but will introduce build failures for Ruby versions less than 1.9 if directly applied.

A check needs to be added for Ruby 1.9, and these patches updated to only use the new code for 1.9 or higher.
Comment 15 Darrell 2012-02-24 13:21:47 CST
Some good news.

I am now able to build tdebindings except for xparts. Part of my fix was some TQt repairs but also additional patches to help the configure process know where to find ruby.h and the ruby header files.

I proposed a similar patch in bug report 735. The proposed patch there still works but the problem with koffice (specifically chalk) is using ruby header files that no longer exist.

With 1.9.x the way in which the ruby include directory is discovered has changed from previous ruby versions. I am still testing the new patches but without those changes I doubt anybody can build tdebindings against ruby 1.9.x.

Part of my testing will be to install ruby 1.8.x and test all of the attached patches and my new patches with that version. If all goes well then I will post the patches after testing.
Comment 16 Darrell 2012-02-27 07:39:41 CST
Created attachment 413 [details]
Consolidated ruby 1.9.x patch to replace previous patches
Comment 17 Darrell 2012-02-27 07:40:27 CST
Created attachment 414 [details]
Patch to build tdebindings
Comment 18 Darrell 2012-02-27 07:49:10 CST
I built tdebindings against both ruby 1.9.1 and 1.8.7. I consolidated the previous patches into one patch. That patch is needed to build against 1.9.x but not against 1.8.x.

The ruby 1.9.x related patch can't be pushed to GIT as-is because with that patch merged tdebindings will not build against ruby 1.8.x.

For the short term seems the only solution is to apply the patch as needed when building against ruby 1.9.x. Packagers will need to know.

For the long term perhaps there is a way to push the patch and then modify the related coded to use some if-then tests for ruby 1.8.x or 1.9.x.

A second patch provides nominal fixes to build tdebindings. That patch is needed with either version of ruby.
Comment 19 Timothy Pearson 2012-06-10 01:56:06 CDT
Comment on attachment 414 [details]
Patch to build tdebindings

Committed to GIT in hash b2e0df6.
Comment 20 Timothy Pearson 2012-06-10 01:57:14 CDT
Updated bug metadata as Ruby 1.9 seems to be the only remaining problem.
Comment 21 Timothy Pearson 2012-06-10 02:03:08 CDT
Here is one 1.8 and 1.9-compatible way to deal with all the RARRAY(x)->len changes:

#ifndef RARRAY_LEN
#define RARRAY_LEN(x) (RARRAY(x)->len)
#endif

Add that to any files using RARRAY len under Ruby 1.9 and remove the ->len conversions throughout your patch.

Not sure what else is the problem?
Comment 22 Darrell 2012-06-10 11:55:03 CDT
The patches allow building against ruby 1.9.x. The patches will break building against ruby 1.8.x.

I will try to use your define statements and run a test build against 1.8.x.
Comment 23 Darrell 2012-06-29 12:52:04 CDT
I have not yet tried to create a patch that supports both ruby 1.8.7 and 1.9.x. Regardless, do we need to continue supporting ruby 1.8.7?

That version is in bare-bones maintenance mode only:

http://www.h-online.com/open/news/item/Ruby-1-8-7-heads-into-security-fix-only-mode-1629443.html
Comment 24 Timothy Pearson 2012-09-11 12:53:49 CDT
Comment on attachment 413 [details]
Consolidated ruby 1.9.x patch to replace previous patches

Pushed to GIT (with modifications) in hash ef7a608.
Comment 25 Timothy Pearson 2012-09-11 14:00:19 CDT
I have tested compilation of GIT on both ruby 1.8 and 1.9.1 (with a .pc file manually added) and both work.  There is a problem compiling against 1.9.1 and 1.9.2 due to the missing pc file, but seeing as 1.9.3 is already released I do not consider this to be worth fixing.

Thanks for reporting, and for the myriad of patches!
Comment 26 Darrell 2012-09-17 08:29:10 CDT
Unlike ruby <= 1.8.7, with ruby 1.9.x, RUBY_ARCHDIR and RUBY_INCLUDEDIR are not the same. A pkgconfig pc file provides that distinction but only for ruby >= 1.9.3. As 1.9.3 is not a security update and is unlikely to be updated in distros still being supported using 1.8.7 >= ruby <= 1.9.3, that leaves tdebindings unbuildable.

tdebindings needs to build with as-is versions of ruby 1.8.7, 1.9.1, and 1.9.3.
Comment 27 Darrell 2012-09-17 11:38:52 CDT
To build tdebindings on 1.9.1 I have to reverse all recent tdebindings commits and apply the old patch (attachment 413 [details]).

Without patching the build fails with 1.9.1 because ruby.h is not found.
Comment 28 Timothy Pearson 2012-09-17 12:44:50 CDT
(In reply to comment #27)
> To build tdebindings on 1.9.1 I have to reverse all recent tdebindings commits
> and apply the old patch (attachment 413 [details]).
> 
> Without patching the build fails with 1.9.1 because ruby.h is not found.

Which all happens because the .pc file is not found.  This is an upstream packaging bug that will be resolved once 1.9.3 is deployed; in the meantime I suggest patching tdebindings to match your distribution's Ruby version as you are currently doing.

This bug will resolve itself with time.
Comment 29 Darrell 2012-09-24 14:30:24 CDT
> This bug will resolve itself with time.

Looking the other way does not seem the correct solution to me. I understand abandoning support for 1.8.7 but not 1.9.1.

The same thing will happen with koffice. :(
Comment 30 Darrell 2012-09-29 18:42:55 CDT
Created attachment 832 [details]
Patch to allow building with ruby 1.9.1

With recent patching to tdebindings to support ruby 1.9.3, I was unable to build against ruby 1.9.1, which should continue to be supported for a while.

The attached patch seems to work for me.

I have not yet tested in an environment with 1.9.3. As the patch only provides a second test to establish the HAVE_RUBY_1_9 build variable, the patch should work in a 1.9.3 environment.

The patch also formats the ruby variables in an easier to read style to help debugging build logs.
Comment 31 Darrell 2012-09-30 12:08:59 CDT
The patch works with ruby 1.9.3 too, tdebindings built. Somebody else should test.
Comment 32 Timothy Pearson 2012-09-30 16:13:58 CDT
Comment on attachment 832 [details]
Patch to allow building with ruby 1.9.1

Patch looks sane; committed to GIT in hash 2712dc6.
Comment 33 Darrell 2012-10-16 19:47:44 CDT
No problems building tdebindings with Slackware 13.1 32-bit with ruby 1.9.1 or Slackware 14.0 64-bit with ruby 1.9.3. Closing this bug report as resolved.