Please note:The SCons wiki is in read-only mode due to ongoing spam/DoS issues. Also, new account creation is currently disabled. We are looking into alternative wiki hosts.
Differences between revisions 2 and 3
Revision 2 as of 2008-02-06 19:12:05
Size: 1266
Editor: little-black-box
Revision 3 as of 2008-03-12 02:46:59
Size: 1266
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

Commands that have lots of input and output nodes can be very taxing on scons. For example:

in = [...] # lots of nodes
out = [...] # lots of nodes

act = 'somecommand $SOURCES'

env.Command(out, in, act)

scons processes this as if each element in out depends on the entire set of in. Depending on how big in and out, you can really slow down the dependency verification process, as it takes time proportional to len(in) * len(out).

You can use a trick to make things better, but you need md5sum

in = [...] # lots of nodes
out = [...] # lots of nodes

act = 'somecommand $MYSOURCES'

mnode = env.Command('sum.md5', in, 'md5sum $SOURCES > $TARGET')

env.Command(out, mnode, act, MYSOURCES = in)

This makes every node in out only depend on mnode, which in turn depends on each node in in. This can reduce the dependency processing significantly, as mnode only has to be verified once, and everything in out essentially recycles that work.

The dependencyes between out and in are preserved. If something in in changes, then the contents of mnode change, because it is generated using md5sum, and thus out nodes will get rebuilt.

ProxyDependencies (last edited 2008-03-12 02:46:59 by localhost)