lsegal/ripper18

can't install on mac 10.5.8

cldwalker opened this issue · 5 comments

When trying to install for ruby 1.8.7 on mac 10.5.8 I get:

$ gem install ripper                                                                                                                                                                                           
Building native extensions.  This could take a while...                                                                                                                                                      
ERROR:  Error installing ripper:                                                                                                                                                                             
        ERROR: Failed to build gem native extension.                                                                                                                                                         

/Users/bozo/.rvm/rubies/ruby-1.8.7-p299/bin/ruby extconf.rb                                                                                                                                                  
checking for bison... yes                                                                                                                                                                                        creating Makefile                                                                                                                                                                                            

make/Users/bozo/.rvm/rubies/ruby-1.8.7-p299/bin/ruby ./tools/preproc.rb parse.y --output=ripper.y                                                                                                            
bison -t -v -oy.tab.c ripper.y                                                                                                                                                                               
sed -f tools/ytab.sed -e "/^#/s!y\.tab\.c!ripper.c!" y.tab.c > ripper.c                                                                                                                                      
/Users/bozo/.rvm/rubies/ruby-1.8.7-p299/bin/ruby ./tools/generate.rb --mode=eventids1 --ids1src=parse.y --output=eventids1.c                                                                                 
/Users/bozo/.rvm/rubies/ruby-1.8.7-p299/bin/ruby ./tools/generate.rb --mode=eventids2table --ids2src=./eventids2.c --output=eventids2table.c                                                                 
gcc -I. -I/Users/bozo/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/i686-darwin9.4.0 -I/Users/bozo/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/i686-darwin9.4.0 -I. -I./backports -DRIPPER  -D_XOPEN_SOURCE -D_DARWIN_C_S                                                                                                                                                                                                             
OURCE   -fno-common -g -O2  -fno-common -pipe -fno-common   -c ripper.c                                                                                                                                      
In file included from ripper.y:21:                                                                                                                                                                           
/Users/bozo/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/i686-darwin9.4.0/node.h:391: error: syntax error before ‘rb_jmpbuf_t’                                                                                   
/Users/bozo/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/i686-darwin9.4.0/node.h:391: warning: data definition has no type or storage class                                                                      
/Users/bozo/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/i686-darwin9.4.0/node.h:405: error: syntax error before ‘rb_jmpbuf_t’                                                                                   
/Users/bozo/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/i686-darwin9.4.0/node.h:405: warning: no semicolon at end of struct or union                                                                            
/Users/bozo/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/i686-darwin9.4.0/node.h:455: error: ‘abort’ redeclared as different kind of symbol                                                                      
/Users/bozo/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/i686-darwin9.4.0/node.h:464: error: syntax error before ‘}’ token                                                                                       
make: *** [ripper.o] Error 1  

Any suggestions on what to do?

Does this still happen on the latest 1.8.7, p330? I'm not quite sure what the issue can be there.

Yep:

$ gem install ripper                                                                                                                                                                                         
Building native extensions.  This could take a while...                                                                                                                                                      
ERROR:  Error installing ripper:                                                                                                                                                                             
  ERROR: Failed to build gem native extension.                                                                                                                                                               

/Users/bozo/.rvm/rubies/ruby-1.8.7-p330/bin/ruby extconf.rb                                                                                                                                                  
checking for bison... yes                                                                                                                                                                                    
creating Makefile                                                                                                                                                                                                                                                                                                                                                                                                             
make                                                                                                                                                                                                         
/Users/bozo/.rvm/rubies/ruby-1.8.7-p330/bin/ruby ./tools/preproc.rb parse.y --output=ripper.y                                                                                                                
bison -t -v -oy.tab.c ripper.y                                                                                                                                                                               
sed -f tools/ytab.sed -e "/^#/s!y\.tab\.c!ripper.c!" y.tab.c > ripper.c                                                                                                                                      
/Users/bozo/.rvm/rubies/ruby-1.8.7-p330/bin/ruby ./tools/generate.rb --mode=eventids1 --ids1src=parse.y --output=eventids1.c                                                                                     /Users/bozo/.rvm/rubies/ruby-1.8.7-p330/bin/ruby ./tools/generate.rb --mode=eventids2table --ids2src=./eventids2.c --output=eventids2table.c                                                                 
gcc -I. -I/Users/bozo/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/i686-darwin9.8.0 -I/Users/bozo/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/i686-darwin9.8.0 -I. -I./backports -DRIPPER -DHAVE_RL_FILENAME_COMPLETION_FUNCTION -DHAVE_RL_USERNAME_COMPLETION_FUNCTION -DHAVE_RL_COMPLETION_MATCHES -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -g -O2  -fno-common -pipe -fno-common   -c ripper.c                            
In file included from ripper.y:21:                                                                                                                                                                           
/Users/bozo/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/i686-darwin9.8.0/node.h:391: error: syntax error before ‘rb_jmpbuf_t’                                                                                   
/Users/bozo/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/i686-darwin9.8.0/node.h:391: warning: data definition has no type or storage class                                                                      
/Users/bozo/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/i686-darwin9.8.0/node.h:405: error: syntax error before ‘rb_jmpbuf_t’                                                                                   
/Users/bozo/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/i686-darwin9.8.0/node.h:405: warning: no semicolon at end of struct or union                                                                            
/Users/bozo/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/i686-darwin9.8.0/node.h:455: error: ‘abort’ redeclared as different kind of symbol                                                                      
/Users/bozo/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/i686-darwin9.8.0/node.h:464: error: syntax error before ‘}’ token                                                                                       
make: *** [ripper.o] Error 1

Looking at node.h, it seems that your RUBY_JMP_BUF is undefined. This should be set in ./configure:

ruby-1.8.7-p330$ grep RUBY_JMP_BUF *
*snip*
config.h:#define RUBY_JMP_BUF jmp_buf
configure:#define RUBY_JMP_BUF ${setjmp_sigmask+${setjmp_prefix}}jmp_buf
*snip*
node.h:typedef RUBY_JMP_BUF rb_jmpbuf_t;

Can you check:

cat /Users/bozo/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/i686-darwin9.8.0/config.h | grep RUBY_JMP_BUF

If not, this might be a gcc issue. What is your gcc version (gcc -v)? You could manually add the define, but I'm not sure if that will compile.

I'm on gcc 4.2.1, and AFAIK that's not tied to 10.5.8, but rather your XCode version. Perhaps updating XCode would help-- if you can.

I have the same config.h and node.h that you do for RUBY_JMP_BUF. I have gcc 4.0.1. I could update xcode but I'll be reinstalling with 10.6 soon. I'll let you know what happens on 10.6.

Upgrading to 10.6 and gcc 4.2 fixed it as promised