Support #19

Ruby compatibility fixes

Added by Felix Bünemann 8 months ago. Updated 8 months ago.

Status:NewStart date:05/04/2018
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

I’m trying to contribute compatibility patches for current ruby and macOS versions to the r2corba gem, but the repository link https://osportal.remedy.nl/projects/r2corba/repository is giving a 403 error.

This is probably a configuration problem in Redmine, since it should be possible to give read-only access to repositories.

Another alternative would be to mirror the repository to GitHub or GitLab.

0001-Fix-macOS-detection-add-10.11-10.12-10.13-support.patch Magnifier (1.25 KB) Felix Bünemann, 05/05/2018 11:53 am

0002-Fix-wrong-target-for-ext-.bundle-symlinks.patch Magnifier (1009 Bytes) Felix Bünemann, 05/05/2018 11:53 am

0004-Fix-sighandler-mapping-on-Darwin-BSD.patch Magnifier (1.25 KB) Felix Bünemann, 05/05/2018 11:53 am

0005-Fix-Ruby-2.4-Fixnum-Bignum-deprecation-warnings.patch Magnifier (3.99 KB) Felix Bünemann, 05/05/2018 11:54 am

0006-Fix-Ruby-2.4-deprecations-of-TRUE-FALSE-constants.patch Magnifier (1.33 KB) Felix Bünemann, 05/05/2018 11:54 am

0007-Add-missing-development-dependencies-to-Gemfile.patch Magnifier (659 Bytes) Felix Bünemann, 05/05/2018 11:54 am

0008-Fix-taogem-rake-task-with-macOS-BSD-tar.patch Magnifier (981 Bytes) Felix Bünemann, 05/05/2018 01:13 pm

History

#1 Updated by Johnny Willemsen 8 months ago

Hi,

Due to security changes we are currently not exposing our R2CORBA repository through our osportal.

Could you attach the patches to this issue so that we can try to integrate them into the current code base so that they can be part of a future release of R2CORBA.

Best regards,

Johnny Willemsen
Remedy IT

#2 Updated by Felix Bünemann 8 months ago

I’ve attached all the patches.

I’ve tested the changes on ruby 1.9.3 and 2.5.0 on macOS 10.13.4 with ACE+TAO 6.4.7 by running:

bundle install
bundle exec rake configure build test

The tests for CORBA_Services/Naming/BindingIterator, CORBA_Services/Naming/Corbaname and CORBA_Services/Naming/Simple showed the following error on all CRuby versions, but seemed to run fine anyways:

TAO (53200|140735661482880) ERROR: ORBInitializer Registry unable to find the ORBInitializer Registry instance: Invalid argument

My guess is that this is related to newer TAO versions.

Tests on Ruby 1.8.7 where mostly OK, but failed for stuff like threading and exception handling and none of the errors seemed related to the patches.

I also ran a test on JRuby 1.7.27 and 9.1.17.0 with JacORB 3.9, which had a few errors in the test suite mostly during sendCloseConnection() and the Nil test, but none of the errors seemed to be related to changes from the patches.

A note on the patch to R2CORBA::CORBA::Any probably deserves a second look:

--- a/lib/corba/common/Any.rb
+++ b/lib/corba/common/Any.rb
@@ -20,10 +20,8 @@ module R2CORBA
             return val._tc
           when ::NilClass
             return CORBA._tc_null
-          when ::Bignum
-            return CORBA._tc_longlong
           when ::Integer
-            return CORBA._tc_long
+            return val < -2**31 || val >= 2**31 ? CORBA._tc_longlong : CORBA._tc_long
           when ::Float
             return CORBA._tc_double
           when ::TrueClass, ::FalseClass

Here I replaced the type check with a range check, because the old code implied that a Ruby Fixnum is of type long, however the range for a Fixnum depends on the Ruby architecture because on 64-Bit CRuby it is 62-Bit signed int, but on 32-Bit Ruby it’s 30-Bit signed int. Since the code appears to map Ruby to CORBA types and I found references on Google mapping the CORBA long to a Java int, I decided to check for the 32-Bit signed int range here.

#3 Updated by Felix Bünemann 8 months ago

Btw. should these changes be integrated and released on rubygems a new version 6.4.7 of the taosource gem should also be released, since the current version is 6.3.1 which doesn’t support anything later than macOS 10.10.

I’ve attached a patch that fixes running rake r2corba:gem:taogem on macOS (Darwin) and presumably other BSD versions.

#4 Updated by Johnny Willemsen 8 months ago

  • Subject changed from Repository URL not working to Ruby compatibility fixes

Hi,

Thanks for the patches, we will try to integrate these asap into our development version.

Best regards,

Johnny Willemsen

Also available in: Atom PDF