Skip to content

Can't install on mac os arm Mac OS Sonoma 14.4 #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
douglasom opened this issue Mar 18, 2024 · 10 comments
Closed

Can't install on mac os arm Mac OS Sonoma 14.4 #108

douglasom opened this issue Mar 18, 2024 · 10 comments

Comments

@douglasom
Copy link

douglasom commented Mar 18, 2024

gem install debase -v 0.2.5.beta2

  • Macbook Pro M1 Pro
  • Mac OS 14.4
  • Ruby 3.3.0 (same error happens on Ruby 2.7.8)
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: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]
  rb_define_module_function(mDebase, "set_trace_flag_to_iseq", Debase_set_trace_flag_to_iseq, 1);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/douglas/.asdf/installs/ruby/3.3.0/include/ruby-3.3.0/ruby/internal/anyargs.h:338:142: note: expanded from macro 'rb_define_module_function'
#define rb_define_module_function(mod, mid, func, arity)    RBIMPL_ANYARGS_DISPATCH_rb_define_module_function((arity), (func))((mod), (mid), (func), (arity))
                                                                                                                                             ^~~~~~
/Users/douglas/.asdf/installs/ruby/3.3.0/include/ruby-3.3.0/ruby/internal/anyargs.h:274:1: note: passing argument to parameter here
RBIMPL_ANYARGS_DECL(rb_define_module_function, VALUE, const char *)
^
/Users/douglas/.asdf/installs/ruby/3.3.0/include/ruby-3.3.0/ruby/internal/anyargs.h:256:72: note: expanded from macro 'RBIMPL_ANYARGS_DECL'
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]
  rb_define_module_function(mDebase, "unset_iseq_flags", Debase_unset_trace_flags, 1);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/douglas/.asdf/installs/ruby/3.3.0/include/ruby-3.3.0/ruby/internal/anyargs.h:338:142: note: expanded from macro 'rb_define_module_function'
#define rb_define_module_function(mod, mid, func, arity)    RBIMPL_ANYARGS_DISPATCH_rb_define_module_function((arity), (func))((mod), (mid), (func), (arity))
                                                                                                                                             ^~~~~~
/Users/douglas/.asdf/installs/ruby/3.3.0/include/ruby-3.3.0/ruby/internal/anyargs.h:274:1: note: passing argument to parameter here
RBIMPL_ANYARGS_DECL(rb_define_module_function, VALUE, const char *)
^
/Users/douglas/.asdf/installs/ruby/3.3.0/include/ruby-3.3.0/ruby/internal/anyargs.h:256:72: note: expanded from macro 'RBIMPL_ANYARGS_DECL'
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

@douglasom douglasom changed the title Can't install on mac os arm Can't install on mac os arm Mac OS 14.4 Mar 18, 2024
@douglasom douglasom changed the title Can't install on mac os arm Mac OS 14.4 Can't install on mac os arm Mac OS Sonoma 14.4 Mar 18, 2024
@liamdawson
Copy link

I had some success by reducing that error to a warning with:

bundle config build.debase --global "--with-cflags=-Wno-error=incompatible-function-pointer-types"

May have needed a gem pristine debase --version 0.2.5.beta2 afterwards, hard to tell.

@somallg
Copy link

somallg commented Mar 20, 2024

Try this oneliner to install debase (change 0.2.5.beta2 to your version if needed)

gem install debase -v 0.2.5.beta2 -- --with-cflags=-Wno-incompatible-function-pointer-types

@lilanm-aeturnum
Copy link

I had some success by reducing that error to a warning with:

bundle config build.debase --global "--with-cflags=-Wno-error=incompatible-function-pointer-types"

May have needed a gem pristine debase --version 0.2.5.beta2 afterwards, hard to tell.

Yes this helped me too

@carlwiedemann
Copy link

I had some luck using Xcode command line tools version 15.1 rather than version 15.3

@tridnguyen
Copy link

tridnguyen commented Apr 3, 2024

My issue on bundle install was bundler version 2.5.7. Rolling back to 2.5.6 and using 0.2.5.beta2 worked for me.

@jfheinrich
Copy link

My issue on bundle install was bundler version 2.5.7. Rolling back to 2.5.6 and using 0.2.5.beta2 worked for me.

macOS: Sonoma 14.4.1
Ruby: 3.3.0

This workaround don't worked for me, I got the same errors again. I tried all versions from 2.5.7 to 2.5.9, all the same result.

@romanbsd
Copy link
Contributor

romanbsd commented Jun 9, 2024

#110

@orbulant
Copy link

orbulant commented Jul 6, 2024

For those using bundler add this to your .bundle/config:

BUNDLE_BUILD__DEBASE: "-- --with-cflags=-Wno-incompatible-function-pointer-types"

I've also discovered that this issue is also present for rails-debug-ide and grpc (holy).

BUNDLE_BUILD__RUBY_DEBUG_IDE: "-- --with-cflags=-Wno-incompatible-function-pointer-types"
BUNDLE_BUILD__GRPC: "-- --with-cflags=-Wno-incompatible-function-pointer-types"

Works for me.

@kivikakk
Copy link

kivikakk commented Aug 9, 2024

For those using bundler add this to your .bundle/config:

BUNDLE_BUILD__DEBASE: "-- --with-cflags=-Wno-incompatible-function-pointer-types"

This didn't work for me, unfortunately; I was very hopeful the extra -- would somehow be it! I still get "incompatible function pointer types …"-type errors in the resulting gem_make.out:

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);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It seems debase really doesn't want to pass the Bundler config down the line, as opposed to gem install debase -- … (which works fine). Weird.

hurricup added a commit that referenced this issue Nov 18, 2024
…ter-types` and `-Werror=incompatible-function-pointer-types`

Fixup for #110 #108
@ZimbiX
Copy link

ZimbiX commented Nov 18, 2024

Thanks, @hurricup ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests