Skip debase extconf.rb on non-CRuby#106
Conversation
* Otherwise: ruby-debug-ide-VERSION/lib/ruby-debug-ide.rb:10:in `<top (required)>': uninitialized constant Debugger (NameError)
|
Ping, I'd like to merge this. |
| @@ -1,5 +1,10 @@ | |||
| if defined?(RUBY_ENGINE) && 'rbx' == RUBY_ENGINE | |||
| require 'debase/rbx' | |||
| elsif defined?(RUBY_ENGINE) && RUBY_ENGINE == 'truffleruby' | |||
There was a problem hiding this comment.
This backend is not supposed to run with truffleruby
There was a problem hiding this comment.
Yes, that's why this code is skipping it.
It's still valuable that the gem installs, otherwise e.g. ruby-debug-ide cannot be installed either and it leads to more workarounds in Gemfiles (and it's not always possible, e.g., if a gem depends on ruby-debug-ide and that gem is in the Gemfile, and it cannot be skipped because it has other dependencies, which we found in some apps).
There was a problem hiding this comment.
If the changes in this file are problematic, I can remove them or redo them differently.
The most critical part is that the debase C extensions are not attempted to be compiled on non-CRuby (because that would just fail).
|
@hurricup Could you merge this? |
|
I'm sorry, I still don't understand what are you trying to achieve? This gem is not intended to be used with truffleruby as well as ruby-debug-ide. |
To let the gem install fine on truffleruby, so there is no need to tweak the Gemfile. It's a fairly common practice to let gems install on TruffleRuby/JRuby/etc even when they are not supported, so at least they don't break |
| elsif defined?(RUBY_ENGINE) && RUBY_ENGINE == 'truffleruby' | ||
| require "debase/version" | ||
|
|
||
| Debugger = Module.new |
There was a problem hiding this comment.
The reason for this is explained in the commit message: 06bdb3c
But maybe it's the wrong place to do this and instead we should change lib/ruby-debug-ide.rb to noop earlier.
|
Sorry, i'm reverting this fix. I revisited it and it still feels wrong. This should be handled by the RDI as a "routing" part of the debugger, similar for any platform. Debase is for mri and should know only about it. |
|
What's the concrete issue caused by this? BTW there is Rubinius-specific code in Lines 1 to 2 in e97acd0 The concrete issue for debase + TruffleRuby is there are no optional dependencies in RubyGems/Bundler, so if a gem depends transitively on |
|
Ye, that one should be fixed as well. I suggest to do the thing you want in the conditional gemfile/gemspec of the rdi gem. Not in debase. Also syntax should be an ancient ruby compatible. |
|
Oh right, |
|
I think I misunderstood how |
Related: ruby-debug/ruby-debug-ide#240