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

Comments

Projects
None yet
2 participants
@gjtorikian
Member

gjtorikian commented Dec 8, 2015

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

This comment has been minimized.

Show comment
Hide comment
@gjtorikian

gjtorikian Dec 8, 2015

Member

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.

Member

gjtorikian commented Dec 8, 2015

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.

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Dec 8, 2015

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.
Member

ddfreyne commented Dec 8, 2015

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.

@ddfreyne ddfreyne added this to the 4.1.0 milestone Dec 8, 2015

@gjtorikian

This comment has been minimized.

Show comment
Hide comment
@gjtorikian

gjtorikian Dec 8, 2015

Member

Is this for the GitHub developer site?

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

Member

gjtorikian commented Dec 8, 2015

Is this for the GitHub developer site?

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

@gjtorikian

This comment has been minimized.

Show comment
Hide comment
@gjtorikian

gjtorikian Dec 8, 2015

Member

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.

Member

gjtorikian commented Dec 8, 2015

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.

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Dec 8, 2015

Member

Yes please! Small test cases are awesome.

Member

ddfreyne commented Dec 8, 2015

Yes please! Small test cases are awesome.

@gjtorikian

This comment has been minimized.

Show comment
Hide comment
@gjtorikian

gjtorikian Dec 8, 2015

Member

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.

Member

gjtorikian commented Dec 8, 2015

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

This comment has been minimized.

Show comment
Hide comment
@gjtorikian

gjtorikian Dec 8, 2015

Member

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?

Member

gjtorikian commented Dec 8, 2015

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?

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Dec 8, 2015

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.)

Member

ddfreyne commented Dec 8, 2015

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.)

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Dec 8, 2015

Member

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

Member

ddfreyne commented Dec 8, 2015

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

@gjtorikian

This comment has been minimized.

Show comment
Hide comment
@gjtorikian

gjtorikian Dec 8, 2015

Member

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!

Member

gjtorikian commented Dec 8, 2015

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!

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Dec 8, 2015

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.

Member

ddfreyne commented Dec 8, 2015

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.

@ddfreyne ddfreyne closed this Dec 8, 2015

@ddfreyne ddfreyne removed this from the 4.1.0 milestone Dec 8, 2015

@ddfreyne ddfreyne removed the type:bug 🐛 label Dec 8, 2015

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Dec 9, 2015

Member

I captured the problem in #762.

Member

ddfreyne commented Dec 9, 2015

I captured the problem in #762.

@gjtorikian

This comment has been minimized.

Show comment
Hide comment
@gjtorikian

gjtorikian Dec 9, 2015

Member

Nice!

Member

gjtorikian commented Dec 9, 2015

Nice!

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Dec 11, 2015

Member

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

Member

ddfreyne commented Dec 11, 2015

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

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Dec 12, 2015

Member

This is still an issue in 4.1.0b1.

Member

ddfreyne commented Dec 12, 2015

This is still an issue in 4.1.0b1.

@ddfreyne ddfreyne reopened this Dec 12, 2015

@ddfreyne ddfreyne added this to the 4.1.0 milestone Dec 12, 2015

@ddfreyne ddfreyne closed this in #766 Dec 12, 2015

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Dec 12, 2015

Member

#766 fixes this. (Hopefully!)

Member

ddfreyne commented Dec 12, 2015

#766 fixes this. (Hopefully!)

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