[Scons-users] behaviour of '-c' if targets include a directory being built/filled

Bill Deegan bill at baddogconsulting.com
Mon Feb 17 11:25:04 EST 2020


Arndt,

Can you inform SCons about the files to be produced in the directory?
A mixture of files and directories as the target of a builder is not common
usage.

-Bill

On Mon, Feb 17, 2020 at 8:11 AM Arndt Pauschardt <arndt.pauschardt at web.de>
wrote:

> Dear SCons community
>
> I have an emitter which adds a Dir node to the list of targets, like this:
> def emit_sometools_out_dir(target, source, env):
>   """ target[0] is a file (node) which acts as the log file.
>   We add a dir (node) which holds all the other data produced by SOMETOOL
>   """
>   result_dir_str, _ = os.path.splitext(os.path.basename(str(target[0])))
>   result_dir = target[0].Dir(result_dir_str)
>   return target + [result_dir], source
>
> The corresponding builder works fine in the sense that both 'targets' are
> produced - a log file "target[0]" and directory "target[1}" with all the
> other data produced by the tool.
>
> If I run "-c" on the target of such builder, only the target log file is
> removed, the Dir (and its contents) are kept.
> I would have expected that also the Dir (and its content) is removed on
> '-c'.
> In order to have also the Dir (and its content) removed, I need to add a
> Clean() for the Dir (that is, target[1] as returned by the emitter)
>
> Is this behaviour intended?
> I can't find an explicit statement in the manual that says "-c is removing
> both files and dirs", but reading through it seems to suggest that it does
> remove files and dirs.
>
> Thx
> Arndt
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20200217/a53ab9f4/attachment.html>


More information about the Scons-users mailing list