As reported in #3201, the ruby plugin fails to build with:
FAILED: src/plugins/ruby/CMakeFiles/elektra-ruby-objects.dir/ruby.cpp.o
/usr/local/opt/llvm/bin/clang++ -DELEKTRA_MODULE_NAME=ruby -DELEKTRA_PLUGIN_NAME=\"ruby\" -DELEKTRA_PLUGIN_NAME_C=ruby -DELEKTRA_STATIC -DHAVE_KDBCONFIG_H -DPLUGIN_SHORT_NAME=ruby -DREADME=readme_ruby.c -DSWIG_RUNTIME=\"runtime.h\" -DSWIG_TYPE_TABLE=kdb -Isrc/include -I../src/include -Isrc/bindings/cpp/include -I../src/bindings/cpp/include -Isrc/plugins/ruby -std=c++11 -Wno-deprecated-declarations -Wold-style-cast -Wno-missing-field-initializers -Woverloaded-virtual -Wsign-promo -Werror -Wno-long-long -Wpedantic -Wno-variadic-macros -Wall -Wextra -Wno-overlength-strings -Wsign-compare -Wfloat-equal -Wformat -Wformat-security -Wshadow -Wcomments -Wtrigraphs -Wundef -Wuninitialized -Winit-self -O2 -g -DNDEBUG -isysroot /Applications/Xcode-12.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -fPIC -isystem "/usr/local/Cellar/ruby/2.7.2/include/ruby-2.7.0" -isystem "/usr/local/Cellar/ruby/2.7.2/include/ruby-2.7.0/x86_64-darwin19" -Wno-shadow -Wno-old-style-cast -Wno-unused-variable -Wno-unused-parameter -Wno-deprecated-register -Wno-macro-redefined -Wno-reserved-user-defined-literal -Wno-gnu-zero-variadic-macro-arguments -MD -MT src/plugins/ruby/CMakeFiles/elektra-ruby-objects.dir/ruby.cpp.o -MF src/plugins/ruby/CMakeFiles/elektra-ruby-objects.dir/ruby.cpp.o.d -o src/plugins/ruby/CMakeFiles/elektra-ruby-objects.dir/ruby.cpp.o -c ../src/plugins/ruby/ruby.cpp
../src/plugins/ruby/ruby.cpp:39:15: error: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Werror,-Wnon-c-typedef-for-linkage]
typedef struct
^
moduleData
../src/plugins/ruby/ruby.cpp:41:21: note: type is not C-compatible due to this default member initializer
VALUE rbInstance = Qnil;
^~~~
/usr/local/Cellar/ruby/2.7.2/include/ruby-2.7.0/ruby/ruby.h:469:16: note: expanded from macro 'Qnil'
#define Qnil RUBY_Qnil
^~~~~~~~~
/usr/local/Cellar/ruby/2.7.2/include/ruby-2.7.0/ruby/ruby.h:465:21: note: expanded from macro 'RUBY_Qnil'
#define RUBY_Qnil ((VALUE)RUBY_Qnil)
^~~~~~~~~~~~~~~~~~
../src/plugins/ruby/ruby.cpp:43:3: note: type is given name 'moduleData' for linkage purposes by this typedef declaration
} moduleData;
^
1 error generated.
https://github.com/ElektraInitiative/libelektra/pull/3201/checks?check_run_id=1395368334
@BernhardDenner do you have any idea what this could be?
@mpranj Do you know why this does not occur on master? Is it some ruby update that occurred in the last 8 days?
Afaik there was a Ruby 2.7.1 -> 2.7.2 update when this appeared.
I downgraded Ruby to 2.6 now s.t. master builds are fine until the real issue is resolved.
Edit: the downgrade to Ruby 2.6 did not help either. I disabled the ruby plugin on cirrus-ci for now (c4b6ed9ac34d9ce2932b8d7a619bc67fede291a6).
Thank you so much, strange that the downgrading did not help. Was it the same error?
Yes, from what I see it was the same error. 馃し
It seems that it is related to clang/llvm from homebrew. When I use the bundled macOS clang compiler, the error is gone.
Something like https://reviews.llvm.org/D79548 (is a false positive about -Wnon-c-typedef-for-linkage)?
I wonder why the warning still turns to an error, I thought #3529 made all warnings to be ignored.
I gave it an explicit name in 698179a005ac16096912e9d6bd841cc320fbeb32 until somebody has a better fix.
I think this is fine, let us close the issue if it builds.
Closed via 698179a005ac16096912e9d6bd841cc320fbeb32.