Skip to content
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

Unable to install debug gem on JRuby 9.4 #7856

Open
JesseChavez opened this issue Jul 13, 2023 · 7 comments
Open

Unable to install debug gem on JRuby 9.4 #7856

JesseChavez opened this issue Jul 13, 2023 · 7 comments

Comments

@JesseChavez
Copy link

Trying to install the debug gem fails with the below error:

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

** System information **

  • Ubuntu 23.04
  • Liunx 6.2.0-25-generic
  • Java 11 and 17
$ chruby
   jruby-9.3.10.0
   jruby-9.4.1.0
 * jruby-9.4.3.0
   ruby-2.5.8
   ruby-2.6.8
   ruby-2.7.7
   ruby-3.1.0
   ruby-3.1.4

Installing gem

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

    current directory: /home/jessec/.gem/jruby/3.1.4/gems/debug-1.8.0/ext/debug
/home/jessec/.rubies/jruby-9.4.3.0/bin/jruby -I /home/jessec/.rubies/jruby-9.4.3.0/lib/ruby/stdlib extconf.rb
checking for rb_iseq_parameters(NULL, 0) in VALUE rb_iseq_parameters(void *, int is_proc);... *** 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=/home/jessec/.rubies/jruby-9.4.3.0/bin/jruby
RuntimeError: The compiler failed to generate an executable file.
You have to install development tools first.

        try_do at /home/jessec/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:456
     try_link0 at /home/jessec/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:541
      try_link at /home/jessec/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:556
      try_func at /home/jessec/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:772
     have_func at /home/jessec/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:1051
  checking_for at /home/jessec/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:942
      postpone at /home/jessec/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:350
          open at /home/jessec/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:320
      postpone at /home/jessec/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:350
          open at /home/jessec/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:320
      postpone at /home/jessec/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:346
  checking_for at /home/jessec/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:941
     have_func at /home/jessec/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:1050
        <main> at extconf.rb:16

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

  /home/jessec/.gem/jruby/3.1.4/extensions/universal-java-11/3.1.0/debug-1.8.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/jessec/.gem/jruby/3.1.4/gems/debug-1.8.0 for inspection.
Results logged to /home/jessec/.gem/jruby/3.1.4/extensions/universal-java-11/3.1.0/debug-1.8.0/gem_make.out

Inspecting mkmf.log

$ cat /home/jessec/.gem/jruby/3.1.4/extensions/universal-java-11/3.1.0/debug-1.8.0/mkmf.log
" -o conftest -I/include/universal-java11 -I/home/jessec/.rubies/jruby-9.4.3.0/lib/ruby/include/ruby/backward -I/home/jessec/.rubies/jruby-9.4.3.0/lib/ruby/include -I.     -fno-omit-frame-pointer -fno-strict-aliasing  -fexceptions  conftest.c  -L. -L/home/jessec/.rubies/jruby-9.4.3.0/lib    -m64      "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <ruby.h>
4: int main(int argc, char **argv)
5: {
6:   return 0;
7: }
/* end */

@xanderificnl
Copy link

Were you able to get this resolved?

@enebo
Copy link
Member

enebo commented Aug 14, 2023

ruby/debug is not supported by us currently. It uses quite a bit of internals specific to MRI. We would like to add an analogue (and likely include that directly into debug) but no one is currently working on it.

@xanderificnl
Copy link

Thanks for letting us know!

@headius
Copy link
Member

headius commented Aug 14, 2023

I believe it would be possible to support the debug gem. It is mostly just Ruby but there are debug hooks in recent MRI that we would need to emulate. Supporting it, or the protocol it uses, would let us have access to all the other supporting debug tools like using the Chrome debugger or vs.code Ruby debugger plugins.

@h0jeZvgoxFepBQ2C
Copy link

Did you solve this somehow? We are having the same problem, independent of using rvm or asdf

@enebo
Copy link
Member

enebo commented Sep 14, 2023

We do not support 'debug' but you can get some debugging via 'ruby-debug'. As @headius said much of what is in the debug could be supported but we need someone to do the work. As it stands it is a lot of native c extension logic. We need the equivalent written in Java.

@h0jeZvgoxFepBQ2C
Copy link

Sorry, I should have been more clear.. I have the same problem with "You need to install developer tools first" (and tried all possible xcode selection fixes out there in the internet). So question was more to @JesseChavez than to you maintainers, sorry :)

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

5 participants