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

arndt.pauschardt at web.de arndt.pauschardt at web.de
Mon Feb 17 14:46:39 EST 2020


Hi, Bill

No, not really. 

It’s a commercial tool which puts all of its result data into a user-specified directory. I could probably re-engineer all those files or ask the vendor, but I’m not really keen on doing this. It’s a moving target …

In the end, the situation is the same as with “doxygen”. Doxygen produces tons of stuff into a directory and letting SCons track all those files is not really worth it, at least not to me. I looked into the existing Doxygen builders in the Wiki, at github, etc. and the ones I looked at solve this the env.Clean() way. 

So, if it’s “not common usage”, I would assume that env.Clean() is the recommended way of handling this.

To me, a tool which produces both a target file (e.g. a summary log file) and target dir (with content) may be not the standard behaviour of tools, but also not that special. Out of curiosity, why did you guys decide NOT to clean Dir() targets with “-c”? Does it have to do with the SCons Principles (Correctness, Performance, ..)?

 

Thx

Arndt

 

Von: Scons-users <scons-users-bounces at scons.org> Im Auftrag von Bill Deegan
Gesendet: Montag, 17. Februar 2020 17:25
An: SCons users mailing list <scons-users at scons.org>
Betreff: Re: [Scons-users] behaviour of '-c' if targets include a directory being built/filled

 

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 <mailto: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 <mailto: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/533e3a11/attachment-0001.html>


More information about the Scons-users mailing list