Incompatible with oj gem when running bundle install. #916
Replies: 3 comments 5 replies
-
It looks like the latest compiler is more picky. Some of the ruby APIs have changed over the year ever so slightly. For example going from void* to VALUE. I can fix the ones in Oj but not the ones in ruby. I'm on macOS 14.2.1 and I have not run into that issue but I am also using Ruby 3.2. Have you tried moving to a more recent version of ruby? Ruby 2.7.0 came out in 2019 and while the 2.7.8 patch version was last year most of the code is still 5 years old. Are you restricted to ruby 2.7.x? |
Beta Was this translation helpful? Give feedback.
-
Builds okay with Ruby 3.2. I'll try 2.7.8 next. |
Beta Was this translation helpful? Give feedback.
-
Oj builds for me with macOS Sonoma 14.4, ruby version is 2.7.8. Could there be some oddness since you are building inside the .rvm/gems folder? Can you try pulling and building? |
Beta Was this translation helpful? Give feedback.
-
I'm using Macbook M3, OS Sonoma 14.4, ruby version is 2.7.8 , I'm facing this issue when run
bundle install
. I did install xcode version 15 , and using flag-- --with-cflags=-Wno-implicit-function-declaration
. But the issue is remain the same. Can you help to resolve this issue. Thank you !`Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/huyhuynh/.rvm/rubies/ruby-2.7.8/bin/ruby -I /Users/huyhuynh/.rvm/rubies/ruby-2.7.8/lib/ruby/2.7.0 -r ./siteconf20240310-16248-19xxpvp.rb extconf.rb
current directory: /Users/huyhuynh/.rvm/gems/ruby-2.7.8@2.7.8XXX/gems/oj-3.9.1/ext/oj
make "DESTDIR=" clean
current directory: /Users/huyhuynh/.rvm/gems/ruby-2.7.8@2.7.8XXX/gems/oj-3.9.1/ext/oj
make "DESTDIR="
compiling cache8.c
compiling circarray.c
compiling code.c
compiling compat.c
compiling custom.c
custom.c:376:23: error: incompatible function pointer types passing 'int (VALUE, VALUE, Out)' (aka 'int (unsigned long, unsigned long, struct _out )') to parameter of type 'int ()(VALUE, VALUE, VALUE)' (aka 'int
()(unsigned long, unsigned long, unsigned long)') [-Wincompatible-function-pointer-types]
rb_hash_foreach(obj, hash_cb, (VALUE)out);
^~~~~~~
/Users/huyhuynh/.rvm/rubies/ruby-2.7.8/include/ruby-2.7.0/ruby/intern.h:558:35: note: passing argument to parameter here
void rb_hash_foreach(VALUE, int ()(VALUE, VALUE, VALUE), VALUE);
^
custom.c:686:26: error: incompatible function pointer types passing 'int (ID, VALUE, Out)' (aka 'int (unsigned long, unsigned long, struct _out )') to parameter of type 'int ()(ID, VALUE, st_data_t)' (aka 'int
()(unsigned long, unsigned long, unsigned long)') [-Wincompatible-function-pointer-types]
rb_ivar_foreach(obj, dump_attr_cb, (VALUE)out);
^~~~~~~~~~~~
/Users/huyhuynh/.rvm/rubies/ruby-2.7.8/include/ruby-2.7.0/ruby/intern.h:986:35: note: passing argument to parameter here
void rb_ivar_foreach(VALUE, int ()(ID, VALUE, st_data_t), st_data_t);
^
2 errors generated.
make: *** [custom.o] Error 1
make failed, exit code 2`
Beta Was this translation helpful? Give feedback.
All reactions