ruby-debug / debase

BSD 2-Clause "Simplified" License
209 stars 32 forks source link

Error while installing debase-0.2.5.beta2 #111

Closed nguyener2024 closed 6 days ago

nguyener2024 commented 3 months ago

I saw the problem was reported on this issue https://github.com/ruby-debug/debase/issues/76. Even though it has been closed, but I saw different issue when installing that package with ruby 3.3.4

this is the error I got

debase_internals.c:770:3: error: incompatible function pointer types passing 'void (VALUE, VALUE)' (aka 'void (unsigned long, unsigned long)') to parameter of type 'VALUE ()(VALUE, VALUE)' (aka 'unsigned long ()(unsigned long, unsigned long)') [-Wincompatible-function-pointer-types]

ZimbiX commented 3 months ago

I'm seeing a similar issue on 0.2.4.1 (and it's still there on 0.2.5.beta2):

➜ gem install debase -v 0.2.5.beta2
Fetching debase-0.2.5.beta2.gem
Fetching debase-ruby_core_source-3.3.1.gem
Successfully installed debase-ruby_core_source-3.3.1
Building native extensions. This could take a while...
ERROR:  Error installing debase:
    ERROR: Failed to build gem native extension.

    current directory: /home/brendan/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/debase-0.2.5.beta2/ext
/home/brendan/.rbenv/versions/3.3.4/bin/ruby extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
**************************************************************************
No source for ruby-3.3.4-p94 (revision be1089c8ec5ba40e09b1553e36b3174bf4014d9d) provided with
debase-ruby_core_source gem. Falling back to ruby-3.3.0-p0.
**************************************************************************
checking for vm_core.h... yes
checking for iseq.h... yes
checking for version.h... yes
creating Makefile

current directory: /home/brendan/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/debase-0.2.5.beta2/ext
make DESTDIR\= sitearchdir\=./.gem.20240821-67628-tpsvjr sitelibdir\=./.gem.20240821-67628-tpsvjr clean

current directory: /home/brendan/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/debase-0.2.5.beta2/ext
make DESTDIR\= sitearchdir\=./.gem.20240821-67628-tpsvjr sitelibdir\=./.gem.20240821-67628-tpsvjr
compiling breakpoint.c
breakpoint.c: In function ‘breakpoint_init_variables’:
breakpoint.c:297:1: warning: old-style function definition [-Wold-style-definition]
  297 | breakpoint_init_variables()
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
At top level:
cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may have been intended to silence earlier diagnostics
compiling context.c
context.c: In function ‘context_init_variables’:
context.c:366:1: warning: old-style function definition [-Wold-style-definition]
  366 | context_init_variables()
      | ^~~~~~~~~~~~~~~~~~~~~~
At top level:
cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may have been intended to silence earlier diagnostics
compiling debase_internals.c
debase_internals.c: In function ‘print_debug’:
debase_internals.c:36:3: warning: function ‘print_debug’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
   36 |   vfprintf(stderr, message, ap);
      |   ^~~~~~~~
debase_internals.c: In function ‘try_disable_trace_points’:
debase_internals.c:105:1: warning: old-style function definition [-Wold-style-definition]
  105 | try_disable_trace_points()
      | ^~~~~~~~~~~~~~~~~~~~~~~~
debase_internals.c: In function ‘enable_trace_points’:
debase_internals.c:128:1: warning: old-style function definition [-Wold-style-definition]
  128 | enable_trace_points()
      | ^~~~~~~~~~~~~~~~~~~
debase_internals.c: In function ‘count_stack_size’:
debase_internals.c:316:5: warning: old-style function definition [-Wold-style-definition]
  316 | int count_stack_size() {
      |     ^~~~~~~~~~~~~~~~
debase_internals.c:319:37: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  319 |     rb_control_frame_t *start_cfp = RUBY_VM_END_CONTROL_FRAME(TH_INFO(thread));
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
debase_internals.c: In function ‘Debase_init_variables’:
debase_internals.c:728:1: warning: old-style function definition [-Wold-style-definition]
  728 | Debase_init_variables()
      | ^~~~~~~~~~~~~~~~~~~~~
debase_internals.c: In function ‘Init_debase_internals’:
debase_internals.c:753:1: warning: old-style function definition [-Wold-style-definition]
  753 | Init_debase_internals()
      | ^~~~~~~~~~~~~~~~~~~~~
In file included from /home/brendan/.rbenv/versions/3.3.4/include/ruby-3.3.0/ruby/ruby.h:27,
                 from /home/brendan/.rbenv/versions/3.3.4/include/ruby-3.3.0/ruby.h:38,
                 from ./debase_internals.h:4,
                 from debase_internals.c:1:
/home/brendan/.rbenv/versions/3.3.4/include/ruby-3.3.0/ruby/internal/anyargs.h:338:142: error: passing argument 3 of ‘rb_define_module_function_01’ from incompatible pointer type [-Wincompatible-pointer-types]
  338 | #define rb_define_module_function(mod, mid, func, arity)    RBIMPL_ANYARGS_DISPATCH_rb_define_module_function((arity), (func))((mod), (mid), (func), (arity))
      |                                                                                                                                              ^~~~~~
      |                                                                                                                                              |
      |                                                                                                                                              void (*)(VALUE,  VALUE) {aka void (*)(long unsigned int,  long unsigned int)}
debase_internals.c:770:3: note: in expansion of macro ‘rb_define_module_function’
  770 |   rb_define_module_function(mDebase, "set_trace_flag_to_iseq", Debase_set_trace_flag_to_iseq, 1);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/brendan/.rbenv/versions/3.3.4/include/ruby-3.3.0/ruby/internal/anyargs.h:274:21: note: expected ‘VALUE (*)(VALUE,  VALUE)’ {aka ‘long unsigned int (*)(long unsigned int,  long unsigned int)’} but argument is of type ‘void (*)(VALUE,  VALUE)’ {aka ‘void (*)(long unsigned int,  long unsigned int)’}
  274 | RBIMPL_ANYARGS_DECL(rb_define_module_function, VALUE, const char *)
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/brendan/.rbenv/versions/3.3.4/include/ruby-3.3.0/ruby/internal/anyargs.h:256:41: note: in definition of macro ‘RBIMPL_ANYARGS_DECL’
  256 | RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _01(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); \
      |                                         ^~~
/home/brendan/.rbenv/versions/3.3.4/include/ruby-3.3.0/ruby/internal/anyargs.h:338:142: error: passing argument 3 of ‘rb_define_module_function_01’ from incompatible pointer type [-Wincompatible-pointer-types]
  338 | #define rb_define_module_function(mod, mid, func, arity)    RBIMPL_ANYARGS_DISPATCH_rb_define_module_function((arity), (func))((mod), (mid), (func), (arity))
      |                                                                                                                                              ^~~~~~
      |                                                                                                                                              |
      |                                                                                                                                              void (*)(VALUE,  VALUE) {aka void (*)(long unsigned int,  long unsigned int)}
debase_internals.c:773:3: note: in expansion of macro ‘rb_define_module_function’
  773 |   rb_define_module_function(mDebase, "unset_iseq_flags", Debase_unset_trace_flags, 1);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/brendan/.rbenv/versions/3.3.4/include/ruby-3.3.0/ruby/internal/anyargs.h:274:21: note: expected ‘VALUE (*)(VALUE,  VALUE)’ {aka ‘long unsigned int (*)(long unsigned int,  long unsigned int)’} but argument is of type ‘void (*)(VALUE,  VALUE)’ {aka ‘void (*)(long unsigned int,  long unsigned int)’}
  274 | RBIMPL_ANYARGS_DECL(rb_define_module_function, VALUE, const char *)
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/brendan/.rbenv/versions/3.3.4/include/ruby-3.3.0/ruby/internal/anyargs.h:256:41: note: in definition of macro ‘RBIMPL_ANYARGS_DECL’
  256 | RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _01(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); \
      |                                         ^~~
At top level:
cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may have been intended to silence earlier diagnostics
make: *** [Makefile:248: debase_internals.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/brendan/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/debase-0.2.5.beta2 for inspection.
Results logged to /home/brendan/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/extensions/x86_64-linux/3.3.0/debase-0.2.5.beta2/gem_make.out

It sounds like the C compiler has changed the default for incompatible-pointer-types from warning to error. It installs successfully if I do:

bundle config --local build.debase --with-cflags=-Wno-error=incompatible-pointer-types
# or:
gem install debase -v 0.2.5.beta2 -- --with-cflags=-Wno-error=incompatible-pointer-types

So in your case, try:

bundle config --local build.debase --with-cflags=-Wno-error=incompatible-function-pointer-types
# or:
gem install debase -v 0.2.5.beta2 -- --with-cflags=-Wno-error=incompatible-function-pointer-types

Related: https://github.com/ruby-debug/debase/issues/108, https://github.com/grpc/grpc/issues/35148, https://github.com/ruby-debug/ruby-debug-ide/issues/242

duncan-bayne commented 1 week ago

I'm seeing this error myself:

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]
  319 |     rb_control_frame_t *start_cfp = RUBY_VM_END_CONTROL_FRAME(TH_INFO(thread));
      |                         ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
debase_internals.c:770:3: error: incompatible function pointer types passing 'void (VALUE, VALUE)' (aka 'void (unsigned long, unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE)' (aka 'unsigned long (*)(unsigned long, unsigned
long)') [-Wincompatible-function-pointer-types]
  770 |   rb_define_module_function(mDebase, "set_trace_flag_to_iseq", Debase_set_trace_flag_to_iseq, 1);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/duncan/.rbenv/versions/3.2.4/include/ruby-3.2.0/ruby/internal/anyargs.h:338:142: note: expanded from macro 'rb_define_module_function'
  338 | #define rb_define_module_function(mod, mid, func, arity)    RBIMPL_ANYARGS_DISPATCH_rb_define_module_function((arity), (func))((mod), (mid), (func), (arity))
      |                                                                                                                                              ^~~~~~
/home/duncan/.rbenv/versions/3.2.4/include/ruby-3.2.0/ruby/internal/anyargs.h:274:1: note: passing argument to parameter here
  274 | RBIMPL_ANYARGS_DECL(rb_define_module_function, VALUE, const char *)
      | ^
/home/duncan/.rbenv/versions/3.2.4/include/ruby-3.2.0/ruby/internal/anyargs.h:256:72: note: expanded from macro 'RBIMPL_ANYARGS_DECL'
  256 | RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _01(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); \
      |                                                                        ^
debase_internals.c:773:3: error: incompatible function pointer types passing 'void (VALUE, VALUE)' (aka 'void (unsigned long, unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE)' (aka 'unsigned long (*)(unsigned long, unsigned
long)') [-Wincompatible-function-pointer-types]
  773 |   rb_define_module_function(mDebase, "unset_iseq_flags", Debase_unset_trace_flags, 1);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/duncan/.rbenv/versions/3.2.4/include/ruby-3.2.0/ruby/internal/anyargs.h:338:142: note: expanded from macro 'rb_define_module_function'
  338 | #define rb_define_module_function(mod, mid, func, arity)    RBIMPL_ANYARGS_DISPATCH_rb_define_module_function((arity), (func))((mod), (mid), (func), (arity))
      |                                                                                                                                              ^~~~~~
/home/duncan/.rbenv/versions/3.2.4/include/ruby-3.2.0/ruby/internal/anyargs.h:274:1: note: passing argument to parameter here
  274 | RBIMPL_ANYARGS_DECL(rb_define_module_function, VALUE, const char *)
      | ^
/home/duncan/.rbenv/versions/3.2.4/include/ruby-3.2.0/ruby/internal/anyargs.h:256:72: note: expanded from macro 'RBIMPL_ANYARGS_DECL'
  256 | RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _01(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); \
      |                                                                        ^
1 warning and 2 errors generated.
*** Error code 1

versions

hurricup commented 1 week ago

try  gem install debase. it should install 0.2.6

nateberkopec commented 1 week ago

No luck for me with 0.2.6 either

hurricup commented 1 week ago

@nateberkopec context, logs please.

diegojromerolopez commented 1 week ago

@hurricup in my case the0.2.6 version fails with

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/diego/vendor/bundle/ruby/3.1.0/gems/ruby-debug-ide-0.7.3/ext
/Users/diego/.asdf/installs/ruby/3.1.2/bin/ruby mkrf_conf.rb
Installing base gem
Building native extensions. This could take a while...
Building native extensions. This could take a while...
ERROR: Failed to build gem native extension.

    current directory: /Users/diego/vendor/bundle/ruby/3.1.0/gems/debase-0.2.6/ext
/Users/diego/.asdf/installs/ruby/3.1.2/bin/ruby -I /Users/diego/.asdf/installs/ruby/3.1.2/lib/ruby/3.1.0 -r ./siteconf20241111-49534-3s6pkc.rb extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
**************************************************************************
No source for ruby-3.1.2-p20 (revision 4491bb740a9506d76391ac44bb2fe6e483fec952) provided with
debase-ruby_core_source gem. Falling back to ruby-3.1.0-p0.
**************************************************************************
checking for vm_core.h... yes
checking for iseq.h... no
checking for iseq.h... yes
checking for version.h... yes
creating Makefile

current directory: /Users/diego/vendor/bundle/ruby/3.1.0/gems/debase-0.2.6/ext
make DESTDIR\= clean

current directory: /Users/diego/vendor/bundle/ruby/3.1.0/gems/debase-0.2.6/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]
  319 |     rb_control_frame_t *start_cfp = RUBY_VM_END_CONTROL_FRAME(TH_INFO(thread));
      |                         ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
debase_internals.c:770:3: error: incompatible function pointer types passing 'void (VALUE, VALUE)' (aka 'void (unsigned long, unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE)' (aka 'unsigned long (*)(unsigned
long, unsigned long)') [-Wincompatible-function-pointer-types]
  770 |   rb_define_module_function(mDebase, "set_trace_flag_to_iseq", Debase_set_trace_flag_to_iseq, 1);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/diego/.asdf/installs/ruby/3.1.2/include/ruby-3.1.0/ruby/internal/anyargs.h:337:142: note: expanded from macro 'rb_define_module_function'
  337 | #define rb_define_module_function(mod, mid, func, arity)    RBIMPL_ANYARGS_DISPATCH_rb_define_module_function((arity), (func))((mod), (mid), (func), (arity))
      |                                                                                                                                              ^~~~~~
/Users/diego/.asdf/installs/ruby/3.1.2/include/ruby-3.1.0/ruby/internal/anyargs.h:273:1: note: passing argument to parameter here
  273 | RBIMPL_ANYARGS_DECL(rb_define_module_function, VALUE, const char *)
      | ^
/Users/diego/.asdf/installs/ruby/3.1.2/include/ruby-3.1.0/ruby/internal/anyargs.h:255:72: note: expanded from macro 'RBIMPL_ANYARGS_DECL'
  255 | RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _01(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); \
      |                                                                        ^
debase_internals.c:773:3: error: incompatible function pointer types passing 'void (VALUE, VALUE)' (aka 'void (unsigned long, unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE)' (aka 'unsigned long (*)(unsigned
long, unsigned long)') [-Wincompatible-function-pointer-types]
  773 |   rb_define_module_function(mDebase, "unset_iseq_flags", Debase_unset_trace_flags, 1);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/diego/.asdf/installs/ruby/3.1.2/include/ruby-3.1.0/ruby/internal/anyargs.h:337:142: note: expanded from macro 'rb_define_module_function'
  337 | #define rb_define_module_function(mod, mid, func, arity)    RBIMPL_ANYARGS_DISPATCH_rb_define_module_function((arity), (func))((mod), (mid), (func), (arity))
      |                                                                                                                                              ^~~~~~
/Users/diego/.asdf/installs/ruby/3.1.2/include/ruby-3.1.0/ruby/internal/anyargs.h:273:1: note: passing argument to parameter here
  273 | RBIMPL_ANYARGS_DECL(rb_define_module_function, VALUE, const char *)
      | ^
/Users/diego.asdf/installs/ruby/3.1.2/include/ruby-3.1.0/ruby/internal/anyargs.h:255:72: note: expanded from macro 'RBIMPL_ANYARGS_DECL'
  255 | RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _01(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); \
      |                                                                        ^
1 warning and 2 errors generated.
make: *** [debase_internals.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/diego/vendor/bundle/ruby/3.1.0/gems/debase-0.2.6 for inspection.
ZimbiX commented 1 day ago

0.2.7 does not fix the issue I mentioned above.

Log ``` ➜ gem install debase Fetching debase-0.2.7.gem Building native extensions. This could take a while... ERROR: Error installing debase: ERROR: Failed to build gem native extension. current directory: /home/brendan/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/debase-0.2.7/ext /home/brendan/.rbenv/versions/3.2.2/bin/ruby extconf.rb checking for vm_core.h... no checking for vm_core.h... no ************************************************************************** No source for ruby-3.2.2-p53 (revision e51014f9c05aa65cbf203442d37fef7c12390015) provided with debase-ruby_core_source gem. Falling back to ruby-3.2.0-p0. ************************************************************************** checking for vm_core.h... yes checking for iseq.h... no checking for iseq.h... yes checking for version.h... yes creating Makefile current directory: /home/brendan/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/debase-0.2.7/ext make DESTDIR\= sitearchdir\=./.gem.20241118-1737736-wt8mb0 sitelibdir\=./.gem.20241118-1737736-wt8mb0 clean current directory: /home/brendan/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/debase-0.2.7/ext make DESTDIR\= sitearchdir\=./.gem.20241118-1737736-wt8mb0 sitelibdir\=./.gem.20241118-1737736-wt8mb0 compiling breakpoint.c breakpoint.c: In function ‘breakpoint_init_variables’: breakpoint.c:297:1: warning: old-style function definition [-Wold-style-definition] 297 | breakpoint_init_variables() | ^~~~~~~~~~~~~~~~~~~~~~~~~ At top level: cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been intended to silence earlier diagnostics cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may have been intended to silence earlier diagnostics compiling context.c context.c: In function ‘context_init_variables’: context.c:366:1: warning: old-style function definition [-Wold-style-definition] 366 | context_init_variables() | ^~~~~~~~~~~~~~~~~~~~~~ At top level: cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been intended to silence earlier diagnostics cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may have been intended to silence earlier diagnostics compiling debase_internals.c debase_internals.c: In function ‘print_debug’: debase_internals.c:36:3: warning: function ‘print_debug’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] 36 | vfprintf(stderr, message, ap); | ^~~~~~~~ debase_internals.c: In function ‘try_disable_trace_points’: debase_internals.c:105:1: warning: old-style function definition [-Wold-style-definition] 105 | try_disable_trace_points() | ^~~~~~~~~~~~~~~~~~~~~~~~ debase_internals.c: In function ‘enable_trace_points’: debase_internals.c:128:1: warning: old-style function definition [-Wold-style-definition] 128 | enable_trace_points() | ^~~~~~~~~~~~~~~~~~~ debase_internals.c: In function ‘count_stack_size’: debase_internals.c:316:5: warning: old-style function definition [-Wold-style-definition] 316 | int count_stack_size() { | ^~~~~~~~~~~~~~~~ debase_internals.c: In function ‘Debase_init_variables’: debase_internals.c:728:1: warning: old-style function definition [-Wold-style-definition] 728 | Debase_init_variables() | ^~~~~~~~~~~~~~~~~~~~~ debase_internals.c: In function ‘Init_debase_internals’: debase_internals.c:753:1: warning: old-style function definition [-Wold-style-definition] 753 | Init_debase_internals() | ^~~~~~~~~~~~~~~~~~~~~ In file included from /home/brendan/.rbenv/versions/3.2.2/include/ruby-3.2.0/ruby/ruby.h:27, from /home/brendan/.rbenv/versions/3.2.2/include/ruby-3.2.0/ruby.h:38, from ./debase_internals.h:4, from debase_internals.c:1: /home/brendan/.rbenv/versions/3.2.2/include/ruby-3.2.0/ruby/internal/anyargs.h:338:142: error: passing argument 3 of ‘rb_define_module_function_01’ from incompatible pointer type [-Wincompatible-pointer-types] 338 | #define rb_define_module_function(mod, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_module_function((arity), (func))((mod), (mid), (func), (arity)) | ^~~~~~ | | | void (*)(VALUE, VALUE) {aka void (*)(long unsigned int, long unsigned int)} debase_internals.c:770:3: note: in expansion of macro ‘rb_define_module_function’ 770 | rb_define_module_function(mDebase, "set_trace_flag_to_iseq", Debase_set_trace_flag_to_iseq, 1); | ^~~~~~~~~~~~~~~~~~~~~~~~~ /home/brendan/.rbenv/versions/3.2.2/include/ruby-3.2.0/ruby/internal/anyargs.h:274:21: note: expected ‘VALUE (*)(VALUE, VALUE)’ {aka ‘long unsigned int (*)(long unsigned int, long unsigned int)’} but argument is of type ‘void (*)(VALUE, VALUE)’ {aka ‘void (*)(long unsigned int, long unsigned int)’} 274 | RBIMPL_ANYARGS_DECL(rb_define_module_function, VALUE, const char *) | ^~~~~~~~~~~~~~~~~~~~~~~~~ /home/brendan/.rbenv/versions/3.2.2/include/ruby-3.2.0/ruby/internal/anyargs.h:256:41: note: in definition of macro ‘RBIMPL_ANYARGS_DECL’ 256 | RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _01(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); \ | ^~~ /home/brendan/.rbenv/versions/3.2.2/include/ruby-3.2.0/ruby/internal/anyargs.h:338:142: error: passing argument 3 of ‘rb_define_module_function_01’ from incompatible pointer type [-Wincompatible-pointer-types] 338 | #define rb_define_module_function(mod, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_module_function((arity), (func))((mod), (mid), (func), (arity)) | ^~~~~~ | | | void (*)(VALUE, VALUE) {aka void (*)(long unsigned int, long unsigned int)} debase_internals.c:773:3: note: in expansion of macro ‘rb_define_module_function’ 773 | rb_define_module_function(mDebase, "unset_iseq_flags", Debase_unset_trace_flags, 1); | ^~~~~~~~~~~~~~~~~~~~~~~~~ /home/brendan/.rbenv/versions/3.2.2/include/ruby-3.2.0/ruby/internal/anyargs.h:274:21: note: expected ‘VALUE (*)(VALUE, VALUE)’ {aka ‘long unsigned int (*)(long unsigned int, long unsigned int)’} but argument is of type ‘void (*)(VALUE, VALUE)’ {aka ‘void (*)(long unsigned int, long unsigned int)’} 274 | RBIMPL_ANYARGS_DECL(rb_define_module_function, VALUE, const char *) | ^~~~~~~~~~~~~~~~~~~~~~~~~ /home/brendan/.rbenv/versions/3.2.2/include/ruby-3.2.0/ruby/internal/anyargs.h:256:41: note: in definition of macro ‘RBIMPL_ANYARGS_DECL’ 256 | RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _01(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); \ | ^~~ At top level: cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been intended to silence earlier diagnostics cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may have been intended to silence earlier diagnostics make: *** [Makefile:248: debase_internals.o] Error 1 make failed, exit code 2 Gem files will remain installed in /home/brendan/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/debase-0.2.7 for inspection. Results logged to /home/brendan/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/extensions/x86_64-linux/3.2.0/debase-0.2.7/gem_make.out ➜ gem install debase -- --with-cflags=-Wno-error=incompatible-pointer-types Building native extensions with: '--with-cflags=-Wno-error=incompatible-pointer-types' This could take a while... Successfully installed debase-0.2.7 1 gem installed ```
hurricup commented 23 hours ago

@ZimbiX those errors are in ruby headers, we can't fix them. The only way is to disable the compiler error failing, see comments above. The commit I made here is to fix problems in debase codebase

ZimbiX commented 23 hours ago

@hurricup All I know is that it can be fixed by https://github.com/ruby-debug/debase/pull/110