Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In 4.1.0a1, compilation throws new RecursiveCompilation error #761

Closed
gjtorikian opened this issue Dec 8, 2015 · 16 comments
Closed

In 4.1.0a1, compilation throws new RecursiveCompilation error #761

gjtorikian opened this issue Dec 8, 2015 · 16 comments
Milestone

Comments

@gjtorikian
Copy link
Contributor

With zero changes to my setup, other than upgrading to 4.1.0a1, I suddenly can't build my site:

Nanoc::Int::Errors::RecursiveCompilation: The site cannot be compiled because the following items mutually depend on each other:
<Nanoc::Int::ItemRep name="default" binary=false raw_path="output/404.html" item.identifier="/404.html">
<Nanoc::Int::ItemRep name="default" binary=false raw_path="output/articles/3d-file-viewer/index.html" item.identifier="/dotcom/articles/3d-file-viewer.md">
<Nanoc::Int::ItemRep name="default" binary=false raw_path="" item.identifier="/google363a90be6f604622.html">.
....

Compilation stack:

  (empty)

Stack trace:

  0. /Users/gjtorikian/github/help-docs/vendor/cache/ruby/2.2.0/gems/nanoc-4.1.0a1/lib/nanoc/base/services/item_rep_selector.rb:27:in `each'
  1. /Users/gjtorikian/github/help-docs/vendor/cache/ruby/2.2.0/gems/nanoc-4.1.0a1/lib/nanoc/base/compilation/compiler.rb:215:in `compile_reps'
  2. /Users/gjtorikian/github/help-docs/vendor/cache/ruby/2.2.0/gems/nanoc-4.1.0a1/lib/nanoc/base/compilation/compiler.rb:122:in `block in run'
  3. /Users/gjtorikian/github/help-docs/vendor/cache/ruby/2.2.0/gems/nanoc-4.1.0a1/lib/nanoc/base/compilation/dependency_tracker.rb:18:in `run'
  4. /Users/gjtorikian/github/help-docs/vendor/cache/ruby/2.2.0/gems/nanoc-4.1.0a1/lib/nanoc/base/compilation/compiler.rb:121:in `run'
  5. /Users/gjtorikian/github/help-docs/vendor/cache/ruby/2.2.0/gems/nanoc-4.1.0a1/lib/nanoc/base/compilation/compiler.rb:106:in `run_all'
  6. /Users/gjtorikian/github/help-docs/vendor/cache/ruby/2.2.0/gems/nanoc-4.1.0a1/lib/nanoc/base/entities/site.rb:24:in `compile'
  7. /Users/gjtorikian/github/help-docs/vendor/cache/ruby/2.2.0/gems/nanoc-4.1.0a1/lib/nanoc/cli/commands/compile.rb:375:in `block in run'
  8. /Users/gjtorikian/github/help-docs/vendor/cache/ruby/2.2.0/gems/nanoc-4.1.0a1/lib/nanoc/cli/commands/compile.rb:417:in `run_listeners_while'
  9. /Users/gjtorikian/github/help-docs/vendor/cache/ruby/2.2.0/gems/nanoc-4.1.0a1/lib/nanoc/cli/commands/compile.rb:374:in `run'
  ... 16 more lines omitted. See full crash log for details.

I'm going to try and dig around in recent PRs to see what changed but I suspect this may occur for others, too.

@gjtorikian
Copy link
Contributor Author

I dropped down to 4.0.2 and the error went away. And as one might expect, commenting out item_rep_selector.rb:27 has the site build as well.

@denisdefreyne
Copy link
Member

This to me seems like it happens because the cached data in tmp/ has changed formats in Nanoc 4.1, and Nanoc 4.1 misinterprets the format of 4.0. The solution for that would be to bump the file format version for the rule memory store.

Can you do two things for me?

  1. Is this for the GitHub developer site? If so, zip the entire directory (including tmp/) and send it to me so I can take a look.
  2. Afterwards, delete tmp/ and recompile with an unmodified Nanoc 4.1.0a1. If my hypothesis is correct, the site will compile properly.

@denisdefreyne denisdefreyne added this to the 4.1.0 milestone Dec 8, 2015
@gjtorikian
Copy link
Contributor Author

Is this for the GitHub developer site?

It is not, it is sadly for a closed source site. 😦

@gjtorikian
Copy link
Contributor Author

Your hypothesis sadly did not work! I rm -rf tmp/ but it still did not compile.

I can send maybe a small reproducible test case instead of the whole directory? Will that help? I can get it crashing with just a 404.html and another file.

@denisdefreyne
Copy link
Member

Yes please! Small test cases are awesome.

@gjtorikian
Copy link
Contributor Author

I can't repro with the public developer site, so now I'm thinking I've bungled something on my end. Looking into it a bit before providing you with a zip and/or shutting this down.

@gjtorikian
Copy link
Contributor Author

Interesting.

I have this line in my default layout:

<% @meta_description = @item[:meta_description] || @item[:intro] || safe_embed(@item.compiled_content)[0..200] %>

If I remove @item.compiled_content, the build is successful. Is it possible these are like, getting collided somewhere?

@denisdefreyne
Copy link
Member

Ahh, that is possible, and that gives me another idea as to where this error is coming from.

You can replace @item.compiled_content with yield in the layout, which should fix it. (I’m guessing Nanoc 4.1 has a regression where it can’t deal with @item.compiled_content in this case, because it refers to the content after it’s been laid out. Needs further investigation as to where this issue coms from.)

@denisdefreyne
Copy link
Member

(It might be the case that Nanoc 4.1.0a1’s behavior is in fact more correct.)

@gjtorikian
Copy link
Contributor Author

Cool, that'll work. raw_content also seems to work.

Feel free to close this or keep it open if it's something you want to work on? I'm not entirely clear what the problem is, heh. And thanks for your quick replies!

@denisdefreyne
Copy link
Member

raw_content will get the initial content without any filters applied to it, so that might not be what you want.

I’ll investigate and when I find that there’s an actual real issue here, but for now I’ll consider this resolved.

@denisdefreyne denisdefreyne removed this from the 4.1.0 milestone Dec 8, 2015
@denisdefreyne
Copy link
Member

I captured the problem in #762.

@gjtorikian
Copy link
Contributor Author

Nice!

@denisdefreyne
Copy link
Member

4.1 beta 1 has the fix (see #764).

@denisdefreyne
Copy link
Member

This is still an issue in 4.1.0b1.

@denisdefreyne
Copy link
Member

#766 fixes this. (Hopefully!)

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

No branches or pull requests

2 participants