Skip to content

Unable to install Iodine gem which uses a C extension on MacOS #2010

@pchaganti

Description

@pchaganti

Using the most recent release - truffleruby-20.0.0 on Mac OS X 10.15.4. Truffleruby was installed using rvm.

Unable to build iodine gem that uses c extension. Trying to track this down, but there is not much in terms of an error message that I can use. Anyone have any idea where to look for this issue?

thanks!

gem install iodine -v '0.7.38' --source 'https://rubygems.org/'
Building native extensions. This could take a while...
ERROR:  Error installing iodine:
	ERROR: Failed to build gem native extension.

    current directory: /Users/hades/.rvm/gems/truffleruby-20.0.0@thor/gems/iodine-0.7.38/ext/iodine
/Users/hades/.rvm/rubies/truffleruby-20.0.0/bin/truffleruby -I /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/mri -r ./siteconf20200514-41343-8leuhq.rb extconf.rb
checking for clang... yes
testing clang for stdatomic support...
using clang compiler v. 11.0.3
.
/Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1299:in `find_type': wrong number of arguments (given 1, expected 2+) (ArgumentError)
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/truffle/ffi/struct.rb:272:in `find_type'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/truffle/ffi/struct.rb:266:in `find_field_type'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/truffle/ffi/struct.rb:306:in `array_layout'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/truffle/ffi/struct.rb:218:in `layout'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/truffle/socket/truffle.rb:63:in `config'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/truffle/socket/truffle/foreign/addrinfo.rb:31:in `Addrinfo'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/truffle/socket/truffle/foreign/addrinfo.rb:30:in `Foreign'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/truffle/socket/truffle/foreign/addrinfo.rb:29:in `Socket'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/truffle/socket/truffle/foreign/addrinfo.rb:28:in `Truffle'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/truffle/socket/truffle/foreign/addrinfo.rb:27:in `<top (required)>'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/truffle/socket.rb:38:in `require'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/truffle/socket.rb:38:in `require'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/truffle/socket.rb:38:in `<top (required)>'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/mri/ipaddr.rb:19:in `require'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/mri/ipaddr.rb:19:in `require'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/mri/ipaddr.rb:19:in `<top (required)>'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/mri/openssl/ssl.rb:15:in `require'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/mri/openssl/ssl.rb:15:in `require'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/mri/openssl/ssl.rb:15:in `<top (required)>'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/mri/openssl.rb:21:in `require'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/mri/openssl.rb:21:in `require'
	from /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/mri/openssl.rb:21:in `<top (required)>'
	from extconf.rb:118:in `require'
	from extconf.rb:118:in `require'
	from extconf.rb:118:in `<main>'
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/Users/hades/.rvm/rubies/truffleruby-20.0.0/bin/truffleruby
	--with-openssl-dir
	--without-openssl-dir
	--with-openssl-include
	--without-openssl-include=${openssl-dir}/include
	--with-openssl-lib
	--without-openssl-lib=${openssl-dir}/lib

Contents of mkmf.log:
find_executable: checking for clang... -------------------- yes

--------------------

"/Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/bin/graalvm-native-clang -o conftest -I/Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I/Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/cext/include/ruby/backward -I/Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I.    -I/usr/local/opt/openssl@1.1/include   -Wimplicit-function-declaration -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-format-invalid-specifier -Wno-format-extra-args -ferror-limit=500 conftest.c  -L. -L/Users/hades/.rvm/rubies/truffleruby-20.0.0/lib  -L/usr/local/opt/openssl@1.1/lib -rpath /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/lib     -L/Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/cext -rpath /Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/cext -ltruffleruby -lpolyglot-mock   "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

conftest.c:3:9: warning: '_GNU_SOURCE' macro redefined [-Wmacro-redefined]
#define _GNU_SOURCE
        ^
/Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/cext/include/truffleruby/config_darwin.h:16:9: note: previous definition is here
#define _GNU_SOURCE 1
        ^
conftest.c:9:10: fatal error: 'sys/epoll.h' file not found
#include <sys/epoll.h>
         ^~~~~~~~~~~~~
1 warning and 1 error generated.
"/Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/bin/graalvm-native-clang -I/Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I/Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/cext/include/ruby/backward -I/Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I.    -I/usr/local/opt/openssl@1.1/include   -Wimplicit-function-declaration -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-format-invalid-specifier -Wno-format-extra-args -ferror-limit=500   -o conftest.o -c conftest.c"
Process failed: #<Process::Status: pid 41403 exit 1>
checked program was:
/* begin */
 1: #include "ruby.h"
 2:
 3: #define _GNU_SOURCE
 4: #include <stdlib.h>
 5: #include <stdio.h>
 6: #include <sys/types.h>
 7: #include <sys/stat.h>
 8: #include <fcntl.h>
 9: #include <sys/epoll.h>
10: int main(void) {
11:   int fd = epoll_create1(EPOLL_CLOEXEC);
12: }
/* end */

conftest.c:3:9: warning: '_GNU_SOURCE' macro redefined [-Wmacro-redefined]
#define _GNU_SOURCE
        ^
/Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/cext/include/truffleruby/config_darwin.h:16:9: note: previous definition is here
#define _GNU_SOURCE 1
        ^
1 warning generated.
"/Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/bin/graalvm-native-clang -I/Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I/Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/cext/include/ruby/backward -I/Users/hades/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I.    -I/usr/local/opt/openssl@1.1/include   -Wimplicit-function-declaration -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-format-invalid-specifier -Wno-format-extra-args -ferror-limit=500   -o conftest.o -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #define _GNU_SOURCE
4: #include <stdlib.h>
5: #include <sys/event.h>
6: int main(void) {
7:   int fd = kqueue();
8: }
/* end */

detected `kqueue`

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/hades/.rvm/gems/truffleruby-20.0.0@thor/extensions/x86_64-darwin/20.0.0/iodine-0.7.38/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/hades/.rvm/gems/truffleruby-20.0.0@thor/gems/iodine-0.7.38 for inspection.
Results logged to /Users/hades/.rvm/gems/truffleruby-20.0.0@thor/extensions/x86_64-darwin/20.0.0/iodine-0.7.38/gem_make.out

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions