Open jrafanie opened 5 months ago
If I disable the error on incompatible function pointer types, I can get further:
% gem install ovirt-engine-sdk -v4.6.0 -- --with-cflags="-Wno-error=incompatible-function-pointer-types"
Building native extensions with: '--with-cflags=-Wno-error=incompatible-function-pointer-types'
This could take a while...
ERROR: Error installing ovirt-engine-sdk:
ERROR: Failed to build gem native extension.
current directory: /Users/joerafaniello/.gem/ruby/3.1.4/gems/ovirt-engine-sdk-4.6.0/ext/ovirtsdk4c
/Users/joerafaniello/.rubies/ruby-3.1.4/bin/ruby -I /Users/joerafaniello/.rubies/ruby-3.1.4/lib/ruby/3.1.0 extconf.rb --with-cflags\=-Wno-error\=incompatible-function-pointer-types
checking for xml2-config... yes
checking for curl-config... yes
creating Makefile
current directory: /Users/joerafaniello/.gem/ruby/3.1.4/gems/ovirt-engine-sdk-4.6.0/ext/ovirtsdk4c
make DESTDIR\= sitearchdir\=./.gem.20240507-32780-ykp917 sitelibdir\=./.gem.20240507-32780-ykp917 clean
current directory: /Users/joerafaniello/.gem/ruby/3.1.4/gems/ovirt-engine-sdk-4.6.0/ext/ovirtsdk4c
make DESTDIR\= sitearchdir\=./.gem.20240507-32780-ykp917 sitelibdir\=./.gem.20240507-32780-ykp917
compiling ov_error.c
compiling ov_http_client.c
ov_http_client.c:216:29: warning: excess elements in array initializer [-Wexcess-initializers]
.reserved = { NULL, NULL }
^~~~
/Library/Developer/CommandLineTools/usr/lib/clang/15.0.0/include/stddef.h:89:16: note: expanded from macro 'NULL'
# define NULL ((void*)0)
^~~~~~~~~~
ov_http_client.c:501:9: error: call to undeclared function 'ruby_thread_has_gvl_p'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
if (ruby_thread_has_gvl_p()) {
^
ov_http_client.c:853:25: warning: implicit conversion from enumeration type 'CURLMcode' to different enumeration type 'CURLcode' [-Wenum-conversion]
context_ptr->code = curl_multi_wait(context_ptr->handle, NULL, 0, timeout, NULL);
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ov_http_client.c:874:25: warning: implicit conversion from enumeration type 'CURLMcode' to different enumeration type 'CURLcode' [-Wenum-conversion]
context_ptr->code = curl_multi_perform(context_ptr->handle, &pending);
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ov_http_client.c:1009:47: warning: incompatible function pointer types passing 'int (VALUE, VALUE, struct curl_slist **)' (aka 'int (unsigned long, unsigned long, struct curl_slist **)') to parameter of type 'int (*)(VALUE, VALUE, VALUE)' (aka 'int (*)(unsigned long, unsigned long, unsigned long)') [-Wincompatible-function-pointer-types]
rb_hash_foreach(request_ptr->headers, ov_http_client_add_header, (VALUE) headers);
^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/joerafaniello/.rubies/ruby-3.1.4/include/ruby-3.1.0/ruby/internal/intern/hash.h:83:40: note: passing argument to parameter 'func' here
void rb_hash_foreach(VALUE hash, int (*func)(VALUE key, VALUE val, VALUE arg), VALUE arg);
^
4 warnings and 1 error generated.
make: *** [ov_http_client.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/joerafaniello/.gem/ruby/3.1.4/gems/ovirt-engine-sdk-4.6.0 for inspection.
Results logged to /Users/joerafaniello/.gem/ruby/3.1.4/extensions/arm64-darwin-23/3.1.0-static/ovirt-engine-sdk-4.6.0/gem_make.out
This is then gets me to issue https://github.com/oVirt/ovirt-engine-sdk-ruby/issues/11
Note, freebsd has a patch to resolve this issue against newer clang 16: https://cgit.freebsd.org/ports/commit/?id=463e93ce059522a1f1a93474bb41f90561b77d4f
See: https://github.com/oVirt/ovirt-engine-sdk-ruby/issues/11#issuecomment-2098807108
I had to use
gem install ovirt-engine-sdk -v4.6.0 -- --with-cflags="-Wno-error=incompatible-function-pointer-types -Wno-error=implicit-function-declaration"
I ran into #11 so I had to ignore both types of errors.
@mwperina Can you help out here or know who could help us?
These warnings are no longer ignorable in ruby 3.3. So I am not able to build on my dev machine (mac)
These warnings are no longer ignorable in ruby 3.3. So I am not able to build on my dev machine (mac)
This is not true. You are 99% likely running into other issue.
I can't find anything that changed in ruby 3.3 release notes that indicates this.
These warnings are no longer ignorable in ruby 3.3. So I am not able to build on my dev machine (mac)
@kbrock what clang is it attempting to build against? Some warnings can become errors in different versions.
See: https://github.com/oVirt/ovirt-engine-sdk-ruby/issues/11#issuecomment-2098801258
Check the release notes for the different branch/tag for the version you have.
@micwoj92 thank you for all your help