os97673 / debase-ruby_core_source

Gem to provide Ruby (~> 2.0) core source files for C extensions that need them.
MIT License
11 stars 17 forks source link

Won't install with ruby 2.6.6 on macOS Big Sur #22

Open getaaron opened 4 years ago

getaaron commented 4 years ago

Installing via RubyMine

When I try to use RubyMine to install debug tools:

Failed to Install Gems. Following gems were not installed: 
/Applications/RubyMine.app/Contents/plugins/ruby/rb/gems/debase-0.3.0.beta34.gem: Error installing debase-0.3.0.beta34.gem: ERROR: Failed to build gem native extension. current directory: /Users/aaron/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/debase-0.3.0.beta34/ext /Users/aaron/.rbenv/versions/2.6.6/bin/ruby -I /Users/aaron/.rbenv/versions/2.6.6/lib/ruby/2.6.0 -r ./siteconf20200811-40197-1sbw0j5.rb extconf.rb /Users/aaron/.rbenv/sources/2.6.6/ruby-2.6.6 checking for vm_core.h... no checking for vm_core.h... no ************************************************************************** No source for ruby-2.6.6-p146 (revision 67876) provided with debase-ruby_core_source gem. Falling back to ruby-2.6.5-p114. ************************************************************************** checking for vm_core.h... yes checking for iseq.h... yes checking for method.h... yes checking for version.h... yes creating Makefile current directory: /Users/aaron/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/debase-0.3.0.beta34/ext make "DESTDIR=" clean current directory: /Users/aaron/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/debase-0.3.0.beta34/ext make "DESTDIR=" compiling breakpoint.c breakpoint.c:34:26: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] z5b0d67e460->z1bdac88cc2=strlen(z5e1fde07c3);z5b0d67e460->z0b7a8f8ed2= ~^~~~~~~~~~~~~~~~~~~ breakpoint.c:42:31: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation] z3d2bd811aa==Qnil)return Qnil;zc4b0a3b11f=FIX2INT(z619c7a8bf2);for(z69ad33d2f6= ^ breakpoint.c:41:71: note: previous statement is here z69ad33d2f6;int zc4b0a3b11f;VALUE zf7a8bf7010;z29dc5df85a*z5b0d67e460;if( ^ breakpoint.c:61:13: warning: implicit conversion loses integer precision: 'VALUE' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] z1c3440c3bb=zf35dc14a7b;return z5b0d67e460->z1c3440c3bb;}static VALUE ~^~~~~~~~~~~ breakpoint.c:79:58: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation] Qtrue!=z5b0d67e460->z1c3440c3bb)return(0x15+9064-0x237d);if(NIL_P(z5b0d67e460-> ^ breakpoint.c:78:75: note: previous statement is here (0x1c01+1329-0x2132);Data_Get_Struct(zf7a8bf7010,z29dc5df85a,z5b0d67e460);if( ^ breakpoint.c:80:39: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation] zf52c4d52d1))return(0x23ba+83-0x240c);if(NIL_P(zd0330fb57d)){z0a4e4f059c= ^ breakpoint.c:79:58: note: previous statement is here Qtrue!=z5b0d67e460->z1c3440c3bb)return(0x15+9064-0x237d);if(NIL_P(z5b0d67e460-> ^ 5 warnings generated. compiling context.c context.c:91:75: warning: use of unary operator that may be intended as compound assignment (-=) (0xb4f+4363-0x1c5a);z23c1122dc9->z2c5eef0cd1=NULL;z23c1122dc9->z6b895785aa=- ^~ context.c:136:48: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation] "\x70\x6f\x73\x74\x2d\x6d\x6f\x72\x74\x65\x6d";return ID2SYM(rb_intern(symbol)); ^ context.c:135:21: note: previous statement is here "\x6e\x6f\x6e\x65";}if(zb213dfaaab(z23c1122dc9,za5d2480b23))symbol= ^ context.c:139:32: warning: incompatible pointer types passing 'rb_control_frame_t *' (aka 'struct rb_control_frame_struct *') to parameter of type 'const rb_execution_context_t *' (aka 'const struct rb_execution_context_struct *') [-Wincompatible-pointer-types] rb_control_frame_t*z3d80811b15=z14e7cad448(z43ea6b63f3);rb_control_frame_t*cfp; ^~~~~~~~~~~~~~~~~~~~~~~~ context.c:15:56: note: expanded from macro 'z14e7cad448' #define z14e7cad448(thread) (RUBY_VM_END_CONTROL_FRAME((rb_control_frame_t *)(\ ^~~~~~~~~~~~~~~~~~~~~~~~ /Users/aaron/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_core.h:1347:57: note: passing argument to parameter 'ec' here RUBY_VM_END_CONTROL_FRAME(const rb_execution_context_t *ec) ^ context.c:139:20: warning: initializing 'rb_control_frame_t *' (aka 'struct rb_control_frame_struct *') with an expression of type 'const rb_control_frame_t *' (aka 'const struct rb_control_frame_struct *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] rb_control_frame_t*z3d80811b15=z14e7cad448(z43ea6b63f3);rb_control_frame_t*cfp; ^ ~~~~~~~~~~~~~~~~~~~~~~~~ context.c:147:56: warning: incompatible pointer types passing 'rb_control_frame_t *' (aka 'struct rb_control_frame_struct *') to parameter of type 'const rb_execution_context_t *' (aka 'const struct rb_execution_context_struct *') [-Wincompatible-pointer-types] rb_control_frame_t*cfp){rb_control_frame_t*z3d80811b15=z14e7cad448(z43ea6b63f3); ^~~~~~~~~~~~~~~~~~~~~~~~ context.c:15:56: note: expanded from macro 'z14e7cad448' #define z14e7cad448(thread) (RUBY_VM_END_CONTROL_FRAME((rb_control_frame_t *)(\ ^~~~~~~~~~~~~~~~~~~~~~~~ /Users/aaron/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_core.h:1347:57: note: passing argument to parameter 'ec' here RUBY_VM_END_CONTROL_FRAME(const rb_execution_context_t *ec) ^ context.c:147:44: warning: initializing 'rb_control_frame_t *' (aka 'struct rb_control_frame_struct *') with an expression of type 'const rb_control_frame_t *' (aka 'const struct rb_control_frame_struct *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] rb_control_frame_t*cfp){rb_control_frame_t*z3d80811b15=z14e7cad448(z43ea6b63f3); ^ ~~~~~~~~~~~~~~~~~~~~~~~~ context.c:167:42: warning: unused variable 'size' [-Wunused-variable] static VALUE z6af2b11a8e(VALUE self){int size,pc;z251a839b07*z23c1122dc9; ^ context.c:171:36: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] (cfp==NULL){return Qnil;}pc=cfp->pc-cfp->iseq->body->iseq_encoded;z1f5025e187( ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ context.c:180:59: warning: assigning to 'rb_iseq_t *' (aka 'struct rb_iseq_struct *') from 'const rb_iseq_t *' (aka 'const struct rb_iseq_struct *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] cfp=za8739056e8(z43ea6b63f3,z23c1122dc9->z440b3c1264);iseq=cfp->iseq;z04f4e87de0 ^~~~~~~~~~ context.c:187:65: error: implicit declaration of function 'z6c1b13c43d' is invalid in C99 [-Werror,-Wimplicit-function-declaration] z23c1122dc9->pc==pc){int line=z81f3c486e3(iseq,z23c1122dc9->pc);z6c1b13c43d( ^ context.c:189:1: error: implicit declaration of function 'zcf306596f3' is invalid in C99 [-Werror,-Wimplicit-function-declaration] zcf306596f3(z9295263560->zf1dbe334ed,z43ea6b63f3,z9b06b9d99e,z23c1122dc9-> ^ context.c:197:18: warning: assigning to 'rb_iseq_t *' (aka 'struct rb_iseq_struct *') from 'const rb_iseq_t *' (aka 'const struct rb_iseq_struct *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] zf4157a8cc0];iseq=cfp->iseq;z9704694096(iseq,z43ea6b63f3,z23c1122dc9->pc, ^~~~~~~~~~ context.c:199:1: error: implicit declaration of function 'zcf306596f3' is invalid in C99 [-Werror,-Wimplicit-function-declaration] zcf306596f3(z9295263560->zf1dbe334ed,z43ea6b63f3,z9b06b9d99e,z23c1122dc9-> ^ context.c:206:35: error: implicit declaration of function 'z6c1b13c43d' is invalid in C99 [-Werror,-Wimplicit-function-declaration] z81f3c486e3(iseq,z23c1122dc9->pc);z6c1b13c43d(zb7973f494e,z23c1122dc9, ^ context.c:209:48: warning: passing 'const rb_iseq_t *' (aka 'const struct rb_iseq_struct *') to parameter of type 'rb_iseq_t *' (aka 'struct rb_iseq_struct *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] rb_iseq_path(iseq)));}return Qnil;}z8915b76faa(cfp->iseq,z43ea6b63f3,z9295263560 ^~~~~~~~~ ./debase_internals.h:60:72: note: passing argument to parameter 'iseq' here z66506c879c,int z61151e0a12,int z440b3c1264);int z8915b76faa(rb_iseq_t*iseq, ^ context.c:221:63: error: implicit declaration of function 'zcf306596f3' is invalid in C99 [-Werror,-Wimplicit-function-declaration] ->ze546e5a29e[z69ad33d2f6];if(z9295263560->zf1dbe334ed!=NULL){zcf306596f3( ^ 11 warnings and 5 errors generated. make: *** [context.o] Error 1 make failed, exit code 2 Gem files will remain installed in /Users/aaron/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/debase-0.3.0.beta34 for inspection. Results logged to /Users/aaron/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-20/2.6.0/debase-0.3.0.beta34/gem_make.out

I don't know much about debase but it looks like first it doesn't find anything for 2.6.6 so falls back to 2.6.5 (maybe this is fine?):

No source for ruby-2.6.6-p146 (revision 67876) provided with debase-ruby_core_source gem. Falling back to ruby-2.6.5-p114

Then it runs into a few similar compiler errors:

$ cat /Users/aaron/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-20/2.6.0/debase-0.3.0.beta34/gem_make.out | grep error

context.c:187:65: error: implicit declaration of function 'z6c1b13c43d' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
context.c:189:1: error: implicit declaration of function 'zcf306596f3' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
context.c:199:1: error: implicit declaration of function 'zcf306596f3' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
context.c:206:35: error: implicit declaration of function 'z6c1b13c43d' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
context.c:221:63: error: implicit declaration of function 'zcf306596f3' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
11 warnings and 5 errors generated.

for example

implicit declaration of function 'zcf306596f3' is invalid in C99

I couldn't find zcf306596f3 when searching all of GitHub so not sure what that is.

Wonder if this is related to https://github.com/ruby-debug/debase/pull/85 though, which I think resolved a similar implicit declaration error?

Installing via Command Line

Similar results:

➜  ~ sudo gem install debase
Building native extensions. This could take a while...
ERROR:  Error installing debase:
    ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/debase-0.2.4.1/ext
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20200811-45265-namt5y.rb extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
**************************************************************************
No source for ruby-2.6.3-p62 (revision 67580) provided with
debase-ruby_core_source gem. Falling back to ruby-2.6.0-p0.
**************************************************************************
checking for vm_core.h... yes
checking for iseq.h... no
Makefile creation failed
*************************************************************

  NOTE: If your headers were not found, try passing
        --with-ruby-include=PATH_TO_HEADERS

*************************************************************

*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
    --with-ruby-dir
    --without-ruby-dir
    --with-ruby-include
    --without-ruby-include=${ruby-dir}/include
    --with-ruby-lib
    --without-ruby-lib=${ruby-dir}/lib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/debase-0.2.4.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/debase-0.2.4.1 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/debase-0.2.4.1/gem_make.out

Notice iseq.h failed:

checking for iseq.h... no

mkmf.log

cat /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/debase-0.2.4.1/mkmf.log | grep error
conftest.c:3:10: fatal error: 'vm_core.h' file not found
1 error generated.
conftest.c:3:10: fatal error: 'vm_core.h' file not found
1 error generated.
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:27:12: error: invalid application of 'sizeof' to an incomplete type 'struct rb_call_info_kw_arg'
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:40:15: error: unknown type name 'rb_snum_t'
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:43:5: error: use of undeclared identifier 'rb_snum_t'
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:44:9: error: incomplete definition of type 'struct rb_iseq_struct'
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:45:12: error: use of undeclared identifier 'cnt'
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:51:16: error: incomplete definition of type 'struct rb_iseq_struct'
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:57:21: error: incomplete definition of type 'struct rb_iseq_struct'
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:58:9: error: incomplete definition of type 'struct rb_iseq_struct'
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:67:16: error: incomplete definition of type 'struct rb_iseq_struct'
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:110:11: error: unknown type name 'rb_compile_option_t'
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:120:13: error: incomplete definition of type 'struct rb_iseq_struct'
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:120:23: error: use of undeclared identifier 'IMEMO_FL_USER2'; did you mean 'RUBY_FL_USER2'?
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:121:13: error: incomplete definition of type 'struct rb_iseq_struct'
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:131:9: error: incomplete definition of type 'struct rb_iseq_struct'
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:132:9: error: incomplete definition of type 'struct rb_iseq_struct'
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:132:20: error: use of undeclared identifier 'IMEMO_FL_USER2'; did you mean 'RUBY_FL_USER2'?
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:138:9: error: incomplete definition of type 'struct rb_iseq_struct'
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:138:21: error: use of undeclared identifier 'IMEMO_FL_USER2'; did you mean 'RUBY_FL_USER2'?
/Library/Ruby/Gems/2.6.0/gems/debase-ruby_core_source-0.10.9/lib/debase/ruby_core_source/ruby-2.6.0-p0/iseq.h:139:9: error: incomplete definition of type 'struct rb_iseq_struct'
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

Related to Xcode 12?

Also possibly related, I'm running macOS Big Sur 11.0 Beta (20A5343i). I thought it might be related to this Xcode 12 release note:

Clang now reports an error when you use a function without an explicit declaration when building C or Objective-C code for macOS (-Werror=implicit-function-declaration flag is on). This additional error detection unifies Clang’s behavior for iOS/tvOS and macOS 64-bit targets for this diagnostic. (49917738)

I tried to work around this with sudo gem install debase -- --with-cflags="-Wno-error=implicit-function-declaration" but got the same result.

alcamla commented 3 years ago

hey @getaaron, you gave me a clue to solve the issue. I switch to the Xcode command line tools of Xcode 11 run gem install debase again and it succeeded. Hope this helps as a temporal workaround