Ruby compatibility fixes
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.
#1 Updated by Johnny Willemsen about 1 year ago
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.
#2 Updated by Felix Bünemann about 1 year ago
- File 0001-Fix-macOS-detection-add-10.11-10.12-10.13-support.patch added
- File 0002-Fix-wrong-target-for-ext-.bundle-symlinks.patch added
- File 0004-Fix-sighandler-mapping-on-Darwin-BSD.patch added
- File 0005-Fix-Ruby-2.4-Fixnum-Bignum-deprecation-warnings.patch added
- File 0006-Fix-Ruby-2.4-deprecations-of-TRUE-FALSE-constants.patch added
- File 0007-Add-missing-development-dependencies-to-Gemfile.patch added
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/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 126.96.36.199 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 about 1 year 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.