You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Michael Stockton (JIRA)" <ji...@apache.org> on 2009/03/16 03:55:50 UTC
[jira] Created: (THRIFT-374) ruby 1.9 compatibility
ruby 1.9 compatibility
----------------------
Key: THRIFT-374
URL: https://issues.apache.org/jira/browse/THRIFT-374
Project: Thrift
Issue Type: New Feature
Components: Library (Ruby)
Reporter: Michael Stockton
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (THRIFT-374) ruby 1.9 compatibility
Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688710#action_12688710 ]
Bryan Duxbury commented on THRIFT-374:
--------------------------------------
I get a ton of "no method 'ord' for 2:Fixnum" when I run the specs. I think this same problem might be affecting the nonblocking server tests.
As to the range checking you added - did you have to do this because the behavior in 1.9 changed in some way in respect to pack? 1.8 would pack oversized values for you, but truncates the excess. pack('c') will only write a byte no matter what you put into it. If this is still the same behavior, I'd love to remove the range checking and avoid that performance hit.
Other than the spec failures, the patch looks pretty good. If you can resolve those failures I'll commit the patch.
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Assignee: Michael Stockton
> Fix For: 0.1
>
> Attachments: thrift-374-v2.patch, thrift-374-v3.patch, thrift-374-v4.patch, thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-374) ruby 1.9 compatibility
Posted by "Michael Stockton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Stockton updated THRIFT-374:
------------------------------------
Attachment: thrift-374-v5.patch
To support pre ruby 1.8.7, I added an ord method to the Fixnum class.
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Assignee: Michael Stockton
> Fix For: 0.1
>
> Attachments: thrift-374-v2.patch, thrift-374-v3.patch, thrift-374-v4.patch, thrift-374-v5.patch, thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-374) ruby 1.9 compatibility
Posted by "Michael Stockton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Stockton updated THRIFT-374:
------------------------------------
Attachment: thrift-374-v6.patch
I forgot to include an apache header in fixnum.rb. Other than that, there is no difference from my previous patch.
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Assignee: Michael Stockton
> Fix For: 0.1
>
> Attachments: thrift-374-v2.patch, thrift-374-v3.patch, thrift-374-v4.patch, thrift-374-v5.patch, thrift-374-v6.patch, thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-374) ruby 1.9 compatibility
Posted by "Michael Stockton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Stockton updated THRIFT-374:
------------------------------------
Attachment: thrift-374-v3.patch
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Assignee: Michael Stockton
> Fix For: 0.1
>
> Attachments: thrift-374-v2.patch, thrift-374-v3.patch, thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (THRIFT-374) ruby 1.9 compatibility
Posted by "Roger Pack (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12706725#action_12706725 ]
Roger Pack commented on THRIFT-374:
-----------------------------------
as a note, to get around the error: 'struct RFloat' has no member named 'value'
stuffs it apears you use RFLOAT_VALUE (for any followers).
Thanks!
-=r
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Assignee: Michael Stockton
> Fix For: 0.1
>
> Attachments: thrift-374-v2.patch, thrift-374-v3.patch, thrift-374-v4.patch, thrift-374-v5.patch, thrift-374-v6.patch, thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-374) ruby 1.9 compatibility
Posted by "Michael Stockton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Stockton updated THRIFT-374:
------------------------------------
Fix Version/s: 0.1
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Fix For: 0.1
>
> Attachments: thrift-374-v2.patch, thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-374) ruby 1.9 compatibility
Posted by "Michael Stockton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Stockton updated THRIFT-374:
------------------------------------
Patch Info: [Patch Available]
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Attachments: thrift-374-v2.patch, thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (THRIFT-374) ruby 1.9 compatibility
Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bryan Duxbury closed THRIFT-374.
--------------------------------
Resolution: Fixed
I just committed this. Thanks for the patch, Michael!
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Assignee: Michael Stockton
> Fix For: 0.1
>
> Attachments: thrift-374-v2.patch, thrift-374-v3.patch, thrift-374-v4.patch, thrift-374-v5.patch, thrift-374-v6.patch, thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (THRIFT-374) ruby 1.9 compatibility
Posted by "Michael Stockton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688739#action_12688739 ]
Michael Stockton commented on THRIFT-374:
-----------------------------------------
That's interesting. I would assume that you're running 1.8.7 or 1.9.1, but let me know if you're not.
irb(main):002:0> 1.class.name
=> "Fixnum"
irb(main):003:0> 1.ord
=> 1
irb(main):004:0> RUBY_VERSION
=> "1.8.7"
I added range checks because binaryprotocol_spec_shared checks that write_i32 and write_i64 raise a RangeError if the value to pack is too big. With 1.8.7, it appears this exception is raised by pack itself. And, in 1.9.1, an exception is not raised.
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Assignee: Michael Stockton
> Fix For: 0.1
>
> Attachments: thrift-374-v2.patch, thrift-374-v3.patch, thrift-374-v4.patch, thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (THRIFT-374) ruby 1.9 compatibility
Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688744#action_12688744 ]
Bryan Duxbury commented on THRIFT-374:
--------------------------------------
Actually, I'm on Ruby 1.8.6.
Ok, I'm cool with the range checks.
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Assignee: Michael Stockton
> Fix For: 0.1
>
> Attachments: thrift-374-v2.patch, thrift-374-v3.patch, thrift-374-v4.patch, thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-374) ruby 1.9 compatibility
Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bryan Duxbury updated THRIFT-374:
---------------------------------
Assignee: Michael Stockton
The v2 patch no longer applies cleanly to trunk. Can you check this out?
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Assignee: Michael Stockton
> Fix For: 0.1
>
> Attachments: thrift-374-v2.patch, thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-374) ruby 1.9 compatibility
Posted by "Michael Stockton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Stockton updated THRIFT-374:
------------------------------------
Attachment: thrift-374-v4.patch
This patch will apply cleanly after Bryan's work in THRIFT-275.
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Assignee: Michael Stockton
> Fix For: 0.1
>
> Attachments: thrift-374-v2.patch, thrift-374-v3.patch, thrift-374-v4.patch, thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (THRIFT-374) ruby 1.9 compatibility
Posted by "Kevin Clark (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688767#action_12688767 ]
Kevin Clark commented on THRIFT-374:
------------------------------------
We *should* support 1.8.6. Adoption of 1.8.7 has been low because it has a bunch of larger changes (like adding methods here and there) that don't belong in a point release.
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Assignee: Michael Stockton
> Fix For: 0.1
>
> Attachments: thrift-374-v2.patch, thrift-374-v3.patch, thrift-374-v4.patch, thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (THRIFT-374) ruby 1.9 compatibility
Posted by "Michael Stockton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688753#action_12688753 ]
Michael Stockton commented on THRIFT-374:
-----------------------------------------
Ok, I'll install 1.8.6 and see what can be done. Though, this problem brings up an interesting question: Should there be a minimum supported version of Ruby for Thrift? If so, what should it be?
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Assignee: Michael Stockton
> Fix For: 0.1
>
> Attachments: thrift-374-v2.patch, thrift-374-v3.patch, thrift-374-v4.patch, thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-374) ruby 1.9 compatibility
Posted by "Michael Stockton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Stockton updated THRIFT-374:
------------------------------------
Attachment: thrift-374.patch
Here are a few notes I put together to summarize my changes.
o Ruby 1.9 is not compatible with rspec 1.1.12. Specifically, .and_return doesn't allow for multiple values. And, stub_everything("trans") must now be declared like so: mock("trans").as_null_object. To test thrift against 1.9, you must install version 1.1.99.9 from rspec's trunk.
fail: mock("Foo").should_receive(:bar).with(1).and_return(2,4)
pass: mock("Foo").should_receive(:bar).with(1).and_return(4)
o A macro exists in 1.9 to extract a float's value but it doesn't exist in 1.8. RFLOAT(rb_Float(v))->value is incompatible with 1.9.
o Replaced RSTRING(str)->len and RSTRING(str)->ptr with forward compatible RSTRING_LEN and RSTRING_PTR.
o Excluded :object_id from the list of methods undefined in deprecation proxies to avoid a bunch of warnings.
o Check for range errors manually in binary protocol's write_byte and write_i64. Ruby 1.9 doesn't seem to mind packing values greater than a format specification description calls for.
o In ruby 1.8, String.new('monkey')[0] returns an ascii value. In 1.9, it returns a string. Therefore, .ord must be called explicitly.
o Forced ascii-8bit string encoding in transport with a magic comment. Otherwise, two strings with a different encoding do not appear equal when their printed contents are the same.
'Thrift::BinaryProtocolAccelerated should write the message header' FAILED
expected: "\x80\x01\x00\x01\x00\x00\x00\vtestMessage\x00\x00\x00\x11",
got: "\x80\x01\x00\x01\x00\x00\x00\vtestMessage\x00\x00\x00\x11" (using ==)
o case statements must use 'then', instead of, ':'.
case (x += 1)
when 1: raise Thrift::TransportException
end
case (x += 1)
when 1 then raise Thrift::TransportException
end
o I didn't make deprecation and its associated specs compatible with 1.9 since there is an open ticket to remove deprecation support.
o Mongrel is not ported to ruby 1.9 which will cause httpserver to fail.
o There are a few tests for nonblockingserver that are failing. I can't seem to figure out why. It seems the problem may be in the way the spec is merely shutting down a nonblocking server.
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Attachments: thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (THRIFT-374) ruby 1.9 compatibility
Posted by "Michael Stockton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Stockton updated THRIFT-374:
------------------------------------
Attachment: thrift-374-v2.patch
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Attachments: thrift-374-v2.patch, thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (THRIFT-374) ruby 1.9 compatibility
Posted by "Michael Stockton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688771#action_12688771 ]
Michael Stockton commented on THRIFT-374:
-----------------------------------------
I agree with supporting 1.8.6. Can we enforce 1.8.6 as the minimum supported release? If not, I'll feel compelled, but not ecstatic, to test the rest of the 1.8 series.
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Assignee: Michael Stockton
> Fix For: 0.1
>
> Attachments: thrift-374-v2.patch, thrift-374-v3.patch, thrift-374-v4.patch, thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (THRIFT-374) ruby 1.9 compatibility
Posted by "Kevin Clark (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688776#action_12688776 ]
Kevin Clark commented on THRIFT-374:
------------------------------------
I think 1.8.6 is probably fine. We're on 1.8.5 at work, so I'll test it out there as well.
> ruby 1.9 compatibility
> ----------------------
>
> Key: THRIFT-374
> URL: https://issues.apache.org/jira/browse/THRIFT-374
> Project: Thrift
> Issue Type: New Feature
> Components: Library (Ruby)
> Reporter: Michael Stockton
> Assignee: Michael Stockton
> Fix For: 0.1
>
> Attachments: thrift-374-v2.patch, thrift-374-v3.patch, thrift-374-v4.patch, thrift-374.patch
>
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.