Reputation: 10122
due to rubygem dependencies, eventmachine
version 1.0.0.beta.3 needs to be installed. installing the rubygem as follows, results in error. enclosed a snippet for convenience.
$ sudo gem install eventmachine -v '1.0.0.beta.3'
Building native extensions. This could take a while...
ERROR: Error installing eventmachine:
ERROR: Failed to build gem native extension.
/usr/bin/ruby2.0 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 "DESTDIR="
compiling cmain.cpp
compiling kb.cpp
kb.cpp: In member function ‘virtual void KeyboardDescriptor::Read()’:
kb.cpp:77:27: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
read (GetSocket(), &c, 1);
^
compiling pipe.cpp
compiling binder.cpp
compiling ed.cpp
compiling page.cpp
compiling rubymain.cpp
rubymain.cpp: In function ‘VALUE t_connect_server(VALUE, VALUE, VALUE)’:
rubymain.cpp:504:42: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eConnectionError, e.what());
^
rubymain.cpp: In function ‘VALUE t_bind_connect_server(VALUE, VALUE, VALUE, VALUE, VALUE)’:
rubymain.cpp:525:42: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eConnectionError, e.what());
^
rubymain.cpp: In function ‘VALUE t_watch_filename(VALUE, VALUE)’:
rubymain.cpp:798:38: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eUnsupported, e.what());
^
rubymain.cpp: In function ‘VALUE t_watch_pid(VALUE, VALUE)’:
rubymain.cpp:824:38: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eUnsupported, e.what());
^
rubymain.cpp: In function ‘VALUE t_start_proxy(VALUE, VALUE, VALUE, VALUE, VALUE)’:
rubymain.cpp:1024:42: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eConnectionError, e.what());
^
rubymain.cpp: In function ‘VALUE t_stop_proxy(VALUE, VALUE)’:
rubymain.cpp:1039:42: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eConnectionError, e.what());
^
cc1plus: some warnings being treated as errors
make: *** [rubymain.o] Error 1
Gem files will remain installed in /var/lib/gems/2.0.0/gems/eventmachine-1.0.0.beta.3 for inspection.
Results logged to /var/lib/gems/2.0.0/gems/eventmachine-1.0.0.beta.3/ext/gem_make.out
i tried to modify /var/lib/gems/2.0.0/gems/eventmachine-1.0.0.beta.3/ext/Makefile
by replacing -Werror=format-security
with -Wformat-security
, then running make
. it installed the the rubygem, though when trying to check whether the rubygem installation has a consistent behaviour. hence, i tried to invoke the command above (gem install...
) again, but it fails again.
here are few more details on the system:
$ ruby --version
ruby 2.0.0p299 (2013-08-29) [x86_64-linux-gnu]
$ cat /etc/*release* | grep -i distrib
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.10
DISTRIB_CODENAME=saucy
DISTRIB_DESCRIPTION="Ubuntu 13.10"
$ uname -a
Linux user 3.11.0-15-generic #23-Ubuntu SMP Mon Dec 9 18:17:04 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ gcc --version | grep gcc
gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
i am also familiar with this fix solution, and this one, but it does not work for me. any help would be appreciated.
UPDATE:
i also tried the following:
$ sudo gem install eventmachine -v '1.0.0.beta.3' -- --with-cflags=\"-Wno-error=format-security\"
Building native extensions with: '--with-cflags="-Wno-error=format-security"'
This could take a while...
ERROR: Error installing eventmachine:
ERROR: Failed to build gem native extension.
/usr/bin/ruby2.0 extconf.rb --with-cflags="-Wno-error=format-security"
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 "DESTDIR="
compiling cmain.cpp
compiling kb.cpp
kb.cpp: In member function ‘virtual void KeyboardDescriptor::Read()’:
kb.cpp:77:27: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
read (GetSocket(), &c, 1);
^
compiling pipe.cpp
compiling binder.cpp
compiling ed.cpp
compiling page.cpp
compiling rubymain.cpp
rubymain.cpp: In function ‘VALUE t_connect_server(VALUE, VALUE, VALUE)’:
rubymain.cpp:504:42: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eConnectionError, e.what());
^
rubymain.cpp: In function ‘VALUE t_bind_connect_server(VALUE, VALUE, VALUE, VALUE, VALUE)’:
rubymain.cpp:525:42: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eConnectionError, e.what());
^
rubymain.cpp: In function ‘VALUE t_watch_filename(VALUE, VALUE)’:
rubymain.cpp:798:38: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eUnsupported, e.what());
^
rubymain.cpp: In function ‘VALUE t_watch_pid(VALUE, VALUE)’:
rubymain.cpp:824:38: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eUnsupported, e.what());
^
rubymain.cpp: In function ‘VALUE t_start_proxy(VALUE, VALUE, VALUE, VALUE, VALUE)’:
rubymain.cpp:1024:42: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eConnectionError, e.what());
^
rubymain.cpp: In function ‘VALUE t_stop_proxy(VALUE, VALUE)’:
rubymain.cpp:1039:42: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eConnectionError, e.what());
^
cc1plus: some warnings being treated as errors
make: *** [rubymain.o] Error 1
Gem files will remain installed in /var/lib/gems/2.0.0/gems/eventmachine-1.0.0.beta.3 for inspection.
Results logged to /var/lib/gems/2.0.0/gems/eventmachine-1.0.0.beta.3/ext/gem_make.out
you can see that the flag is not propagated to the compilation of the rubygem.
UPDATE 2:
also tried the following:
$ sudo gem install eventmachine -v '1.0.0.beta.3' -- --with-cppflags=\"-Wno-error=format-security\"
Building native extensions with: '--with-cppflags="-Wno-error=format-security"'
This could take a while...
ERROR: Error installing eventmachine:
ERROR: Failed to build gem native extension.
/usr/bin/ruby2.0 extconf.rb --with-cppflags="-Wno-error=format-security"
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 "DESTDIR="
compiling cmain.cpp
compiling kb.cpp
kb.cpp: In member function ‘virtual void KeyboardDescriptor::Read()’:
kb.cpp:77:27: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
read (GetSocket(), &c, 1);
^
compiling pipe.cpp
compiling binder.cpp
compiling ed.cpp
compiling page.cpp
compiling rubymain.cpp
rubymain.cpp: In function ‘VALUE t_connect_server(VALUE, VALUE, VALUE)’:
rubymain.cpp:504:42: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eConnectionError, e.what());
^
rubymain.cpp: In function ‘VALUE t_bind_connect_server(VALUE, VALUE, VALUE, VALUE, VALUE)’:
rubymain.cpp:525:42: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eConnectionError, e.what());
^
rubymain.cpp: In function ‘VALUE t_watch_filename(VALUE, VALUE)’:
rubymain.cpp:798:38: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eUnsupported, e.what());
^
rubymain.cpp: In function ‘VALUE t_watch_pid(VALUE, VALUE)’:
rubymain.cpp:824:38: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eUnsupported, e.what());
^
rubymain.cpp: In function ‘VALUE t_start_proxy(VALUE, VALUE, VALUE, VALUE, VALUE)’:
rubymain.cpp:1024:42: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eConnectionError, e.what());
^
rubymain.cpp: In function ‘VALUE t_stop_proxy(VALUE, VALUE)’:
rubymain.cpp:1039:42: error: format not a string literal and no format arguments [-Werror=format-security]
rb_raise (EM_eConnectionError, e.what());
^
cc1plus: some warnings being treated as errors
make: *** [rubymain.o] Error 1
Gem files will remain installed in /var/lib/gems/2.0.0/gems/eventmachine-1.0.0.beta.3 for inspection.
Results logged to /var/lib/gems/2.0.0/gems/eventmachine-1.0.0.beta.3/ext/gem_make.out
UPDATE 3:
$ sudo gem install eventmachine -v '1.0.0.beta.3' 2>&1 | grep -i inspection
Gem files will remain installed in /var/lib/gems/2.0.0/gems/eventmachine-1.0.0.beta.3 for inspection.
$ grep -i error /var/lib/gems/2.0.0/gems/eventmachine-1.0.0.beta.3/ext/Makefile
CFLAGS = $(CCDLFLAGS) -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC $(ARCH_FLAG)
CXXFLAGS = $(CCDLFLAGS) -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security $(ARCH_FLAG)
$ sudo gem install eventmachine -v '1.0.0.beta.3' -- --with-cflags=\"-Wno-error=format-security\" --with-cppflags=\"-Wno-error=format-security\" --with-cxxflags=\"-Wno-error=format-security\" 2>&1 | grep -i inspection
Gem files will remain installed in /var/lib/gems/2.0.0/gems/eventmachine-1.0.0.beta.3 for inspection.
$ grep -i error /var/lib/gems/2.0.0/gems/eventmachine-1.0.0.beta.3/ext/Makefile
CFLAGS = $(CCDLFLAGS) -Wno-error=format-security $(ARCH_FLAG)
CPPFLAGS = -DWITH_SSL -DBUILD_FOR_RUBY -DHAVE_RB_THREAD_BLOCKING_REGION -DHAVE_TBR -DHAVE_INOTIFY_INIT -DHAVE_INOTIFY -DHAVE_WRITEV -DHAVE_WRITEV -DHAVE_RB_THREAD_CHECK_INTS -DHAVE_RB_TIME_NEW -DOS_UNIX -DHAVE_EPOLL_CREATE -DHAVE_EPOLL -DHAVE_MAKE_PAIR -Wno-error=format-security
CXXFLAGS = $(CCDLFLAGS) -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security $(ARCH_FLAG)
please refer to the CXXFLAGS
, why the flags which are passed to the comiplation are not being propogated?
Upvotes: 0
Views: 1280
Reputation: 3983
Apparently this is an issue with em-winrm
depending on eventmachine v1.0.0.beta.3
.
A combination of mudasobwa's comment and workaround suggested here worked for me:
gem install eventmachine -v '1.0.0.beta.3' -- --with-cflags=\"-O2 -pipe -march=native -w\"
Alternatively, if you wish to use bundler
export CONFIGURE_ARGS="--with-cflags='-O2 -pipe -march=native -w'"
bundle install --path vendor
Upvotes: 2