[Scons-users] What to do when scanner is invoked for non-existing file?
Dirk Bächle
tshortik at gmx.de
Fri Feb 28 17:37:40 EST 2014
Hi Ilya,
On 28.02.2014 23:18, Ilya wrote:
> Hello,
>
> SCons manual in "Scanner Objects" section says the following:
>
>> Note that the file is not guaranteed to exist before the scanner is
>> called, so the scanner function should check that if there's any
>> chance that the scanned file might not exist (for example, if it's
>> built from other files).
>
> I have two questions about this:
> 1. What to do if such condition is detected? Is returning an empty list
> sufficient?
yes, this is the best you can do in such a situation.
> 2. Is scanner supposed to be called again once file is created?
>
Yes, during the build phase, files can get scanned several times. In
fact, whenever source files get created by a builder, all internally
cached info about implicit dependencies gets reset (for any remaining
nodes!). As soon as one of these File nodes is visited again by the
Taskmaster, it should get rescanned.
Best regards,
Dirk
More information about the Scons-users
mailing list