Open edmundhighcock opened 9 years ago
I have also posted in the Rubinius forums to try and get help from the rbx developers.
https://github.com/rubinius/rubinius/issues/2006#issuecomment-114057943
The patch below was sufficient to allow rake compile to work with rubinius... the RBASIC macro is now deprecated in 2.x according to this page:
http://docs.ruby-lang.org/en/2.1.0/README_EXT.html
However, of course, I'm not sure if rb_obj_hide
and rb_obj_reveal
are supported in 1.x.
diff --git a/ext/gsl_native/include/rb_gsl_common.h b/ext/gsl_native/include/rb_gsl_common.h
index 39c3330..f290583 100644
--- a/ext/gsl_native/include/rb_gsl_common.h
+++ b/ext/gsl_native/include/rb_gsl_common.h
@@ -290,11 +290,12 @@ EXTERN ID rb_gsl_id_beg, rb_gsl_id_end, rb_gsl_id_excl, rb_gsl_id_to_a;
rb_raise(rb_eTypeError, "wrong argument type (GSL::Histogram expected)");
#endif
+
#ifndef RBGSL_SET_CLASS
#ifdef RB_OBJ_WRITE
#define RBGSL_SET_CLASS0(obj0, cls) RB_OBJ_WRITE(obj0, &(RBASIC_CLASS(obj0)), cls)
#else
-#define RBGSL_SET_CLASS0(obj0, cls) RBASIC(obj0)->klass = cls
+#define RBGSL_SET_CLASS0(obj0, cls) rb_obj_hide(obj0); rb_obj_reveal(obj0,cls)
#endif
#define RBGSL_SET_CLASS(obj, cls) do { \
VALUE _obj_ = (obj); \
So rake compile
works with rbx 2.0.
rake test
gives the error below, which is something I've not seen before, coming from MRI. Google doesn't reveal anything on it.
An exception occurred running /home/edmundhighcock/.rvm/gems/rbx-2.5.2@global/gems/rake-10.4.2/lib/rake/rake_test_loader.rb:
wrong number of arguments (ArgumentError)
Backtrace:
Rubinius.open_module_under at kernel/delta/rubinius.rb:37
Object#__script__ at lib/gsl/oper.rb:1
Rubinius::CodeLoader.require at kernel/common/code_loader.rb:247
Kernel(Object)#require at kernel/common/kernel.rb:755
Object#__script__ at lib/gsl.rb:8
Rubinius::CodeLoader.require at kernel/common/code_loader.rb:247
Kernel(Object)#require at kernel/common/kernel.rb:755
Object#__script__ at test/test_helper.rb:2
Rubinius::CodeLoader.require at kernel/common/code_loader.rb:247
Kernel(Object)#require at kernel/common/kernel.rb:755
Object#__script__ at test/gsl_test.rb:1
Rubinius::CodeLoader.require at kernel/common/code_loader.rb:247
Kernel(Object)#require at kernel/common/kernel.rb:755
{ } in Object#__script__ at /home/edmundhighcock/.rvm/gems
/rbx-2.5.2@global/gems/rake-10.4.2
/lib/rake/rake_test_loader.rb:15
{ } in Enumerable(Array)#find_all at kernel/common/enumerable.rb:465
Array#each at kernel/bootstrap/array.rb:76
Enumerable(Array)#select (find_all) at kernel/common/enumerable.rb:463
Object#__script__ at /home/edmundhighcock/.rvm/gems
/rbx-2.5.2@global/gems/rake-10.4.2
/lib/rake/rake_test_loader.rb:4
Rubinius::CodeLoader#load_script at kernel/delta/code_loader.rb:66
Rubinius::CodeLoader.load_script at kernel/delta/code_loader.rb:152
Rubinius::Loader#script at kernel/loader.rb:655
Rubinius::Loader#main at kernel/loader.rb:809
rake aborted!
Hi all,
Thanks for your continued work on this very useful gem.
Just out of interest, has anyone had a look at making this Rubinius compatible? How much work would it be? I'm interested in looking at it at some point, but just wanted to see what, if anything had been attemped.
A quick attempt to build it in Rubinius seems to a show a lot of the source files building without a hitch (see below), so maybe it's not too bad.
Edmund