ruby-debug / debase

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

0.2.4.1 and 0.2.5.beta Fail to build on macOS Catalina 10.15.7

eirvandelden opened this issue ยท comments

What I did:

  • gem install debase
    (also tried)
  • gem install debase --version 0.2.5.beta1

What I expected:

  • succesful installation

What I got:

0.2.4.1

๐Ÿš€ gem install debase
Building native extensions. This could take a while...
ERROR:  Error installing debase:
	ERROR: Failed to build gem native extension.

    current directory: /Users/eirvandelden/.gem/ruby/2.5.0/gems/debase-0.2.4.1/ext
/Users/eirvandelden/.rubies/ruby-2.5.0/bin/ruby -r ./siteconf20201106-6227-83wsl5.rb extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
checking for vm_core.h... yes
checking for iseq.h... yes
checking for version.h... yes
checking for vm_core.h... yes
checking for vm_insnhelper.h... yes
checking for vm_core.h... yes
checking for method.h... yes
creating Makefile

current directory: /Users/eirvandelden/.gem/ruby/2.5.0/gems/debase-0.2.4.1/ext
make "DESTDIR=" clean

current directory: /Users/eirvandelden/.gem/ruby/2.5.0/gems/debase-0.2.4.1/ext
make "DESTDIR="
compiling breakpoint.c
compiling context.c
compiling debase_internals.c
debase_internals.c:319:25: 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 *start_cfp = RUBY_VM_END_CONTROL_FRAME(TH_INFO(thread));
                        ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
debase_internals.c:697:24: warning: initializing 'rb_iseq_t *' (aka 'struct rb_iseq_struct *') with an expression of type 'const rb_iseq_t *' (aka 'const struct rb_iseq_struct *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
            rb_iseq_t *iseq = my_iseqw_check(rb_iseq);
                       ^      ~~~~~~~~~~~~~~~~~~~~~~~
debase_internals.c:700:17: error: implicit declaration of function 'rb_iseq_trace_set' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                rb_iseq_trace_set(iseq, RUBY_EVENT_TRACEPOINT_ALL);
                ^
debase_internals.c:708:24: warning: initializing 'rb_iseq_t *' (aka 'struct rb_iseq_struct *') with an expression of type 'const rb_iseq_t *' (aka 'const struct rb_iseq_struct *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
            rb_iseq_t *iseq = my_iseqw_check(rb_iseq);
                       ^      ~~~~~~~~~~~~~~~~~~~~~~~
debase_internals.c:711:17: error: implicit declaration of function 'rb_iseq_trace_set' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                rb_iseq_trace_set(iseq, RUBY_EVENT_NONE);
                ^
debase_internals.c:768:64: warning: incompatible pointer types passing 'void (VALUE, VALUE)' (aka 'void (unsigned long, unsigned long)') to parameter of type 'VALUE (*)()' (aka 'unsigned long (*)()') [-Wincompatible-pointer-types]
  rb_define_module_function(mDebase, "set_trace_flag_to_iseq", Debase_set_trace_flag_to_iseq, 1);
                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/eirvandelden/.rubies/ruby-2.5.0/include/ruby-2.5.0/ruby/ruby.h:1716:57: note: passing argument to parameter here
void rb_define_module_function(VALUE,const char*,VALUE(*)(ANYARGS),int);
                                                        ^
debase_internals.c:771:58: warning: incompatible pointer types passing 'void (VALUE, VALUE)' (aka 'void (unsigned long, unsigned long)') to parameter of type 'VALUE (*)()' (aka 'unsigned long (*)()') [-Wincompatible-pointer-types]
  rb_define_module_function(mDebase, "unset_iseq_flags", Debase_unset_trace_flags, 1);
                                                         ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/eirvandelden/.rubies/ruby-2.5.0/include/ruby-2.5.0/ruby/ruby.h:1716:57: note: passing argument to parameter here
void rb_define_module_function(VALUE,const char*,VALUE(*)(ANYARGS),int);
                                                        ^
5 warnings and 2 errors generated.
make: *** [debase_internals.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/eirvandelden/.gem/ruby/2.5.0/gems/debase-0.2.4.1 for inspection.
Results logged to /Users/eirvandelden/.gem/ruby/2.5.0/extensions/x86_64-darwin-19/2.5.0-static/debase-0.2.4.1/gem_make.out

0.2.5.beta1

๐Ÿš€ gem install debase --version 0.2.5.beta1
Building native extensions. This could take a while...
ERROR:  Error installing debase:
	ERROR: Failed to build gem native extension.

    current directory: /Users/eirvandelden/.gem/ruby/2.5.0/gems/debase-0.2.5.beta1/ext
/Users/eirvandelden/.rubies/ruby-2.5.0/bin/ruby -r ./siteconf20201106-6571-1f8kynu.rb extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
checking for vm_core.h... yes
checking for iseq.h... yes
checking for version.h... yes
creating Makefile

current directory: /Users/eirvandelden/.gem/ruby/2.5.0/gems/debase-0.2.5.beta1/ext
make "DESTDIR=" clean

current directory: /Users/eirvandelden/.gem/ruby/2.5.0/gems/debase-0.2.5.beta1/ext
make "DESTDIR="
compiling breakpoint.c
compiling context.c
compiling debase_internals.c
debase_internals.c:319:25: 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 *start_cfp = RUBY_VM_END_CONTROL_FRAME(TH_INFO(thread));
                        ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
debase_internals.c:697:24: warning: initializing 'rb_iseq_t *' (aka 'struct rb_iseq_struct *') with an expression of type 'const rb_iseq_t *' (aka 'const struct rb_iseq_struct *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
            rb_iseq_t *iseq = my_iseqw_check(rb_iseq);
                       ^      ~~~~~~~~~~~~~~~~~~~~~~~
debase_internals.c:700:17: error: implicit declaration of function 'rb_iseq_trace_set' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                rb_iseq_trace_set(iseq, RUBY_EVENT_TRACEPOINT_ALL);
                ^
debase_internals.c:708:24: warning: initializing 'rb_iseq_t *' (aka 'struct rb_iseq_struct *') with an expression of type 'const rb_iseq_t *' (aka 'const struct rb_iseq_struct *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
            rb_iseq_t *iseq = my_iseqw_check(rb_iseq);
                       ^      ~~~~~~~~~~~~~~~~~~~~~~~
debase_internals.c:711:17: error: implicit declaration of function 'rb_iseq_trace_set' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                rb_iseq_trace_set(iseq, RUBY_EVENT_NONE);
                ^
debase_internals.c:768:64: warning: incompatible pointer types passing 'void (VALUE, VALUE)' (aka 'void (unsigned long, unsigned long)') to parameter of type 'VALUE (*)()' (aka 'unsigned long (*)()') [-Wincompatible-pointer-types]
  rb_define_module_function(mDebase, "set_trace_flag_to_iseq", Debase_set_trace_flag_to_iseq, 1);
                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/eirvandelden/.rubies/ruby-2.5.0/include/ruby-2.5.0/ruby/ruby.h:1716:57: note: passing argument to parameter here
void rb_define_module_function(VALUE,const char*,VALUE(*)(ANYARGS),int);
                                                        ^
debase_internals.c:771:58: warning: incompatible pointer types passing 'void (VALUE, VALUE)' (aka 'void (unsigned long, unsigned long)') to parameter of type 'VALUE (*)()' (aka 'unsigned long (*)()') [-Wincompatible-pointer-types]
  rb_define_module_function(mDebase, "unset_iseq_flags", Debase_unset_trace_flags, 1);
                                                         ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/eirvandelden/.rubies/ruby-2.5.0/include/ruby-2.5.0/ruby/ruby.h:1716:57: note: passing argument to parameter here
void rb_define_module_function(VALUE,const char*,VALUE(*)(ANYARGS),int);
                                                        ^
5 warnings and 2 errors generated.
make: *** [debase_internals.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/eirvandelden/.gem/ruby/2.5.0/gems/debase-0.2.5.beta1 for inspection.
Results logged to /Users/eirvandelden/.gem/ruby/2.5.0/extensions/x86_64-darwin-19/2.5.0-static/debase-0.2.5.beta1/gem_make.out

Note: I saw mention of a workaround here but its not applicable for me as I'm using debase & ruby-debug-ide with VSCode

You may install any ruby-debug-ide with the same options. Doesn't matter if you are using RubyMine or VSCode

I look the same compile error when I upgrade to Xcode 12.
In my environment, back to Xcode 11.7 by xcode-select is workaround for me.

This is about Catalina. Is it true for Big Sur as well?

the downgrading of Xcode to 11.7 works on Big Sur too.
Thank you @r-plus

This also is happening on Big Sur (macOS 11.2.3) and gem install debase -v '0.2.4.1' -- --with-cflags="-Wno-error=implicit-function-declaration" got around the problem for me.

Xcode to 11.7 work for me on big sur

commented

If you are using multiple ruby versions and bundler to install the dependencies. Add this to the bundler config.

bundle config build.debase --with-cflags="-Wno-error=implicit-function-declaration"

Getting the same issue on macOS Sonoma Version 14.4. I tried the above mentioned solutions but no luck.
Ruby version: 2.7.6

Getting the same issue on macOS Sonoma Version 14.4. I tried the above mentioned solutions but no luck.
Ruby version: 2.7.5

Getting the same issue on macOS Sonoma Version 14.4.1 I tried the above mentioned solutions but no luck.
Ruby version: 2.7.8

Getting the same issue on macOS Sonoma Version 14.4.1 I tried the above mentioned solutions but no luck.
Ruby version: 2.6.3

I found a workaround for my case:

  • Macos version: Sonoma 14.5
  • xcode-version: 2408
  • ruby version: 2.4.1 (using rvm 1.29.12)
gem install debase -- --with-cflags="-Wno-compound-token-split-by-macro -Wno-error=incompatible-function-pointer-types"

Hope this helps

For me the --with-cflags approach worked, although I had to add -Wno-int-conversion.

  • Macos version: Sonoma 14.4.1
  • ruby version: 2.4.10 & 2.7.6 (using mise 2024.4.8)

As I'm using different ruby versions, I followed @awadhwana and added to my user bundler config.

bundle config set --global build.debase --with-cflags='-Wno-compound-token-split-by-macro -Wno-error=incompatible-function-pointer-types -Wno-int-conversion'

The nokogiri gem ended up with a special config, too before installation would finish successful.

bundle config set --global build.nokogiri --use-system-libraries