Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

invalid conversion from 'EventableDescriptor*' to '__intptr_t' #79

Closed
r-stu31 opened this Issue Aug 2, 2010 · 3 comments

Comments

Projects
None yet
3 participants

r-stu31 commented Aug 2, 2010

It is not possible to install the eventmachine-0.12.10 gem on NetBSD 5.1_RC3, i386:

$ gem install eventmachine
ERROR:  Error installing eventmachine:
    ERROR: Failed to build gem native extension.

/usr/pkg/bin/ruby18 extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... yes
checking for rb_thread_blocking_region()... no
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... yes
checking for rb_thread_check_ints()... no
checking for rb_time_new()... yes
checking for sys/event.h... yes
checking for sys/queue.h... yes
checking for main() in -lssl... yes
checking for main() in -lcrypto... yes
checking for openssl/ssl.h... yes
checking for openssl/err.h... yes
creating Makefile

make
c++ -I. -I. -I/usr/pkg/lib/ruby/1.8/i386-netbsdelf -I. -DBUILD_FOR_RUBY -DHAVE_RB_TRAP_IMMEDIATE -DHAVE_RBTRAP -DHAVE_WRITEV -DHAVE_WRITEV -DHAVE_RB_TIME_NEW -DOS_UNIX -DHAVE_SYS_EVENT_H -DHAVE_SYS_QUEUE_H -DHAVE_KQUEUE -DHAVE_OPENSSL_SSL_H -DHAVE_OPENSSL_ERR_H -DWITH_SSL -I/usr/include  -I/usr/include -fPIC -O2 -march=i686 -g -pthread -I/usr/include  -fPIC -pipe  -c binder.cpp
c++ -I. -I. -I/usr/pkg/lib/ruby/1.8/i386-netbsdelf -I. -DBUILD_FOR_RUBY -DHAVE_RB_TRAP_IMMEDIATE -DHAVE_RBTRAP -DHAVE_WRITEV -DHAVE_WRITEV -DHAVE_RB_TIME_NEW -DOS_UNIX -DHAVE_SYS_EVENT_H -DHAVE_SYS_QUEUE_H -DHAVE_KQUEUE -DHAVE_OPENSSL_SSL_H -DHAVE_OPENSSL_ERR_H -DWITH_SSL -I/usr/include  -I/usr/include -fPIC -O2 -march=i686 -g -pthread -I/usr/include  -fPIC -pipe  -c cmain.cpp
c++ -I. -I. -I/usr/pkg/lib/ruby/1.8/i386-netbsdelf -I. -DBUILD_FOR_RUBY -DHAVE_RB_TRAP_IMMEDIATE -DHAVE_RBTRAP -DHAVE_WRITEV -DHAVE_WRITEV -DHAVE_RB_TIME_NEW -DOS_UNIX -DHAVE_SYS_EVENT_H -DHAVE_SYS_QUEUE_H -DHAVE_KQUEUE -DHAVE_OPENSSL_SSL_H -DHAVE_OPENSSL_ERR_H -DWITH_SSL -I/usr/include  -I/usr/include -fPIC -O2 -march=i686 -g -pthread -I/usr/include  -fPIC -pipe  -c cplusplus.cpp
c++ -I. -I. -I/usr/pkg/lib/ruby/1.8/i386-netbsdelf -I. -DBUILD_FOR_RUBY -DHAVE_RB_TRAP_IMMEDIATE -DHAVE_RBTRAP -DHAVE_WRITEV -DHAVE_WRITEV -DHAVE_RB_TIME_NEW -DOS_UNIX -DHAVE_SYS_EVENT_H -DHAVE_SYS_QUEUE_H -DHAVE_KQUEUE -DHAVE_OPENSSL_SSL_H -DHAVE_OPENSSL_ERR_H -DWITH_SSL -I/usr/include  -I/usr/include -fPIC -O2 -march=i686 -g -pthread -I/usr/include  -fPIC -pipe  -c ed.cpp
c++ -I. -I. -I/usr/pkg/lib/ruby/1.8/i386-netbsdelf -I. -DBUILD_FOR_RUBY -DHAVE_RB_TRAP_IMMEDIATE -DHAVE_RBTRAP -DHAVE_WRITEV -DHAVE_WRITEV -DHAVE_RB_TIME_NEW -DOS_UNIX -DHAVE_SYS_EVENT_H -DHAVE_SYS_QUEUE_H -DHAVE_KQUEUE -DHAVE_OPENSSL_SSL_H -DHAVE_OPENSSL_ERR_H -DWITH_SSL -I/usr/include  -I/usr/include -fPIC -O2 -march=i686 -g -pthread -I/usr/include  -fPIC -pipe  -c em.cpp
em.cpp: In member function 'void EventMachine_t::_ReadLoopBreaker()':
em.cpp:924: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp: In member function 'bool EventMachine_t::_RunTimers()':
em.cpp:948: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp: In member function 'const long unsigned int EventMachine_t::ConnectToServer(const char*, int, const char*, int)':
em.cpp:1089: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp: In member function 'const long unsigned int EventMachine_t::ConnectToUnixServer(const char*)':
em.cpp:1218: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp:1221: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp:1237: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp:1243: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp:1249: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp: In member function 'int EventMachine_t::DetachFD(EventableDescriptor*)':
em.cpp:1350: error: invalid conversion from 'EventableDescriptor*' to '__intptr_t'
em.cpp: In member function 'const long unsigned int EventMachine_t::CreateTcpServer(const char*, int)':
em.cpp:1453: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp:1455: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp:1535: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp: In member function 'const long unsigned int EventMachine_t::OpenDatagramSocket(const char*, int)':
em.cpp:1545: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp:1596: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp: In member function 'void EventMachine_t::ArmKqueueWriter(EventableDescriptor*)':
em.cpp:1625: error: invalid conversion from 'EventableDescriptor*' to '__intptr_t'
em.cpp: In member function 'void EventMachine_t::ArmKqueueReader(EventableDescriptor*)':
em.cpp:1647: error: invalid conversion from 'EventableDescriptor*' to '__intptr_t'
em.cpp: In member function 'const long unsigned int EventMachine_t::_OpenFileForWriting(const char*)':
em.cpp:1773: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp: In member function 'const long unsigned int EventMachine_t::CreateUnixDomainServer(const char*)':
em.cpp:1805: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp:1866: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp: In member function 'const long unsigned int EventMachine_t::Socketpair(char* const*)':
em.cpp:1927: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp:1932: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp:1934: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp:1938: warning: converting to non-pointer type 'long unsigned int' from NULL
em.cpp:1948: warning: converting to non-pointer type 'long unsigned int' from NULL
*** Error code 1

Stop.
make: stopped in /tmp/gems/gems/eventmachine-0.12.10/ext


Gem files will remain installed in /tmp/gems/gems/eventmachine-0.12.10 for inspection.
Results logged to /tmp/gems/gems/eventmachine-0.12.10/ext/gem_make.out
Building native extensions.  This could take a while...

$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i386-netbsdelf]

r-stu31 commented Feb 13, 2011

NetBSD defines struct kevent as:

struct kevent {
        uintptr_t       ident;          /* identifier for this event */
        uint32_t        filter;         /* filter for event */
        uint32_t        flags;          /* action flags for kqueue */
        uint32_t        fflags;         /* filter flag value */
        int64_t         data;           /* filter data value */
        intptr_t        udata;          /* opaque user data identifier */
};

Here is a patch used in pkgsrc for eventmachine:
http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/pkgsrc/devel/ruby-eventmachine/patches/patch-aa?rev=1.4&only_with_tag=MAIN

@raggi raggi closed this in 922b97b Sep 29, 2011

rwboyer commented Jan 4, 2012

Here is the issue with using pkgsrc to fix this....

99% of my deployments are done using Bundler and without a lot of headaches bundler will still try to build w/o the patch. Unless I am missing something? Typically I would rather have my deployment isolated from gems on the target system for all of the obvious reasons why bundler exists. Maybe it would be a better idea to deal with this another way?

Ps. I may be the only NetBSD fan on github but we still exist - sort of...

RB

r-stu31 commented Apr 15, 2012

rwboyer: I am sorry to reply so late. This fix will work for any kind of installation of eventmachine gem (as long, as your cpp defines __NetBSD__ macro (check cpp -dM </dev/null if it has the #define __NetBSD__ 1 line), the one installed on NetBSD by default does this).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment