[ https://issues.apache.org/jira/browse/THRIFT-664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13122258#comment-13122258 ]
Luis Eduardo Villares Matta commented on THRIFT-664: ---------------------------------------------------- I am having the following problem on Ubuntu 11.10, with ruby 1.9.2-p290 (using RVM): {quote} Installing thrift (0.7.0) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /usr/share/ruby-rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb checking for strlcpy() in string.h... no creating Makefile make gcc -I. -I/usr/share/ruby-rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-linux -I/usr/share/ruby-rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/usr/share/ruby-rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I. -fPIC -g -O2 -Wall -Werror -o protocol.o -c protocol.c gcc -I. -I/usr/share/ruby-rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-linux -I/usr/share/ruby-rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/usr/share/ruby-rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I. -fPIC -g -O2 -Wall -Werror -o struct.o -c struct.c struct.c:28:1: error: static declaration of ‘strlcpy’ follows non-static declaration /usr/share/ruby-rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/missing.h:157:20: note: previous declaration of ‘strlcpy’ was here make: *** [struct.o] Error 1 Gem files will remain installed in /usr/share/ruby-rvm/gems/ruby-1.9.2-p290@agg/gems/thrift-0.7.0 for inspection. Results logged to /usr/share/ruby-rvm/gems/ruby-1.9.2-p290@agg/gems/thrift-0.7.0/ext/gem_make.out An error occured while installing thrift (0.7.0), and Bundler cannot continue. Make sure that `gem install thrift -v '0.7.0'` succeeds before bundling. developer2@developer2-umanni:~/Projects/Agg$ gem install thrift -v '0.7.0 > ^C developer2@developer2-umanni:~/Projects/Agg$ gem install thrift -v=0.7.0 /usr/share/ruby-rvm/rubies/ruby-1.9.2-p290/bin/gem:4: warning: Insecure world writable dir /usr/share/ruby-rvm in PATH, mode 040777 Building native extensions. This could take a while... ERROR: Error installing thrift: ERROR: Failed to build gem native extension. /usr/share/ruby-rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb checking for strlcpy() in string.h... no creating Makefile make gcc -I. -I/usr/share/ruby-rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-linux -I/usr/share/ruby-rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/usr/share/ruby-rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I. -fPIC -g -O2 -Wall -Werror -o protocol.o -c protocol.c gcc -I. -I/usr/share/ruby-rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/x86_64-linux -I/usr/share/ruby-rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/usr/share/ruby-rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I. -fPIC -g -O2 -Wall -Werror -o struct.o -c struct.c struct.c:28:1: error: static declaration of ‘strlcpy’ follows non-static declaration /usr/share/ruby-rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/missing.h:157:20: note: previous declaration of ‘strlcpy’ was here make: *** [struct.o] Error 1 Gem files will remain installed in /usr/share/ruby-rvm/gems/ruby-1.9.2-p290@agg/gems/thrift-0.7.0 for inspection. Results logged to /usr/share/ruby-rvm/gems/ruby-1.9.2-p290@agg/gems/thrift-0.7.0/ext/gem_make.out {quote} > Ruby extension fails to build with Ruby 1.9.1 > --------------------------------------------- > > Key: THRIFT-664 > URL: https://issues.apache.org/jira/browse/THRIFT-664 > Project: Thrift > Issue Type: Bug > Components: Ruby - Library > Affects Versions: 0.2 > Environment: OS: archlinux > Ruby: ruby 1.9.1p376 (2009-12-07 revision 26041) [x86_64-linux] > Reporter: Byron Clark > Assignee: Rajesh Malepati > Fix For: 0.4 > > Attachments: ruby19-build-fix.patch > > > The have_func('strlcpy', 'string.h') call in lib/rb/ext/extconf.rb is broken > in Ruby 1.9.1. The check always succeeds because Ruby now includes strlcpy > in /usr/include/ruby-1.9.1/ruby/missing.h as long as HAVE_STRLCPY is > undefined and the Ruby headers are always included by have_func. The call in > extconf.rb finds the function and sets the HAVE_STRLCPY macro for the > Makefile. /lib/rb/ext/struct.c then fails to build because neither the > included strlcpy or the strlcpy provided by Ruby are used when HAVE_STRLCPY > is set. > Removing the have_func line from lib/rb/ext/extconf.rb and the definition of > strlcpy in lib/rb/ext/struct.c fixes the build. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira