[Scons-dev] Checking a target has been built

Tom Tanner (BLOOMBERG/ LONDON) ttanner2 at bloomberg.net
Fri Aug 23 03:58:13 EDT 2013


I have a 'Value' node as a source in my build, I'm not sure how you could use one as a target, and plenty of Alias nodes. They should work because self.exists() returns True (well, it returns 1 for some reason) by default, and then is overridden for a File node.

The one thing this isn't working for is completely fake targets where you intentionally do something like

env.Command('not a real target', 'something', 'echo boo')

where nothing is generated. I'm not sure how to deal with that as it is a real Phony target. I have a few AlwaysBuild targets but they actually do generate something.

I suspect that a env.Phony(node) is needed which sets a 'phony' attribute in the node, purely for the purpose of inverting the sense of this check (i.e. if it's a Phony target, you *shouldn't* be generating the file).

----- Original Message -----
From: garyo at oberbrunner.com
To: Tom Tanner (BLOOMBERG/ LONDON), scons-dev at scons.org
At: Aug 22 2013 18:07:08

Some people use fake targets which would confuse this I think. Also what
about non-File nodes? (Aliases, Values) Not sure, just something to check.


On Thu, Aug 22, 2013 at 7:04 AM, Tom Tanner (BLOOMBERG/ LONDON) <
ttanner2 at bloomberg.net> wrote:


> There was a discussion about this a while ago, and I got round to looking

> at it. I seem to have found a trivial solution, but it's so trivial I'm

> extremely worried by it.

>

> in Node/__init__.py:

> Add the following to built(self) after the self.clean() call

>

> if not self.exists():

> print "Warning: Cannot find target after building", self

>

> Am I missing something?

> (Clearly I'd like it to be an error but a warning to start off with would

> be safer...)

>

> _______________________________________________

> Scons-dev mailing list

> Scons-dev at scons.org

> http://two.pairlist.net/mailman/listinfo/scons-dev

>

>



--
Gary




More information about the Scons-dev mailing list