[Scons-users] Handling of dependencies using Scanner()

Henry Gomersall heng at cantab.net
Fri Oct 11 09:23:40 EDT 2013


On 10/10/13 10:19, Henry Gomersall wrote:

> I've built a tool for handling Jinja templates. As part of this, I've

> made a Scanner that inspects the jinja templates and extracts the

> files that it depends upon (it acquires with include or extends).

>

> I've added the Scanner to the environment, and with suitable print

> statements I can observe the scanner in operation, and note that it is

> successfully extracting all the filenames (from which the node list is

> created and returned).

>

> The question is this: Once the nodes on which the current node depends

> are extracted and returned by the scanner function, I would expect

> those nodes to be part of the dependency tree - that is, modifications

> to those nodes would trigger a rebuild of the dependent file. This

> does not seem to be happening with me.

>

> I can only assume that there is an additional step to make the nodes

> part of the dependency tree. To be clear, I don't need to explicitly

> build those nodes that are returned from the scanner function, just

> that modifications to those nodes causes a rebuild.


I've manged to fix this by recursing through all the nodes that I
previously just returned, scanning them as well and building a bigger
list. See: https://gist.github.com/hgomersall/6915968

I assumed that the scanner would automatically handle a new node that
was added to the dependency tree if the suffix agreed with what the
scanner already had - apparently not. Can someone confirm this?

Cheers,

Henry


More information about the Scons-users mailing list