Thrift
  1. Thrift
  2. THRIFT-1382

Bundle install doesnot work because thrift crashes

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 0.7
    • Fix Version/s: 0.8
    • Component/s: Ruby - Library
    • Labels:
      None
    • Environment:

      I'm using ubuntu 11.10 using RVM.

    • Patch Info:
      Patch Available

      Description

      Error running bundle install:

      Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

      /home/developer3/.rvm/rubies/ruby-1.9.2-head/bin/ruby extconf.rb
      checking for strlcpy() in string.h... no
      creating Makefile

      make
      gcc -I. -I/home/developer3/.rvm/rubies/ruby-1.9.2-head/include/ruby-1.9.1/x86_64-linux -I/home/developer3/.rvm/rubies/ruby-1.9.2-head/include/ruby-1.9.1/ruby/backward -I/home/developer3/.rvm/rubies/ruby-1.9.2-head/include/ruby-1.9.1 -I. -fPIC -g -O2 -Wall -Werror -o thrift_native.o -c thrift_native.c
      gcc -I. -I/home/developer3/.rvm/rubies/ruby-1.9.2-head/include/ruby-1.9.1/x86_64-linux -I/home/developer3/.rvm/rubies/ruby-1.9.2-head/include/ruby-1.9.1/ruby/backward -I/home/developer3/.rvm/rubies/ruby-1.9.2-head/include/ruby-1.9.1 -I. -fPIC -g -O2 -Wall -Werror -o compact_protocol.o -c compact_protocol.c
      gcc -I. -I/home/developer3/.rvm/rubies/ruby-1.9.2-head/include/ruby-1.9.1/x86_64-linux -I/home/developer3/.rvm/rubies/ruby-1.9.2-head/include/ruby-1.9.1/ruby/backward -I/home/developer3/.rvm/rubies/ruby-1.9.2-head/include/ruby-1.9.1 -I. -fPIC -g -O2 -Wall -Werror -o protocol.o -c protocol.c
      gcc -I. -I/home/developer3/.rvm/rubies/ruby-1.9.2-head/include/ruby-1.9.1/x86_64-linux -I/home/developer3/.rvm/rubies/ruby-1.9.2-head/include/ruby-1.9.1/ruby/backward -I/home/developer3/.rvm/rubies/ruby-1.9.2-head/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
      /home/developer3/.rvm/rubies/ruby-1.9.2-head/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 /home/developer3/.rvm/gems/ruby-1.9.2-head@agg/gems/thrift-0.7.0 for inspection.
      Results logged to /home/developer3/.rvm/gems/ruby-1.9.2-head@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.

      1. thrift-1382.patch
        2 kB
        Jake Farrell
      2. thrift-1382.patch
        0.3 kB
        Jake Farrell

        Activity

        Hide
        rodrigo dias added a comment -

        changed the version of ubuntu

        Show
        rodrigo dias added a comment - changed the version of ubuntu
        Hide
        Luis Eduardo Villares Matta added a comment -

        I still have the problem, did you change your Ubuntu ? How is this a fix ?

        Show
        Luis Eduardo Villares Matta added a comment - I still have the problem, did you change your Ubuntu ? How is this a fix ?
        Hide
        Ygor Eduardo Bersani Pereira added a comment -

        I changed the ubuntu version too.

        Show
        Ygor Eduardo Bersani Pereira added a comment - I changed the ubuntu version too.
        Hide
        Jean Reis added a comment -

        Same problem here.

        Show
        Jean Reis added a comment - Same problem here.
        Hide
        Jake Farrell added a comment -

        Do you have the libbsd-dev package installed which contains strlcpy ?

        Show
        Jake Farrell added a comment - Do you have the libbsd-dev package installed which contains strlcpy ?
        Hide
        rodrigo dias added a comment -

        yes I do have this package installed.

        Show
        rodrigo dias added a comment - yes I do have this package installed.
        Hide
        Ygor Eduardo Bersani Pereira added a comment -

        yes I do have this package too.

        Show
        Ygor Eduardo Bersani Pereira added a comment - yes I do have this package too.
        Hide
        Luis Eduardo Villares Matta added a comment -

        I did not have it, I installed it, but no positive effects. Same error here.

        Show
        Luis Eduardo Villares Matta added a comment - I did not have it, I installed it, but no positive effects. Same error here.
        Hide
        Jake Farrell added a comment -

        I was able to successfully build the gem last night on netty, ill setup the latest desktop version and attach the packages list and commands used when i have it working

        Show
        Jake Farrell added a comment - I was able to successfully build the gem last night on netty, ill setup the latest desktop version and attach the packages list and commands used when i have it working
        Hide
        Luis Eduardo Villares Matta added a comment -

        I can confirm that Natty works fine. My problem is just in Oneiric. Tks

        Show
        Luis Eduardo Villares Matta added a comment - I can confirm that Natty works fine. My problem is just in Oneiric. Tks
        Hide
        Jake Farrell added a comment -

        Tracked this down last night. This is a ruby 1.9.x problem, the lib/rb/ext/struct.c has a HAVE_STRLCPY check which configure.ac does not have a AC_CHECK_FUNCS([strlcpy]) for and ruby 1.9.x has the strlcpy in one of its header. Also the recent changed to use bundler to build do not pass this check down to the makefile in the extension. For now if you need to compile the easiest hack is to just remove the strlcpy from struct.c. I will get a patch for this shortly to auto detect ruby version and that compiles from configure, from within the lib folder and using bundler by itself.

        Show
        Jake Farrell added a comment - Tracked this down last night. This is a ruby 1.9.x problem, the lib/rb/ext/struct.c has a HAVE_STRLCPY check which configure.ac does not have a AC_CHECK_FUNCS( [strlcpy] ) for and ruby 1.9.x has the strlcpy in one of its header. Also the recent changed to use bundler to build do not pass this check down to the makefile in the extension. For now if you need to compile the easiest hack is to just remove the strlcpy from struct.c. I will get a patch for this shortly to auto detect ruby version and that compiles from configure, from within the lib folder and using bundler by itself.
        Hide
        Jake Farrell added a comment -

        Patch to fix strlcpy issue in ruby extension on ubuntu 11.10

        Show
        Jake Farrell added a comment - Patch to fix strlcpy issue in ruby extension on ubuntu 11.10
        Hide
        Luis Eduardo Villares Matta added a comment -

        Sorry for the ignorance, but I was not able to test it.
        I tried applying the patch and runing "rake install" but this would ignore my RVM setup.
        (I did google for RVM and Echoe, and even inspected Echoe code but I just did not get why the environment was being lost)

        Also tried to apply it and run bundle or gem, but this always re-downloads the gem.
        (I have also – long before – tried to fork, redirect and point other to rewritten thrift but then bundler is lost)

        Anyway, unfortunately (due to my incompetence) I could not test it. Sorry.

        Show
        Luis Eduardo Villares Matta added a comment - Sorry for the ignorance, but I was not able to test it. I tried applying the patch and runing "rake install" but this would ignore my RVM setup. (I did google for RVM and Echoe, and even inspected Echoe code but I just did not get why the environment was being lost) Also tried to apply it and run bundle or gem, but this always re-downloads the gem. (I have also – long before – tried to fork, redirect and point other to rewritten thrift but then bundler is lost) Anyway, unfortunately (due to my incompetence) I could not test it. Sorry.
        Hide
        Jake Farrell added a comment -

        Echoe is no longer used, we switched over to using bundler. After applying the patch to the 0.8 trunk you can run 'bundle exec rake' in the lib/rb folder and it should create the gem for you

        Show
        Jake Farrell added a comment - Echoe is no longer used, we switched over to using bundler. After applying the patch to the 0.8 trunk you can run 'bundle exec rake' in the lib/rb folder and it should create the gem for you
        Hide
        Jake Farrell added a comment -

        Moves strlcpy from struct.c into its own file and strlcpy.c

        Show
        Jake Farrell added a comment - Moves strlcpy from struct.c into its own file and strlcpy.c
        Hide
        Jake Farrell added a comment -

        Committed patch to place strlcpy in its own file and added define of HAVE_STRLCPY when using from here.

        Show
        Jake Farrell added a comment - Committed patch to place strlcpy in its own file and added define of HAVE_STRLCPY when using from here.
        Hide
        Hudson added a comment -

        Integrated in Thrift #323 (See https://builds.apache.org/job/Thrift/323/)
        Thrift-1382: Bundle install doesnot work because thrift crashes
        Client: ruby
        Patch: Jake Farrell

        Fixes strlcpy header include issue with ruby 1.9.x.

        Show
        Hudson added a comment - Integrated in Thrift #323 (See https://builds.apache.org/job/Thrift/323/ ) Thrift-1382: Bundle install doesnot work because thrift crashes Client: ruby Patch: Jake Farrell Fixes strlcpy header include issue with ruby 1.9.x.
        Hide
        Hudson added a comment -

        Integrated in Thrift #324 (See https://builds.apache.org/job/Thrift/324/)
        Thrift-1382: Bundle install doesnot work because thrift crashes
        Client: ruby

        Adding header for strlcpy.

        Show
        Hudson added a comment - Integrated in Thrift #324 (See https://builds.apache.org/job/Thrift/324/ ) Thrift-1382: Bundle install doesnot work because thrift crashes Client: ruby Adding header for strlcpy.
        Hide
        Hudson added a comment -

        Integrated in Thrift #325 (See https://builds.apache.org/job/Thrift/325/)
        Thrift-1382: Bundle install doesnot work because thrift crashes
        Client: ruby

        Fixing strlcpy header.

        Show
        Hudson added a comment - Integrated in Thrift #325 (See https://builds.apache.org/job/Thrift/325/ ) Thrift-1382: Bundle install doesnot work because thrift crashes Client: ruby Fixing strlcpy header.
        Hide
        Daniil added a comment -

        How to make changes?

        Show
        Daniil added a comment - How to make changes?
        Hide
        Daniil added a comment -

        Please, write detailed instructions, the patch does not work.

        Show
        Daniil added a comment - Please, write detailed instructions, the patch does not work.
        Hide
        Peter Sanford added a comment -

        The patch has been integrated into the 0.8.0 release. Try installing that gem.

        $ gem install thrift -v 0.8.0
        
        Show
        Peter Sanford added a comment - The patch has been integrated into the 0.8.0 release. Try installing that gem. $ gem install thrift -v 0.8.0
        Hide
        Daniil added a comment -

        I installed gem thrist 0.8.0, but a similar error in thrift_client 0.7.1

        Show
        Daniil added a comment - I installed gem thrist 0.8.0, but a similar error in thrift_client 0.7.1
        Hide
        Daniil added a comment -

        I installed gem thrift 0.8.0, but a similar error in thrift_client 0.7.1

        Show
        Daniil added a comment - I installed gem thrift 0.8.0, but a similar error in thrift_client 0.7.1
        Hide
        Peter Sanford added a comment -

        thrift_client has not updated its dependencies yet. There is already an open issue on the thrift_client project: https://github.com/twitter/thrift_client/pull/36

        Show
        Peter Sanford added a comment - thrift_client has not updated its dependencies yet. There is already an open issue on the thrift_client project: https://github.com/twitter/thrift_client/pull/36
        Hide
        Daniil added a comment -

        I want to install gem Cassandra, but fails because of Thrift (or Thrift_client).

        sudo gem install cassandra

        Building native extensions. This could take a while… ERROR: Error installing cassandra: ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
        checking for strlcpy() in string.h… no creating Makefile

        make gcc -I. -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -Wall -Werror -o struct.o -c struct.c struct.c:28:1: ошибка: static-декларация «strlcpy» после неstatic-декларации /usr/include/ruby-1.9.1/ruby/missing.h:157:20: замечание: здесь была предыдущая декларация «strlcpy» make: * [struct.o] Ошибка 1

        Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/thrift-0.7.0 for inspection. Results logged to /usr/lib/ruby/gems/1.9.1/gems/thrift-0.7.0/ext/gem_make.out

        How to install the gems? Please, help me.

        Thanks.

        Show
        Daniil added a comment - I want to install gem Cassandra, but fails because of Thrift (or Thrift_client). sudo gem install cassandra Building native extensions. This could take a while… ERROR: Error installing cassandra: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb checking for strlcpy() in string.h… no creating Makefile make gcc -I. -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -D_FILE_OFFSET_BITS=64 -fPIC -g -O2 -Wall -Werror -o struct.o -c struct.c struct.c:28:1: ошибка: static-декларация «strlcpy» после неstatic-декларации /usr/include/ruby-1.9.1/ruby/missing.h:157:20: замечание: здесь была предыдущая декларация «strlcpy» make: * [struct.o] Ошибка 1 Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/thrift-0.7.0 for inspection. Results logged to /usr/lib/ruby/gems/1.9.1/gems/thrift-0.7.0/ext/gem_make.out How to install the gems? Please, help me. Thanks.

          People

          • Assignee:
            Jake Farrell
            Reporter:
            rodrigo dias
          • Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development