[Scons-users] emitter create dependency cycle

Arvid Rosén arvid at softube.com
Tue Sep 3 15:32:05 EDT 2013


Yeah, this is tricky, and I would like to know how to handle stuff like this too in a good way!

I have been facing similar problems on Mac OS when trying to write builders that operate on a bundle (which is a directory with a bunch of files).

Wouldn't it be good to have a Node object that represents a directory as a single entity? That way you could write a builder that operates on the directory using a single action, and no need to have emitters to track all files in it. This would make it easy to copy and sign bundles etc. All these things tend to be difficult using Dir and File nodes.

Best Regards,
Arvid


3 sep 2013 kl. 20:29 skrev Philipp Kraus <philipp.kraus at flashpixx.de>:


> On 2013-09-03 11:48:13 +0000, Philipp Kraus said:

>

>> Hi,

>> I have written a builder with an emitter. Input is a SCons.Node.FS.Dir object and out SCons.Node.FS.File objects, but the input directory exists, so only files will be append to the directory.

>> The emitter creates the file list and returns only the files (the directories are removed first). In this step I get a dependency cycle between the input source dir and the returning target files.

>> If I replace in the emitter the source with a pseudo name, everything works fine, but I can not work with a dir object.

>> The emitter shows something like this

>> def __emitter(target, source, env) :

>> // do something with source and create target list

>> return target, source

>> This creates the cycle, on changing to

>> return target, str(source[0])+"#pseudo"

>> the cycle does not exists anymore, but the source object is not a Dir object in my builder call, so I need to remove the "#pseudo" string, but in this case I can not create a new Dir object,

>> eg SCons.Node.FS.Dir( str(source[0]).replace("#pseudo", "") ) does not work.

>> I need a solution to rename the single source object and transfer it to the builder call and use it in the builder than a Dir object

>

> eg my source directory is librarydir/ and the emitter should return librarydir/file1, librarydir/file2, library/file3, so I get the cycle between source and target

>

> Phil

>

>

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users




More information about the Scons-users mailing list