ryanmelt / qtbindings

An easy to install gem version of the Ruby bindings to Qt
http://github.com/ryanmelt/qtbindings
Other
340 stars 63 forks source link

"gem install qtbindings": error: ‘__builtin_choose_expr’ was not declared in this scope #134

Closed philipp-classen closed 8 years ago

philipp-classen commented 8 years ago

gem install qtbindings fails on Arch Linux with an "__builtin_choose_expr’ was not declared in this scope" error.

$ ruby --version
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
$ gcc --version
gcc (GCC) 5.3.0

Here is the complete error message:

Scanning dependencies of target smokeqthelp
make[3]: Leaving directory '/home/phil/.gem/ruby/2.3.0/gems/qtbindings-4.8.6.2/ext/build'
make[3]: Entering directory '/home/phil/.gem/ruby/2.3.0/gems/qtbindings-4.8.6.2/ext/build'
[ 78%] Building CXX object smoke/qthelp/CMakeFiles/smokeqthelp.dir/smokedata.o
[ 79%] Building CXX object smoke/qthelp/CMakeFiles/smokeqthelp.dir/x_1.o
[ 79%] Linking CXX shared library libsmokeqthelp.so
make[3]: Leaving directory '/home/phil/.gem/ruby/2.3.0/gems/qtbindings-4.8.6.2/ext/build'
[ 79%] Built target smokeqthelp
make[3]: Entering directory '/home/phil/.gem/ruby/2.3.0/gems/qtbindings-4.8.6.2/ext/build'
Scanning dependencies of target qtruby4shared
make[3]: Leaving directory '/home/phil/.gem/ruby/2.3.0/gems/qtbindings-4.8.6.2/ext/build'
make[3]: Entering directory '/home/phil/.gem/ruby/2.3.0/gems/qtbindings-4.8.6.2/ext/build'
[ 80%] Building CXX object ruby/qtruby/src/CMakeFiles/qtruby4shared.dir/Qt.o
[ 81%] Building CXX object ruby/qtruby/src/CMakeFiles/qtruby4shared.dir/handlers.o
[ 81%] Building CXX object ruby/qtruby/src/CMakeFiles/qtruby4shared.dir/marshall_types.o
In file included from /usr/include/ruby-2.3.0/ruby.h:33:0,
                 from /home/phil/.gem/ruby/2.3.0/gems/qtbindings-4.8.6.2/ext/ruby/qtruby/src/marshall.h:14,
                 from /home/phil/.gem/ruby/2.3.0/gems/qtbindings-4.8.6.2/ext/ruby/qtruby/src/marshall_types.h:28,
                 from /home/phil/.gem/ruby/2.3.0/gems/qtbindings-4.8.6.2/ext/ruby/qtruby/src/marshall_types.cpp:19:
/home/phil/.gem/ruby/2.3.0/gems/qtbindings-4.8.6.2/ext/ruby/qtruby/src/marshall_types.cpp: In function ‘void show_exception_message()’:
/usr/include/ruby-2.3.0/ruby/ruby.h:882:52: error: ‘__builtin_choose_expr’ was not declared in this scope
      OBJ_WB_UNPROTECT((VALUE)(obj)), ((VALUE)(obj))))
                                                    ^
/usr/include/ruby-2.3.0/ruby/ruby.h:1039:48: note: in definition of macro ‘RARRAY_CONST_PTR’
 #define RARRAY_CONST_PTR(a) rb_array_const_ptr(a)
                                                ^
/usr/include/ruby-2.3.0/ruby/ruby.h:1059:50: note: in expansion of macro ‘RB_OBJ_WB_UNPROTECT_FOR’
 #define RARRAY_PTR(a) ((VALUE *)RARRAY_CONST_PTR(RB_OBJ_WB_UNPROTECT_FOR(ARRAY, a)))
                                                  ^
/home/phil/.gem/ruby/2.3.0/gems/qtbindings-4.8.6.2/ext/ruby/qtruby/src/marshall_types.cpp:82:21: note: in expansion of macro ‘RARRAY_PTR’
     VALUE message = RARRAY_PTR(bt)[0];
                     ^
ruby/qtruby/src/CMakeFiles/qtruby4shared.dir/build.make:110: recipe for target 'ruby/qtruby/src/CMakeFiles/qtruby4shared.dir/marshall_types.o' failed
make[3]: *** [ruby/qtruby/src/CMakeFiles/qtruby4shared.dir/marshall_types.o] Error 1
make[3]: Leaving directory '/home/phil/.gem/ruby/2.3.0/gems/qtbindings-4.8.6.2/ext/build'
CMakeFiles/Makefile2:1639: recipe for target 'ruby/qtruby/src/CMakeFiles/qtruby4shared.dir/all' failed
make[2]: *** [ruby/qtruby/src/CMakeFiles/qtruby4shared.dir/all] Error 2
make[2]: Leaving directory '/home/phil/.gem/ruby/2.3.0/gems/qtbindings-4.8.6.2/ext/build'
Makefile:127: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/phil/.gem/ruby/2.3.0/gems/qtbindings-4.8.6.2/ext/build'
Makefile:47: recipe for target 'build' failed
make: *** [build] Error 2
jmthomas commented 8 years ago

Looks like this is an issue with Ruby 2.3. Here someone else found something similar: https://github.com/SciRuby/nmatrix/issues/429. Here is the Ruby bug report:https://bugs.ruby-lang.org/issues/11962

Ruin0x11 commented 8 years ago

Is there any workaround for this? The bugfix hasn't been backported to 2.3.0, and between chruby, rbenv and installing a local copy of 2.2.0 on my machine, I haven't found a way to run my project which depends on qtbindings since upgrading to 2.3.0.

jmthomas commented 8 years ago

We are waiting for a proper Ruby bug fix before moving to 2.3.0. I would suggest the workaround presented in the link I mentioned above. There is also another link in the Ruby bug report to the SWIG project which also appears to have worked around it.