TylerRick / unroller

Ruby Unroller, a code tracing tool
http://unroller.rubyforge.org/
35 stars 7 forks source link

Not compatible with the latest(2.9.0) of facets #1

Open jqr opened 14 years ago

jqr commented 14 years ago

The latest working version was 2.8.4.

coldnebo commented 12 years ago

also have this problem.

Trying to use unroller in a rails 2.3.14 legacy project I inherited. This is what I get:

$ gem install unroller --include-dependencies
INFO:  `gem install -y` is now default and will be removed
INFO:  use --ignore-dependencies to install only the gems you list
Successfully installed facets-2.9.3
Successfully installed quality_extensions-1.3.1
Successfully installed colored-1.2
Successfully installed unroller-1.0.0

$ ruby script/server
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- facets/methodspace (MissingSourceFile)
  from <internal:lib/rubygems/custom_require>:29:in `require'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `block in require'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/unroller-1.0.0/lib/unroller.rb:4:in `<top (required)>'
  from <internal:lib/rubygems/custom_require>:33:in `require'
  from <internal:lib/rubygems/custom_require>:33:in `rescue in require'
  from <internal:lib/rubygems/custom_require>:29:in `require'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `block in require'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require'
  from /mathworks/home/lkyrala/perforce/legacy_rails_app/1.41/config/initializers/unroller_local_dev_trace_patch.rb:21:in `<top (required)>'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:171:in `load'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:171:in `block in load_with_new_constant_marking'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:171:in `load_with_new_constant_marking'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/rails-2.3.14/lib/initializer.rb:622:in `block in load_application_initializers'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/rails-2.3.14/lib/initializer.rb:621:in `each'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/rails-2.3.14/lib/initializer.rb:621:in `load_application_initializers'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/rails-2.3.14/lib/initializer.rb:176:in `process'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/rails-2.3.14/lib/initializer.rb:113:in `run'
  from /mathworks/home/lkyrala/perforce/legacy_rails_app/1.41/config/environment.rb:6:in `<top (required)>'
  from <internal:lib/rubygems/custom_require>:29:in `require'
  from <internal:lib/rubygems/custom_require>:29:in `require'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `block in require'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require'
  from /local/rvm/gems/ruby-1.9.2-p318@legacy_rails_app/gems/rails-2.3.14/lib/commands/server.rb:84:in `<top (required)>'
  from <internal:lib/rubygems/custom_require>:29:in `require'
  from <internal:lib/rubygems/custom_require>:29:in `require'
  from script/server:3:in `<main>'
trans commented 12 years ago

Likely just need to change facets/methodspace to facets/module/method_space.

coldnebo commented 12 years ago

yeah. (there might be a little more to bringing it up to date, looking at grstearns fork.)

trans commented 12 years ago

Can you be more specific? Is this something to do with changes in newer version of Facets, or is Unroller??

coldnebo commented 12 years ago

Sure, look at https://github.com/grstearns/unroller/commit/1b733851eb8e8a54ce2100742ad603d268b653c1 unroller.rb. There's quite a few more changes required to get the unroller tests to pass according to grstearns comment. Haven't had a chance to try this myself, but the basic point is that unroller no longer works out of the box, even when clean installing it's stated deps under rvm. It's ok to use older versions of deps, but in this case it doesn't work, nor does running with the newer deps.

trans commented 12 years ago

I see. So really your saying Tyler needs to pull in grstearns changes too to get things into a working state?

coldnebo commented 12 years ago

Perhaps... I'm not sure grstearns fork is in a working state... he seems to be in the middle of it? I haven't had time to pull code to check, just noticed that the documented instructions for install don't work right now.

rking commented 12 years ago

+1.

Simply changing unroller.rb to require facets/module/method_space gets past that line, but then the next one fails (require 'facets/kernel/populate') which doesn't seem to be a valid facet thinger.

—☈

trans commented 12 years ago

If memory serves, #populate is the old name for #assign. So require 'facets/kernel/assign' instead and change all uses of #populate to #assign.

rking commented 12 years ago

trans:

Cool. Ok, next one:

facets/dictionary (LoadError)
trans commented 12 years ago

That one depends on what you are doing with it. I'd guess it is just being used as an ordered hash. If that's the case then Ruby's regular Hash class now preserves order (I think from Ruby v1.8.7 on), so you can just replace it with Hash.

If however Dictionary's special sorting features are being used, then add hashery to dependencies and require 'hashery/dictionary', and also be sure to account for namespace, i.e. Hashery::Dictionary.

FYI, if you are wondering why all this is needed, Facets went through a major overhaul starting around v2.4. Looks like unroller was using a prior version.

rking commented 12 years ago

Hrm. So we're starting to get a bit deep, then.

The basic thing that is obvious is that this gem needs some attention.

I tried pinning the facets version to 2.4.1 (because https://rubygems.org/gems/unroller specifies >= 2.4.1), but that gives a different set of errors.

I see that there is a pretty serious fork of unroller:

https://github.com/grstearns/unroller

But I had trouble with even that, due to its requiring quality_rake_tasks, which seems to not exist anymore?

Neither project has an unroller.gemspec, so you can't use the Github versions easily from a Gemfile (I'll message grstearns about that in just a minute).

Also, I'm wondering how much set_trace_func would affect the implementation of a gem like this?

I think there clearly is room for a smart trace gem. Especially the idea that you provide the user with something like :rails arguments so you can quickly throw in tracing without being overwhelmed by irrelevant parts. (Which, by the way: The docs at http://unroller.rubyforge.org/ have this marked as a TODO, while the source in this repo definitely has it implemented).

So, for myself and for others, I'd like to figure out a few things: 1) What is the easiest way to get the unroller gem itself working? 2) What is a longer-term solution? Is TylerRick around and interested in bringing the gem up to speed, or should we focus on a fork and make unroller2 or something?

Thanks! —☈

jonmarinellors commented 12 years ago

I ran into the same issues and you guys might find this posting of interest: http://stackoverflow.com/questions/11387751/problems-with-ruby-unroller-gem#comment15027337_11394920

I would be willing to help someone with a fork of this this if TylerRick is not interested.

Thanks,

jon

coldnebo commented 12 years ago

I was thinking of this, but don't have the cycles right now. On the other hand, I'm fairly sure that unroller is doing a lot more than it needs to -- the formatting, extensions, etc. are all nice AFAIK, but not necessary. My first impression is that unroller could be substantially thinner without relying on as many external dependencies.

I was able to roll my own utility as an initializer patch for a ruby 2.3.14 project I needed something like unroller for. You can check out my sketch here: https://gist.github.com/3077744

Feel free to run with the concept if it helps you adapt or rewrite unroller.

jonmarinellors commented 12 years ago

Ok, I'll take a look.

mtravers commented 12 years ago

If nobody is going to fix this, couldn't it at least be packaged up to use the earlier version of facets?

rking commented 12 years ago

You know, I was thinking.

We should consider a project that is an unprecedentedly-awesome trace output.

You can see from the screenshots of unroller that it was pretty cool, but that it pushed right up against the edge of the amount of information you can display to stdout.

I'm thinking we consider a browser-with-<canvas> version that rocks everybody's faces.

It's all localhost communication, so you could simply make a dump-everything set_trace_func that gets filters down interactively.

In fact, I'd wager that such a tool could be expanded to work for multithreaded applications, which is traditionally a real brain-chomper.

Here's an example of the kind of result we could produce, except in the browser and interactive: http://www.ibm.com/developerworks/library/l-graphvis/#N10255

Perhaps even WebGL is in order. (Try Firefox 12+'s Right Click > Inspect Element > 3D View, if you don't know what I mean).

All I know is that this is a huge data set, and that SVG/WebGL are capable of displaying huge data sets, if used smartly.

mtravers commented 12 years ago

That is a very cool idea, would be happy to help (in fact, just today I was working on getting railroad to work, which turns class diagrams into a form that graphviz can render). http://railroad.rubyforge.org/

To do an interactive thing like you are envisioning, I'd recommend looking at d3 http://mbostock.github.com/d3/talk/20111018/tree.html

On Fri, Sep 14, 2012 at 9:16 PM, ☈king notifications@github.com wrote:

You know, I was thinking.

We should consider a project that is an unprecedentedly-awesome trace output.

You can see from the screenshots of unrollerhttp://unroller.rubyforge.org/files/Readme.htmlthat it was pretty cool, but that it pushed right up against the edge of the amount of information you can display to stdout.

I'm thinking we consider a browser-with- version that rocks everybody's faces.

It's all localhost communication, so you could simply make a dump-everything set_trace_func that gets filters down interactively.

In fact, I'd wager that such a tool could be expanded to work for multithreaded applications, which is traditionally a real brain-chomper.

Here's an example of the kind of result we could produce, except in the browser and interactive: http://www.ibm.com/developerworks/library/l-graphvis/#N10255

Perhaps even WebGL is in order. (Try Firefox 12+'s Right Click > Inspect Element > 3D View, if you don't know what I mean).

All I know is that this is a huge data set, and that SVG/WebGL are capable of displaying huge data sets, if used smartly.

— Reply to this email directly or view it on GitHubhttps://github.com/TylerRick/unroller/issues/1#issuecomment-8581706.

coldnebo commented 12 years ago

That's a very interesting idea. Beyond the vis of simplecov.

Sent from my iPhone

On Sep 15, 2012, at 12:16 AM, ☈king notifications@github.com wrote:

You know, I was thinking.

We should consider a project that is an unprecedentedly-awesome trace output.

You can see from the screenshots of unroller that it was pretty cool, but that it pushed right up against the edge of the amount of information you can display to stdout.

I'm thinking we consider a browser-with- version that rocks everybody's faces.

It's all localhost communication, so you could simply make a dump-everything set_trace_func that gets filters down interactively.

In fact, I'd wager that such a tool could be expanded to work for multithreaded applications, which is traditionally a real brain-chomper.

Here's an example of the kind of result we could produce, except in the browser and interactive: http://www.ibm.com/developerworks/library/l-graphvis/#N10255

Perhaps even WebGL is in order. (Try Firefox 12+'s Right Click > Inspect Element > 3D View, if you don't know what I mean).

All I know is that this is a huge data set, and that SVG/WebGL are capable of displaying huge data sets, if used smartly.

— Reply to this email directly or view it on GitHub.

jonmarinellors commented 12 years ago

I like it! The graphs could get very large though...

coldnebo commented 12 years ago

Actually, I used google perf tools to vis call graphs a while back, the graphs usually aren't that bad when limited to the code at hand (filtering out ruby stdlibs, gems, etc.)

Another idea along these lines was the debug layer in ColdFusion -- I was thinking of a HTML layer where you could "peel" back your rails app to see the flow and state of the last request underneath.

On Sat, Sep 15, 2012 at 3:29 PM, Jon Marinello notifications@github.comwrote:

I like it! The graphs could get very large though...

— Reply to this email directly or view it on GitHubhttps://github.com/TylerRick/unroller/issues/1#issuecomment-8588025.

rking commented 12 years ago

Well guys, I guess TylerRick is officially AWOL.

Do you want to start a repo somewhere so we can start tossing ideas into code form?

I can start it, but I don't want to be a glory hog and brand it under me/my orgs.

falsetto commented 11 years ago

I forked and hacked on Unroller enough to get it working for a Rails app (ruby 1.9.3p194 and Rails 3.2.9):

One caveat: Termios HEAD doesn't have a gemspec file, but only HEAD is working with Unroller. Since there's no gemspec, I couldn't list it as a dependency in Unroller's gemspec. Thus, in order for Unroller to work properly when adding it to another project's Gemfile (your Rails app, for example), you also need to also explicitly include Termios e.g. gem 'ruby-termios', :git => 'git://github.com/arika/ruby-termios.git'

Also, I've only tested the Unroller::trace method. I'm guessing that the other stepping debugger stuff still relies on Facets/quality_extensions (YMMV).

tyoc213 commented 11 years ago

There is anything new on this? or is @falsetto the one to go?

epitron commented 8 years ago

It looks like this gem has been abandoned. The author still appears to be alive, though!

Hey author, do you want to hand over maintenance of this project to someone else?

trans commented 8 years ago

I would imagine this gem could use a complete rewrite since Ruby now provides improved API for tracing.

epitron commented 8 years ago

Indeed.

Not it!