Bug 148795

Summary: REGRESSION(r189293): JavaScriptCore/offlineasm/x86.rb -- Build failure with ruby < 2.0
Product: WebKit Reporter: Carlos Alberto Lopez Perez <clopez>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bfulgham, cgarcia, ggaren, msaboff, ossy, thorton
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 148658    

Description Carlos Alberto Lopez Perez 2015-09-04 04:18:07 PDT
After r189293 <http://trac.webkit.org/r189293> WebKit fails to build with the following error:

Source/JavaScriptCore/offlineasm/x86.rb:218:in `+': String can't be coerced into FixnumAt /home/slave/webkitgtk/gtk-linux-64-release/build/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm:135 (TypeError)

https://build.webkit.org/builders/GTK%20Linux%2064-bit%20Release%20%28Build%29/builds/61907/steps/compile-webkit/logs/stdio/text


This happens only when using ruby1.8 but not when using ruby2.0

On a system that has both ruby interpreters installed, CMake will prefer ruby1.8 therefore causing the build failure.

The proposed fix is to explicit require ruby2.0.

This will also help to prevent further issues with different ruby interpreters used.
Comment 1 Csaba Osztrogonác 2015-09-04 04:26:06 PDT
On Ubuntu 14.04 the default Ruby version is 1.9.3 and doesn't have this 
issue. But I'm not against requiring Ruby 2.0. Could you add itt to
Tools/<efl|gtk>/install-dependencies files too?
Comment 2 Carlos Alberto Lopez Perez 2015-09-04 04:26:28 PDT
Committed r189343: <http://trac.webkit.org/changeset/189343>
Comment 3 Carlos Alberto Lopez Perez 2015-09-04 04:29:18 PDT
(In reply to comment #1)
> On Ubuntu 14.04 the default Ruby version is 1.9.3 and doesn't have this 
> issue. But I'm not against requiring Ruby 2.0. Could you add itt to
> Tools/<efl|gtk>/install-dependencies files too?

Ups sorry, I was too fast...

I can instead require ruby 1.9 if you say that it works...

I will follow with another patch lowering it to 1.9
Comment 4 Csaba Osztrogonác 2015-09-04 04:32:49 PDT
(In reply to comment #2)
> Committed r189343: <http://trac.webkit.org/changeset/189343>

I don't know how this version check works in cmake, but unfortunately 
it  doesn't work if Ruby 1.9 and 2.0 is installed to the system and
1.9 is the default one.

-- Could NOT find Ruby: Found unsuitable version "1.9.1", but required is at least "2.0" (found /usr/bin/ruby)
CMake Error at Source/cmake/WebKitCommon.cmake:22 (message):
  Ruby 2.0 or higher is required.
Comment 5 Csaba Osztrogonác 2015-09-04 04:38:41 PDT
(In reply to comment #4)
> (In reply to comment #2)
> > Committed r189343: <http://trac.webkit.org/changeset/189343>
> 
> I don't know how this version check works in cmake, but unfortunately 
> it  doesn't work if Ruby 1.9 and 2.0 is installed to the system and
> 1.9 is the default one.
> 
> -- Could NOT find Ruby: Found unsuitable version "1.9.1", but required is at
> least "2.0" (found /usr/bin/ruby)
> CMake Error at Source/cmake/WebKitCommon.cmake:22 (message):
>   Ruby 2.0 or higher is required.

Tricky, FindRuby.cmake (shipped with the default cmake on Ubuntu 14.04)
supports only searching 1.8 and 1.9. Changing the minimum version to
ruby 1.9 works for me, I checked it. rs=me to do it. In this case we
(at least EFL) don't need to add ruby2.0 to install-dependencies.
Comment 6 Carlos Alberto Lopez Perez 2015-09-04 04:48:22 PDT
Committed r189345: <http://trac.webkit.org/changeset/189345>