Circular dependency when running `warble config` on a project that has Warbler::Task.new in its Rakefile #137

Open
gregkare opened this Issue Feb 2, 2013 · 2 comments

Comments

Projects
None yet
2 participants

gregkare commented Feb 2, 2013 edited by kares

I realize create a config file after adding the Rake task probably isn't very common, but it just happens to be what I've done the first time I've used Warbler.

Here's how to reproduce the issue (I'm using Warbler 1.3.6):

$ (
cat <<'EOF'
require 'rake'
require 'warbler'
Warbler::Task.new
EOF
) > Rakefile
$ mkdir config; touch config/environment.rb

And the stack trace:

warble aborted!
stack level too deep
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:56:in `load_project_rakefile'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler.rb:25:in `project_application'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits/rails.rb:27:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/config.rb:176:in `initialize'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/task.rb:48:in `initialize'
/Users/user/code/warbler/spec/sample_rake_bug/rakefile:3:in `(root)'
org/jruby/RubyKernel.java:1046:in `load'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:1:in `(root)'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:58:in `load_project_rakefile'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:56:in `load_project_rakefile'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler.rb:25:in `project_application'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits/rails.rb:27:in `before_configure'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/config.rb:176:in `initialize'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/task.rb:48:in `initialize'
org/jruby/RubyKernel.java:1046:in `load'
/Users/user/code/warbler/spec/sample_rake_bug/rakefile:3:in `(root)'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:1:in `(root)'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:58:in `load_project_rakefile'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:56:in `load_project_rakefile'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler.rb:25:in `project_application'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits/rails.rb:27:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/config.rb:176:in `initialize'
org/jruby/RubyKernel.java:1046:in `load'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/task.rb:48:in `initialize'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/code/warbler/spec/sample_rake_bug/rakefile:3:in `(root)'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:1:in `(root)'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:58:in `load_project_rakefile'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:56:in `load_project_rakefile'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler.rb:25:in `project_application'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits/rails.rb:27:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
org/jruby/RubyKernel.java:1046:in `load'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/config.rb:176:in `initialize'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/task.rb:48:in `initialize'
/Users/user/code/warbler/spec/sample_rake_bug/rakefile:3:in `(root)'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:1:in `(root)'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:58:in `load_project_rakefile'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:56:in `load_project_rakefile'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler.rb:25:in `project_application'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits/rails.rb:27:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
org/jruby/RubyKernel.java:1046:in `load'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/config.rb:176:in `initialize'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/task.rb:48:in `initialize'
/Users/user/code/warbler/spec/sample_rake_bug/rakefile:3:in `(root)'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:1:in `(root)'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:58:in `load_project_rakefile'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:56:in `load_project_rakefile'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler.rb:25:in `project_application'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits/rails.rb:27:in `before_configure'
org/jruby/RubyKernel.java:1046:in `load'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/config.rb:176:in `initialize'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/task.rb:48:in `initialize'
/Users/user/code/warbler/spec/sample_rake_bug/rakefile:3:in `(root)'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:1:in `(root)'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:58:in `load_project_rakefile'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:56:in `load_project_rakefile'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler.rb:25:in `project_application'
org/jruby/RubyKernel.java:1046:in `load'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits/rails.rb:27:in `before_configure'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/config.rb:176:in `initialize'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/task.rb:48:in `initialize'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/code/warbler/spec/sample_rake_bug/rakefile:3:in `(root)'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:1:in `(root)'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:58:in `load_project_rakefile'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:56:in `load_project_rakefile'
org/jruby/RubyKernel.java:1046:in `load'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler.rb:25:in `project_application'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits/rails.rb:27:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/config.rb:176:in `initialize'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/task.rb:48:in `initialize'
/Users/user/code/warbler/spec/sample_rake_bug/rakefile:3:in `(root)'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:1:in `(root)'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:58:in `load_project_rakefile'
org/jruby/RubyKernel.java:1046:in `load'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:56:in `load_project_rakefile'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler.rb:25:in `project_application'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits/rails.rb:27:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits.rb:28:in `before_configure'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/config.rb:176:in `initialize'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/task.rb:48:in `initialize'
/Users/user/code/warbler/spec/sample_rake_bug/rakefile:3:in `(root)'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:1:in `(root)'
org/jruby/RubyKernel.java:1046:in `load'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:58:in `load_project_rakefile'
org/jruby/RubyArray.java:1613:in `each'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/application.rb:56:in `load_project_rakefile'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler.rb:25:in `project_application'
/Users/user/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/warbler-1.3.6/lib/warbler/traits/rails.rb:27:in `before_configure'

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1446630-circular-dependency-when-running-warble-config-on-a-project-that-has-warbler-task-new-in-its-rakefile?utm_campaign=plugin&utm_content=tracker%2F136961&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F136961&utm_medium=issues&utm_source=github).
Member

jkutner commented Feb 2, 2013

In the past I've worked around this by creating my own tasks that create the warbler task on the fly. Like this:

namespace :deploy do
  desc "Package the application into a WAR file and deploy it"
  task :war do
    Warbler::Task.new(:warble)
    Rake::Task['warble'].invoke
    # do deployment stuff
  end
end

This is also nice if you want to supplement the particular warbler task with some other actions.

gregkare commented Feb 2, 2013

It looks like having Warbler::Task.new in your Rakefile only creates problems, I also get a "stack level too deep" error when running warble executable war if it's in there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment