eventmachine v0.12.10 and bundle install #770

Closed
johannestaas opened this Issue Dec 2, 2012 · 6 comments

Projects

None yet

6 participants

@johannestaas

from 75532ff

just pulled this and had to change Gemfile to remove the eventmachine version requirement. here's some output:

$sudo gem install eventmachine -v '0.12.10'

Building native extensions. This could take a while...
ERROR: Error installing eventmachine:
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
creating Makefile

make
compiling binder.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

Gem files will remain installed in /var/lib/gems/1.9.1/gems/eventmachine-0.12.10 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/eventmachine-0.12.10/ext/gem_make.out

@johannestaas

Ubuntu 12.10 btw

@ghost ghost assigned bw-z and radoen Dec 20, 2012
@killabytenow

I have managed to compile the ext directory (the one which does not compile) removing the -Werror=format-security flag from the compiler options in ext/Makefile.

But now I dont know how to manually install the gem (I have not any experience with Ruby). Somebody knows how to manually install this gem or how to perform the installation with my "edited gem"? If I try to use "gem install" again, it overwrites my changes :(

@killabytenow

If seems that this flag is added by Ubuntu 12.10 as a default CFLAG, and used then by Ruby Gem. Other possible solution is to disable this default flag, but I cannot find where these flags are configured :'(

@killabytenow

Finally I found the solution! I will leave it here because it may be useful for a lot of people.

$ sudo bundle config build.eventmachine --with-cflags="-O2 -pipe -march=native -w"
$ sudo bundle install

I found it here gitlabhq/gitlabhq#1051 (comment)

@antisnatchor
Collaborator

Interesting, thanks for you help ;)

@cclements

Thanks, this was a big help to me as well.

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