IMHO it's more intuitive if env.depends("my-target", "invalid-dep")
causes the build to fail when "invalid-dep" does not exist, rather
than having no effect (i.e. the build still succeeds with no warning).
This will make it more obvious, earlier, if you made a mistake in
an env.depends() call. Otherwise the mistake could sit latent for
a while until you happen to notice that a build used a out-of-date
copy of some file rather than rebuilding it.
I've only added the check for user dependencies, not for direct
sources. Listing a source file that doesn't exist will probably
cause the builder to fail anyway, so I don't think the preliminary
check is needed in that case.
It's common for a build command to contain a reference like:
${INCPREFIX}${CPPPATH}
Where ${INCPREFIX} is "-I" and ${CPPPATH} is an array of include
paths. Without this change, Rscons expands ${INCPREFIX} (and then
tries to expand "-I") repeatedly, once for each path.
This change simply makes Rscons intelligent enough to expand
${INCPREFIX} only once, then join the expanded value to each path.
In a mid-sized rake project, ruby-prof shows that the number of
calls to expand_varref is reduced from ~80,000 to ~30,000., and the
total CPU time spent in expand_varref is reduced by about 30%.
In a larger project, the improvement in real build time is small
but consistent enough to be measurable (~0.5 seconds off a total
of ~20 seconds).