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

Skip debase extconf.rb on non-CRuby #106

Merged
merged 2 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/attach/extconf.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if defined?(RUBY_ENGINE) && 'rbx' == RUBY_ENGINE
if defined?(RUBY_ENGINE) && RUBY_ENGINE != 'ruby'
# create dummy Makefile to indicate success
f = File.open(File.join(File.dirname(__FILE__), "Makefile"), "w")
f.write("all:\n\techo all\ninstall:\n\techo installed\n")
Expand Down
2 changes: 1 addition & 1 deletion ext/extconf.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if defined?(RUBY_ENGINE) && 'rbx' == RUBY_ENGINE
if defined?(RUBY_ENGINE) && RUBY_ENGINE != 'ruby'
# create dummy Makefile to indicate success
f = File.open(File.join(File.dirname(__FILE__), "Makefile"), "w")
f.write("all:\n\techo all\ninstall:\n\techo installed\n")
Expand Down
5 changes: 5 additions & 0 deletions lib/debase.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
if defined?(RUBY_ENGINE) && 'rbx' == RUBY_ENGINE
require 'debase/rbx'
elsif defined?(RUBY_ENGINE) && RUBY_ENGINE == 'truffleruby'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This backend is not supposed to run with truffleruby

Copy link
Contributor Author

@eregon eregon Dec 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Contributor Author

@eregon eregon Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

require "debase/version"

Debugger = Module.new
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

return
else
require "debase_internals"
end
Expand Down