zerowidth / camper_van

A Campfire to IRC bridge
MIT License
129 stars 25 forks source link

Outdated dependency eventmachine doesn't build on modern systems #29

Closed pdbogen closed 11 years ago

pdbogen commented 11 years ago

This is a known issue in eventmachine that's fixed in versions newer than the four (4!) year old version camper_van is targeting.

This was all run on a newly spun up EC2 instance of Ubuntu Server 12.10:

root@ip-10-253-82-98:~# ruby --version
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
root@ip-10-253-82-98:~# git clone https://github.com/aniero/camper_van.git
Cloning into 'camper_van'...
remote: Counting objects: 628, done.
remote: Compressing objects: 100% (272/272), done.
remote: Total 628 (delta 354), reused 606 (delta 333)
Receiving objects: 100% (628/628), 84.28 KiB | 65 KiB/s, done.
Resolving deltas: 100% (354/354), done.
root@ip-10-253-82-98:~# cd camper_van/
root@ip-10-253-82-98:~/camper_van# gem install camper_van
Building native extensions.  This could take a while...
ERROR:  Error installing camper_van:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for inotify_init() in sys/inotify.h... yes
checking for writev() in sys/uio.h... yes
checking for rb_thread_check_ints()... yes
checking for rb_time_new()... yes
checking for sys/event.h... no
checking for epoll_create() in sys/epoll.h... yes
checking for main() in -lcrypto... no
creating Makefile

make
compiling em.cpp
em.cpp: In member function ‘bool EventMachine_t::_RunEpollOnce()’:
em.cpp:501:3: warning: ‘int rb_thread_select(int, fd_set*, fd_set*, fd_set*, timeval*)’ is deprecated (declared at /usr/include/ruby-1.9.1/ruby/intern.h:379) [-Wdeprecated-declarations]
em.cpp:501:37: warning: ‘int rb_thread_select(int, fd_set*, fd_set*, fd_set*, timeval*)’ is deprecated (declared at /usr/include/ruby-1.9.1/ruby/intern.h:379) [-Wdeprecated-declarations]
em.cpp:556:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
em.cpp: In member function ‘bool EventMachine_t::_RunSelectOnce()’:
em.cpp:873:4: warning: ‘int rb_thread_select(int, fd_set*, fd_set*, fd_set*, timeval*)’ is deprecated (declared at /usr/include/ruby-1.9.1/ruby/intern.h:379) [-Wdeprecated-declarations]
em.cpp:873:38: warning: ‘int rb_thread_select(int, fd_set*, fd_set*, fd_set*, timeval*)’ is deprecated (declared at /usr/include/ruby-1.9.1/ruby/intern.h:379) [-Wdeprecated-declarations]
em.cpp: In member function ‘void EventMachine_t::_ReadLoopBreaker()’:
em.cpp:924:52: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘bool EventMachine_t::_RunTimers()’:
em.cpp:948:72: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘const long unsigned int EventMachine_t::ConnectToServer(const char*, int, const char*, int)’:
em.cpp:1089:22: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘const long unsigned int EventMachine_t::ConnectToUnixServer(const char*)’:
em.cpp:1218:22: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1221:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1237:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1243:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1249:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘const long unsigned int EventMachine_t::CreateTcpServer(const char*, int)’:
em.cpp:1453:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1455:33: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1535:9: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘const long unsigned int EventMachine_t::OpenDatagramSocket(const char*, int)’:
em.cpp:1545:33: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1596:9: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘const long unsigned int EventMachine_t::_OpenFileForWriting(const char*)’:
em.cpp:1773:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘const long unsigned int EventMachine_t::CreateUnixDomainServer(const char*)’:
em.cpp:1805:33: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1866:9: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘const long unsigned int EventMachine_t::Socketpair(char* const*)’:
em.cpp:1927:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1932:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1934:33: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1938:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp:1948:10: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
em.cpp: In member function ‘void EventMachine_t::_ReadLoopBreaker()’:
em.cpp:922:50: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
em.cpp: In member function ‘void EventMachine_t::SignalLoopBreaker()’:
em.cpp:294:34: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
compiling cplusplus.cpp
compiling kb.cpp
kb.cpp: In member function ‘virtual void KeyboardDescriptor::Read()’:
kb.cpp:79:27: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
compiling sigs.cpp
compiling ed.cpp
ed.cpp: In member function ‘virtual int ConnectionDescriptor::SendOutboundData(const char*, int)’:
ed.cpp:503:76: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
ed.cpp: In member function ‘void ConnectionDescriptor::_WriteOutboundData()’:
ed.cpp:956:67: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
compiling ssl.cpp
compiling pipe.cpp
compiling emwin.cpp
compiling files.cpp
compiling binder.cpp
compiling page.cpp
compiling cmain.cpp
compiling epoll.cpp
compiling rubymain.cpp
rubymain.cpp: In function ‘VALUE t_connect_server(VALUE, VALUE, VALUE)’:
rubymain.cpp:468:42: error: format not a string literal and no format arguments [-Werror=format-security]
rubymain.cpp: In function ‘VALUE t_bind_connect_server(VALUE, VALUE, VALUE, VALUE, VALUE)’:
rubymain.cpp:488:42: error: format not a string literal and no format arguments [-Werror=format-security]
cc1plus: some warnings being treated as errors
make: *** [rubymain.o] Error 1
nicksergeant commented 11 years ago

I'm having the same problem. Any way around this?

pdbogen commented 11 years ago

This is in part an upstream problem (camper_van depends on firering). I forked both firering and camper_van and updated the dependency versions. You can grab them like so:

git clone https://github.com/pdbogen/firering.git
cd firering; git checkout up-versioned; gem build firering.gemspec; gem install ./firering-1.2.3.gem
git clone https://github.com/pdbogen/camper_van.git
cd camper_van; gem build camper_van.gemspec; gem install ./camper_van-0.0.8.gem

If you're still having problems, note that I'm using rvm and ruby 1.9.3. If you're note, try doing so: \curl -L https://get.rvm.io | bash --ruby=1.9.3 rvm use 1.9.3 and then following the above steps.

Or, hopefully, you can wait; I've submitted a pull request to firering to use the newer eventmachine, and when/if that goes through I can submit a pull request to camper_van.

nicksergeant commented 11 years ago

Thanks for the update. I can wait for the PR, no big deal.

zerowidth commented 11 years ago

Thanks for looking into this, guys. I'm not sure what a good solution would be except doing what @pdbogen has already done by forking/updating firering.

nicksergeant commented 11 years ago

@zerowidth yeah, I ended up following @pdbogen's instructions on installing w/ his forked firering and using the specific rvm (I was using system Ruby previously). Thanks for that, by the way, @pdbogen!