Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Open
jqr opened this Issue · 24 comments

8 participants

@jqr

The latest working version was 2.8.4.

@coldnebo

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

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

@coldnebo

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

@trans

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

@coldnebo

Sure, look at grstearns@1b73385 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

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

@coldnebo

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

+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

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

trans:

Cool. Ok, next one:

facets/dictionary (LoadError)
@trans

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

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

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

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

Ok, I'll take a look.

@mtravers

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

@rking

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
@coldnebo
@jonmarinellors

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

@coldnebo
@rking

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

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

  • Added a gemspec file so that my fork can be easily pulled into other Bundler managed projects e.g. gem 'unroller', :git => 'git://github.com/falsetto/unroller.git'
  • Added a Gemfile to make it easy to install Unroller's deps when getting it set up
  • Removed lib/unroller.rb's dependencies on core extensions (Facets and quality_extensions were more trouble than they were worth)

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.