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

Interrupting nanoc compile corrupts change tracking #1641

Closed
Fjan opened this issue Jan 13, 2023 · 5 comments · Fixed by #1667
Closed

Interrupting nanoc compile corrupts change tracking #1641

Fjan opened this issue Jan 13, 2023 · 5 comments · Fixed by #1667

Comments

@Fjan
Copy link
Contributor

Fjan commented Jan 13, 2023

Steps to reproduce

  1. Make a small change to a layout file that will cause all files to recompile
  2. Issue nanoc compile and interrupt it shortly afterwards with ctrl-C
  3. Issue nanoc compile once more in order to finish the compilation

Expected behavior

The site should be compiled in it's entirety.

Actual behavior

The compilation is not resumed, only the files before the interrupt have been compiled

Details

I can think of several acceptable ways to behave upon interruption:

  • It should wait with writing any state until the compilation is finished, so that an interrupted compilation starts over
  • it could write and recalculate the state from the point it was interrupted
  • it could invalidate the entire dependency graph and recompile everything

I would argue the current behaviour where it does not compile the remaining outdated files after an interrupt is dangerous, because it may go unnoticed, causing someone to release/upload a site that's not fully compiled.

@denisdefreyne
Copy link
Member

Can you check whether this is fixed by #1644?

I cannot reproduce this issue myself, and Nanoc is supposed to handle interrupted compilation correctly (mark only already-compiled files as non-outdated).

@Fjan
Copy link
Contributor Author

Fjan commented Feb 5, 2023

Sorry, this does not resolve it. I added print '.' inside the def identifier=(new_identifier) to check whether it got hit, and this shows your new code only gets hit during the "Loading site" stage of nanoc, not during the "Compiling site" stage, so I don't think it's possible for it to affect compilation.

Thinking it might be something about my specific project, I have I tried to reproduce it on another project and the problem occurred there too. Most other nanoc repos I have are small enough that it's tricky to interrupt compilation half way through, but I managed to reliably reproduce the problem by adding a filter to the compilation step with sleep 1 in it. That way you can reproduce it on a very small site.

@denisdefreyne
Copy link
Member

@Fjan Is there a chance you could share the project with me so I could take a look?

@Fjan
Copy link
Contributor Author

Fjan commented Jun 15, 2023

It's a private repo, a company internal thing, but I can email you a zip file if you want?

@denisdefreyne
Copy link
Member

This is fixed in the just-released Nanoc 4.12.18.

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

Successfully merging a pull request may close this issue.

2 participants