Marco Bresciani
Marco Bresciani

Reputation: 172

Circular dependency on rake package task

I've created my own 'gravaty' gem (see RubyGems) with its own gravaty.gemspec file and the Rakefile with main tasks.

The problem is: when I run rake package after having ran rake rdoc I see this error

rake aborted!
Circular dependency detected: TOP => package => pkg/gravaty-3.3.1.tgz => pkg/gravaty-3.3.1 => html/index.html => html/index.html

Tasks: TOP => package => pkg/gravaty-3.3.1.tgz => pkg/gravaty-3.3.1 => html/index.html
(See full trace by running task with --trace)

Instead, if I run the same command after rake clean clobber, so without the RDoc html folder, the problem does not arise.

This http://hg.savannah.gnu.org/hgweb/gravaty/file/923b9133aefc/Rakefile is the Rakefile.

This http://hg.savannah.gnu.org/hgweb/gravaty/file/923b9133aefc/gravaty.gemspec is the gemspec. It seems that, if I remove the html folder from line 34 (a_gem.files = Dir.glob('{examples,html,lib,test}/**/*') + COMMON_FILES) it works... but why should I remove the RDoc from the package? I'd prefer to keep it.

And this http://hg.savannah.gnu.org/hgweb/gravaty/file/923b9133aefc/Gemfile, even if not so useful, is the Gemfile.

Upvotes: 0

Views: 447

Answers (1)

Richard Michael
Richard Michael

Reputation: 1624

Reviving an old question, perhaps you have the solution already ; but I found your question when researching a confusing circular dependency error in a much simpler Rakefile, and thought this would be helpful for others searching..

I can't provide an exact answer, however--

There is a task namespace / scope issue in 10.x Rake, see here. To tell Rake to return to the top-level to begin look-up, prefix the prerequisite task name with ^, e.g., task 'foo:bar' => '^bar' to call top-level task "bar", not the "foo:bar" task again (circular).

I guess the issue here is with the Rubygems package task, and I'd file a bug/inquiry with the Rubygems team, or post on their mailing-list.

Upvotes: 1

Related Questions