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

nanoc show-data doesn’t show dependencies from @items #1453

Open
da2x opened this issue Aug 25, 2019 · 6 comments
Open

nanoc show-data doesn’t show dependencies from @items #1453

da2x opened this issue Aug 25, 2019 · 6 comments

Comments

@da2x
Copy link
Contributor

da2x commented Aug 25, 2019

Steps to reproduce

  1. Create a layout that pulls in some other items with @items[item_identifier_string] or @items.find_all(some_item_glob).
  2. Use that layout in two or more items.
  3. Run nanoc show-data

Expected behavior

show-data should list all the dependencies for all of the items.

Actual behavior

show-data lists the dependencies for one of the items using that template. The other items are listed as depending on (nothing).

Details

Unsure if this is related or not, but the values given to @items originates from an @item property. E.g. @items.find_all("{#{@item[:array_of_item_identifiers].join(',')}}") or @items[@item[:thumbnail_item_identifier]].

Despite not showing in show-data, the dependency tracking works most of the time. Sometimes need to run compile a second time for an item using such a layout will recompile.

Update 1: The recompilation issue seems to only affect item properties from items with meta files.

Update 2: Recompilation issue separated into separate issue #1454.

@da2x
Copy link
Contributor Author

da2x commented Aug 25, 2019

Update: this is wrong.

More minified way to reproduce:

  1. Follow the steps 1–6 in Binary items’ attributes not outdated when their meta data file is updated #1454
  2. Run nanoc show-data

Should: index.html should depend on test.png. Actual: it doesn’t.

@denisdefreyne
Copy link
Member

For your minified steps to reproduce, the <%= … %> ends up being copied as-is into output/index.html, because there is no filter :erb, and then show-data shows:

item /index.html depends on:
  [ layout ] (r___) /default.html

item /stylesheet.css depends on:
  (nothing)

item /test.png depends on:
  (nothing)

If I add filter :erb to Rules (matching index.html), and re-run show-data, I get

item /index.html depends on:
  [  items ] (r___) matching any of /test.png
  [   item ] (_a__) /test.png
  [ layout ] (r___) /default.html

item /stylesheet.css depends on:
  (nothing)

item /test.png depends on:
  (nothing)

which shows that /item.html does depend on /test.png.

@denisdefreyne
Copy link
Member

I’m not able to reproduce it in a different way. Can you double-check the steps to reproduce?

@da2x
Copy link
Contributor Author

da2x commented Dec 6, 2019

I just ran nanoc show-data on a larger project and the same thing happen again. Changed nothing and ran it again and it didn’t happen. I just don’t know what causes it to happen and when.

@denisdefreyne
Copy link
Member

It could be that #1493 is a fix for this — it’s definitely a related issue, but I’ve not been able to reproduce yours specifically.

Can you see whether Nanoc master works for you?

@da2x
Copy link
Contributor Author

da2x commented Mar 16, 2020

This is extremely elusive. I just saw this in a build with #1493. I can’t reproduce it on demand but it keeps happening from time to time.

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