Thrift Ruby gem

后端 未结 4 814
夕颜
夕颜 2021-01-04 06:25

I cannot, for the life of me, successfully run \"gem install thrift\", the thing fails when building the gem\'s native extensions; this is the output:

(acib7         


        
相关标签:
4条回答
  • 2021-01-04 07:00

    rather than use a workaround with cppflags I committed a fix which checks for __has_builtin(strlcpy) and if builtins are not available on the system but strlcpy is defined then it uses externs as it previously did. works on os x 10.8, 10.9, centos, ubuntu, ...

    0 讨论(0)
  • 2021-01-04 07:17

    the issue for the moment can be found at https://issues.apache.org/jira/browse/THRIFT-2219

    As a temporary fix for folks using gems, you can try setting the #define'ing the _FORTIFY_SOURCE macro to 0 to make strlcpy a function rather than a macro:

    gem install thrift -- --with-cppflags='-D_FORTIFY_SOURCE=0'
    

    or if you're using bundler, you can set the cflags for thrift locally via:

    bundle config build.thrift --with-cppflags='-D_FORTIFY_SOURCE=0'
    
    0 讨论(0)
  • 2021-01-04 07:20

    Please edit the ~/.bundle/config file then it looks like this:

    ---
    BUNDLE_BUILD__THRIFT: "--with-cppflags=\"-D_FORTIFY_SOURCE=0 -Wno-shift-negative-value\""
    

    It works for me, thanks.

    0 讨论(0)
  • 2021-01-04 07:23

    On OS 10.9.4 the command below worked for me

    bundle config build.thrift "--with-cppflags=-D_FORTIFY_SOURCE=0"
    
    0 讨论(0)
提交回复
热议问题