Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#37740 closed defect (fixed)

webkit-gtk @1.10.2: undefined method `getbyte'

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: tiger leopard haspatch Cc: dbevans (David B. Evans), johanmattssonm (Johan Mattsson), cooljeanius (Eric Gallager)
Port: webkit-gtk

Description (last modified by ryandesign (Ryan Carsten Schmidt))

After applying the patch from #37418 to get past the error in Leopard's system headers, the build fails with:

libtool: link: /usr/bin/g++-4.2 -pipe -O2 -arch i386 -O2 -arch i386 -o Programs/LLIntOffsetsExtractor Source/JavaScriptCore/llint/Programs_LLIntOffsetsExtractor-LLIntOffsetsExtractor.o  -L/opt/local/lib ./.libs/libWTF.a -licui18n -licuuc -licudata /opt/local/lib/libgio-2.0.dylib /opt/local/lib/libgmodule-2.0.dylib -lz /opt/local/lib/libgobject-2.0.dylib /opt/local/lib/libgthread-2.0.dylib /opt/local/lib/libffi.dylib /opt/local/lib/libglib-2.0.dylib -lresolv /opt/local/lib/libintl.dylib /opt/local/lib/libiconv.dylib -lc -lm -lpthread -lstdc++
/usr/bin/ruby ./Source/JavaScriptCore/offlineasm/asm.rb ./Source/JavaScriptCore/llint/LowLevelInterpreter.asm Programs/LLIntOffsetsExtractor DerivedSources/JavaScriptCore/LLIntAssembly.h
offlineasm: Parsing ./Source/JavaScriptCore/llint/LowLevelInterpreter.asm and Programs/LLIntOffsetsExtractor and creating assembly file DerivedSources/JavaScriptCore/LLIntAssembly.h.
./Source/JavaScriptCore/offlineasm/offsets.rb:112:in `offsetsAndConfigurationIndex': undefined method `getbyte' for #<File:Programs/LLIntOffsetsExtractor (closed)> (NoMethodError)
	from ./Source/JavaScriptCore/offlineasm/offsets.rb:111:in `loop'
	from ./Source/JavaScriptCore/offlineasm/offsets.rb:111:in `offsetsAndConfigurationIndex'
	from ./Source/JavaScriptCore/offlineasm/offsets.rb:109:in `open'
	from ./Source/JavaScriptCore/offlineasm/offsets.rb:109:in `offsetsAndConfigurationIndex'
	from ./Source/JavaScriptCore/offlineasm/asm.rb:208
make: *** [DerivedSources/JavaScriptCore/LLIntAssembly.h] Error 1

Based on official documentation, my understanding is that in ruby 1.8.x, "getc" gets a byte (1.8.6 documentation) while in ruby 1.9.x, "getc" gets a character while "getbyte" gets a byte (1.9.3 documentation).

The question mark is 1.8.7, whose documentation has a link in the sidebar for "getbyte" but which takes you to the definition of "getc", which appears twice. Snow Leopard, Lion and Mountain Lion ship with ruby 1.8.7 and the port builds there, so it seems (and the ruby 1.8.7 NEWS file confirms) that in ruby 1.8.7 "getbyte" is a compatibility alias for "getc".

Leopard has ruby 1.8.6 and Tiger has ruby 1.8.2. It seems the most correct thing to do, if you want to get a byte (which I assume is what the code in Source/JavaScriptCore/offlineasm/offsets.rb wants to do), is to check the ruby version, and use "getc" on ruby 1.8.x and earlier and "getbyte" on ruby 1.9.x and later. I don't know enough ruby to be able to do that. For now, since all versions of OS X that MacPorts runs on today (10.4 through 10.8 inclusive) have ruby 1.8.x, we could get away with unconditionally changing "getbyte" to "getc".

I verified that changing "getbyte" to "getc" allows webkit-gtk @1.10.2 to build on Leopard i386.

Attachments (2)

patch-ruby-1.8.diff (392 bytes) - added by ryandesign (Ryan Carsten Schmidt) 12 years ago.
ruby-1.8.patch (500 bytes) - added by ryandesign (Ryan Carsten Schmidt) 12 years ago.
revised ruby 1.8 patch

Download all attachments as: .zip

Change History (11)

Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: patch-ruby-1.8.diff added

comment:1 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Thanks. I'll see if I can figure out enough ruby to know how to make this conditional and push something upstream. Otherwise, I'll just commit this.

comment:2 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Keywords: haspatch added

comment:3 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Status: newassigned

comment:4 Changed 12 years ago by johanmattssonm (Johan Mattsson)

Cc: johan.mattsson.m@… added

Cc Me!

comment:5 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)

Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: ruby-1.8.patch added

revised ruby 1.8 patch

comment:6 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

This new patch should work on any Ruby version. The method of checking the Ruby version uses string comparison, which would cause problems if there were ever a ruby 1.8.10 or a ruby 1.10.0, but although I cannot find documentation of that fact right now, I've heard that Ruby version numbering policy is such that those kind of version numbers will never exist, precisely so that string comparison of version numbers will work, and it's a method I've seen used in other projects.

comment:7 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Thanks. Please commit.

comment:8 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

r101964.

This fixes webkit-gtk on my Leopard i386 machine but it still fails on Leopard ppc due to #35989.

comment:9 Changed 12 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

Note: See TracTickets for help on using tickets.