Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Optimise recording deps on new items #1028
When an item is added, Nanoc generates a dependency of all items onto this new item. This is done because Nanoc can‘t accurately infer whether a newly added item will cause an existing item to need recompilation. This approach is crude and definitely something I’d like to improve, but at the same time it is also correct, which for me is the most important bit.
Unfortunately, radically changing the directory structure of a site means that dependency generation blows up. While Nanoc is apparently doing nothing (right after Compiling…), it is generating all these dependencies, which takes minutes. On top of that, all these artificially new dependencies make memory usage increase up to the point where my laptop cannot handle it anymore.
This fix: Mark new items as “new”, and when looking up all objects that can cause the outdatedness of a given item, return a single new item (because that’s enough to trigger outdatedness). Do not generate any artificial dependencies.
A longer-term solution would be to introduce a mechanism for determining more reliably whether or not the addition of an item might cause an given item to become outdated.