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

Dependency problems with XSL filter and xsl:include #924

Closed
draconx opened this Issue Aug 2, 2016 · 9 comments

Comments

Projects
None yet
2 participants
@draconx

draconx commented Aug 2, 2016

Hi,

When using an XSL layout, nanoc does not seem to recognize included stylesheets as dependencies, and will not rebuild output files when the included stylesheets change.

I'd be happy with listing dependencies manually but as far as I can tell there is no way to do this; actually, I can't find anything in the documentation about how nanoc decides whether or not to rebuild a particular output file.

Attached example site. Build the site with nanoc, which generates output/index.xhtml. Then edit layouts/snippet.xsl (for example, change the page title). Expected behaviour is that rebuilding the site will update output/index.xhtml, but this does not happen.

Cheers,
Nick

xsltdemo.tar.gz: https://github.com/nanoc/nanoc/files/397694/xsltdemo.tar.gz

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Aug 21, 2016

Member

Nanoc indeed currently doesn’t handle dependencies xsl:include. It needs to be done manually, and I fear that this might not be an easy task, since it needs to handle transitive dependencies as well.

Marking as a bug, although it’s arguably perhaps a lacking feature.

Member

ddfreyne commented Aug 21, 2016

Nanoc indeed currently doesn’t handle dependencies xsl:include. It needs to be done manually, and I fear that this might not be an easy task, since it needs to handle transitive dependencies as well.

Marking as a bug, although it’s arguably perhaps a lacking feature.

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Aug 22, 2016

Member

As a workaround, you can delete the tmp directory in between builds. That directory stores dependency information, and lack of dependency information means that Nanoc will do a full rebuild. For sure not ideal, but it’ll help.

Member

ddfreyne commented Aug 22, 2016

As a workaround, you can delete the tmp directory in between builds. That directory stores dependency information, and lack of dependency information means that Nanoc will do a full rebuild. For sure not ideal, but it’ll help.

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Nov 20, 2016

Member

Ohh, I got this wrong. The problem is that there is not even a dependency from the item on the layout. A fix is coming up.

Member

ddfreyne commented Nov 20, 2016

Ohh, I got this wrong. The problem is that there is not even a dependency from the item on the layout. A fix is coming up.

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Nov 20, 2016

Member

#996 has a fix for this issue.

Member

ddfreyne commented Nov 20, 2016

#996 has a fix for this issue.

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Nov 20, 2016

Member

Ack, nevermind—I’ve discovered a related issue, but the xsl:include elements not generating a dependency is still an open issue.

Member

ddfreyne commented Nov 20, 2016

Ack, nevermind—I’ve discovered a related issue, but the xsl:include elements not generating a dependency is still an open issue.

@ddfreyne ddfreyne removed this from the 4.4.1 milestone Nov 20, 2016

@ddfreyne ddfreyne closed this in #996 Nov 20, 2016

ddfreyne added a commit that referenced this issue Nov 20, 2016

Merge pull request #996 from nanoc/gh-924
Make DocumentViewMixin#raw_content generate dependency

@ddfreyne ddfreyne reopened this Nov 22, 2016

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Nov 22, 2016

Member

Accidentally automatically closed via a Git commit, sorry!

Member

ddfreyne commented Nov 22, 2016

Accidentally automatically closed via a Git commit, sorry!

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Mar 5, 2017

Member

This issue is still relevant, but I believe that there is no way to fix this in a nice way. I have two ideas:

  • Make the xsl filter depend on all items that have an xsl extension (either /**/*.xsl or item[:extension] == 'xsl'. This isn’t nice because it might tax Nanoc’s dependency generator a bit much.

  • Mark the xsl filter as always needing to be run, skipping the outdatedness check. This also isn’t super nice, and requires some changes in Nanoc to support this.

A proper solution might not be possible with Nokogiri (Nanoc would have to be able to generate the dependency graph of xsl:includes, which I don’t think is possible).

Member

ddfreyne commented Mar 5, 2017

This issue is still relevant, but I believe that there is no way to fix this in a nice way. I have two ideas:

  • Make the xsl filter depend on all items that have an xsl extension (either /**/*.xsl or item[:extension] == 'xsl'. This isn’t nice because it might tax Nanoc’s dependency generator a bit much.

  • Mark the xsl filter as always needing to be run, skipping the outdatedness check. This also isn’t super nice, and requires some changes in Nanoc to support this.

A proper solution might not be possible with Nokogiri (Nanoc would have to be able to generate the dependency graph of xsl:includes, which I don’t think is possible).

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Mar 19, 2017

Member

I have a fix in #1127. This fix marks the xsl filter always needing to be run (always marking the item rep as outdated). This isn’t ideal, but I couldn’t find a simple way to make Nokogiri report its dependencies (finding all xsl:include/xsl:import).

The fix will be in Nanoc 4.7.1.

Member

ddfreyne commented Mar 19, 2017

I have a fix in #1127. This fix marks the xsl filter always needing to be run (always marking the item rep as outdated). This isn’t ideal, but I couldn’t find a simple way to make Nokogiri report its dependencies (finding all xsl:include/xsl:import).

The fix will be in Nanoc 4.7.1.

@ddfreyne ddfreyne closed this in #1127 Mar 19, 2017

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Mar 19, 2017

Member

Fixing this also closed the last known open issue in Nanoc!

Member

ddfreyne commented Mar 19, 2017

Fixing this also closed the last known open issue in Nanoc!

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