Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Trying to build ruby_debug.so fails on debugger/ruby_core_source #9

Closed
ericpromislow opened this issue Apr 19, 2012 · 7 comments
Closed

Comments

@ericpromislow
Copy link

I'm trying to use this fork to get the Komodo Ruby debugger working with 1.9.3

Trying to run 'ruby extconf.rb' with ruby 1.9.3-p125 gives this error:
/home/ericp/opt/ruby-1.9.3-p125/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- debugger/ruby_core_source (LoadError) from /home/ericp/opt/ruby-1.9.3-p125/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from extconf.rb:16:in `

'

There is no ruby_core_source.rb in the debugger/lib/debugger dir

I made the following changes to extconf.rb:

Index: /home/ericp/lab/rb/ruby-debug--cldwalker/debugger/ext/ruby_debug/extconf.rb
index 7ebeedc..ed53538 100644
--- a/ext/ruby_debug/extconf.rb
+++ b/ext/ruby_debug/extconf.rb
@@ -13,7 +13,14 @@ unless ARGV.any? {|arg| arg.include?('--with-ruby-include') }
end

require "mkmf"
-require "debugger/ruby_core_source"
+begin

  • require "debugger/ruby_core_source"
  • RubyCoreSource = Debugger::RubyCoreSource
    +rescue LoadError
  • require 'rubygems'
  • require 'ruby_core_source'
  • RubyCoreSource = Ruby_core_source
    +end
    require 'fileutils'

if RUBY_VERSION < "1.9"
@@ -58,7 +65,7 @@ current_dir = File.dirname(FILE)
end

dir_config("ruby")
-if !Debugger::RubyCoreSource.create_makefile_with_core(hdrs, "ruby_debug")
+if !RubyCoreSource.create_makefile_with_core(hdrs, "ruby_debug")
STDERR.print("Makefile creation failed\n")
STDERR.print("*************************************************************\n\n")
STDERR.print(" NOTE: If your headers were not found, try passing\n")

, and managed to build a ruby_debug.so with only two warnings::

ruby_debug $ make
compiling ruby_debug.c
ruby_debug.c: In function ‘context_jump’:
ruby_debug.c:2393: warning: comparison between signed and unsigned
ruby_debug.c:2407: warning: comparison between signed and unsigned
compiling breakpoint.c
linking shared-object ruby_debug.so

I'll report back on results of integrating that .so into the Komodo debugger.

@cldwalker
Copy link
Owner

It seems you're running ruby extconf.rb not having installed debugger's dependencies. You'll need to install debugger-ruby_core_source among others. Doing that should fix these issues.

@ericpromislow
Copy link
Author

Are there recommended commands for installing the dependencies? I'm all for a self-contained gem; I
had this same problem with Mark's ruby-debug-base, dealing with linecache, tracenums, ruby-core-source,
and columnize.

I logged a new bug (11 I think), but it's a dup of bug 1 -- I cobbled together a fix by pointing at all the
dependencies in different existing working ruby debugger directories, and got the same stack trace
that's in bug 1.

@cldwalker
Copy link
Owner

I'm not sure I understand what environment you're running in. If you gem install debugger, you'll get the dependencies. Are you git cloning debugger and then running ruby extconf.rb? If you are, then you'll need to add steps to automate downloading and using its dependencies. debugger.gemspec lists the necessary dependencies.

@cldwalker
Copy link
Owner

As for bug 1, it's a known issue, patches welcome :)

@ericpromislow
Copy link
Author

I reinstalled the gems following http://stackoverflow.com/a/9056783

The binary gem builds this time without any interference. May I suggest
that you decouple ruby-debug-base from the rest of the gem? Plenty
of us debugger-writers are using ruby-debug-base but not the other parts.

@cldwalker
Copy link
Owner

I don't understand why you used the stackoverflow link when I said gem install debugger. That link refers to the original ruby-debug19 which is a different project.

I'm open to making ruby-debug-base available but I need to understand your use case. If you require ruby-debug-base you don't load anything from the rest of ruby-debug. As for dependencies, ruby-debug-base still depends on debugger-linecache and debugger-ruby_core_source. I need compelling reason beyond not wanting to download columnize.

@cldwalker
Copy link
Owner

Ok. If you're using debugger to build these different versions, note that it only works for 1.9.2 and 1.9.3. I don't see any blockers on using ruby-debug-base if you're manually building debugger and its dependencies.

I don't know when Debugger.start got renamed, must have happened before I forked.

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

No branches or pull requests

2 participants