Libelektra: Build error: Compilation stops at ruby plugin?

Created on 19 Jan 2020  路  4Comments  路  Source: ElektraInitiative/libelektra

Steps to Reproduce the Problem

I try to build elektra using this build function:

build() {
  cd lib$pkgname-$pkgver
  [[ -d build ]] || mkdir build
  cd build
  cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr \
        -DPLUGINS:STRING="ALL" \
        -DTOOLS:STRING="ALL" \
        -DBUILD_STATIC:STRING=OFF \
        -DBINDINGS:STRING="ALL" \
        -DSWIG_EXECUTABLE:STRING="/usr/bin/swig" \
        -DLUA_INCLUDE_DIR:PATH=/usr/include \
        -DLUA_LIBRARY:STRING=/usr/lib/liblua.so ..
  make clean 
  make
}

With ruby 2.7.0 installed this fails.
buildlog.txt
This is true for both tarball version 0.9.1 and fresh sources from master.

Downgrading to ruby 2.6.5 or deinstalling ruby at all solves the issue. But as I want to provide packages for AUR (Arch Linux), thes solutions are second grade solutions.

Is there a cmake directive to disable ruby support?

bug build lanruby

Most helpful comment

@manuelm does this tell something to you?

https://github.com/swig/swig/issues/1689

All 4 comments

Thank you for reporting the problem! As a workaround you can disable the ruby bindings and plugin via CMake directives like this:

...
        -DPLUGINS:STRING="ALL;-ruby" \
        -DBINDINGS:STRING="ALL;-ruby" \
...

We will leave the issue open until the underlying problem is resolved. @BernhardDenner would you have time to look at this?

I am not sure if this is something that can be fixed on our side. For me it looks like the used swig is incompatible with the used ruby? Which distribution is this?

In file included from /home/haawda/paketierung/meine_Pakete/elektra/src/libelektra-0.9.1/src/plugins/ruby/ruby.cpp:22:
/home/haawda/paketierung/meine_Pakete/elektra/src/libelektra-0.9.1/build/src/plugins/ruby/runtime.h: In function 'void SWIG_RubyInitializeTrackings()':
/home/haawda/paketierung/meine_Pakete/elektra/src/libelektra-0.9.1/build/src/plugins/ruby/runtime.h:1108:85: error: call of overloaded 'rb_define_virtual_variable(const char [21], VALUE (&)(...), NULL)' is ambiguous
 1108 |   rb_define_virtual_variable("SWIG_TRACKINGS_COUNT", swig_ruby_trackings_count, NULL);
      |                                                                                     ^
In file included from /usr/include/ruby-2.7.0/ruby/ruby.h:2863,
                 from /usr/include/ruby-2.7.0/ruby.h:33,
                 from /home/haawda/paketierung/meine_Pakete/elektra/src/libelektra-0.9.1/src/plugins/ruby/ruby.cpp:14:
/usr/include/ruby-2.7.0/ruby/backward/cxxanyargs.hpp:59:1: note: candidate: 'void ruby::backward::cxxanyargs::rb_define_virtual_variable(const char*, VALUE (*)(...), void (*)(...))'
   59 | rb_define_virtual_variable(const char *q, type *w, void_type *e)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/backward/cxxanyargs.hpp:90:1: note: candidate: 'void ruby::backward::cxxanyargs::rb_define_virtual_variable(const char*, VALUE (*)(...), void (*)(VALUE, ID, VALUE*))'
   90 | rb_define_virtual_variable(const char *q, type *w, rb_gvar_setter_t *e)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [src/plugins/ruby/CMakeFiles/elektra-ruby.dir/build.make:67: src/plugins/ruby/CMakeFiles/elektra-ruby.dir/ruby.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:10097: src/plugins/ruby/CMakeFiles/elektra-ruby.dir/all] Error 2

@manuelm does this tell something to you?

@manuelm does this tell something to you?

https://github.com/swig/swig/issues/1689

Thank you for looking into it! As it is an upstream issue, we will close it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

markus2330 picture markus2330  路  3Comments

mpranj picture mpranj  路  4Comments

mpranj picture mpranj  路  3Comments

e1528532 picture e1528532  路  4Comments

markus2330 picture markus2330  路  4Comments