[Scons-users] solving dependency cycle

Philipp Kraus philipp.kraus at flashpixx.de
Sat Aug 18 11:11:28 EDT 2012


On 2012-08-17 19:06:12 +0200, Chris BeHanna said:


> On Aug 17, 2012, at 06:04 , Philipp Kraus <philipp.kraus at flashpixx.de> wrote:

>

>> On 2012-08-17 12:48:09 +0200, TOM TANNER (BLOOMBERG/ LONDON) said:

>>

>>> Thats not a dependency cycle per se. Please could you give us the full

>>> error message, as that shows you what the cycle is between.

>>> Also, how do you build x?

>>

>> [...snip...]

>>

>> I have create a builder for downloading source.tar.gz (in short)

>> dw=env.Download(target.tar.gz, http://....)

>> extract = env.Command(dw, "extractdir", "tar ... $SOURCE")

>>

>> and than I build with sources within the extract target a shared library like

>>

>> env.SharedLibrary( ..., sources=[ os.join.path(str(extract),

>> source1.cpp, str(extract), source2.cpp) ]

>>

>> This does not work, because scons reports that the sources are not

>> exists, imho I need a dependency between the

>> source file and the "extract-target", which I have set with Depends and

>> this creates the dependency cycle error.

>>

>> The parts for download and extracting works well and create a correct graph:

>> +-library/jsoncpp-src-0.5.0 //1

>> +-library/jsoncpp-src-0.5.0.tar.gz

>> | +-http://sourceforge.net/projects/jsoncpp/files/latest/download

>> +-/usr/bin/tar

>>

>> The parts for building the shared library works also well (if the

>> sources exists). So I need the connection

>> between //1 and the env.SharedLibrary call

>

> I think Tom had it right. When you build a tarball extractor, your

> emitter MUST filter out all directory objects, returning only files, or

> else you end up with phony dependencies from the extracted directories.

>

> I have one that works, but I do not (yet) have permission to contribute it.


Isn't this a chicken-egg-problem !?
Because in my case I have got a source like a URL, the target is the
downloaded file. First the emitter runs over the url
and see there is a file target but the emitter of the "untar builder"
can not analyse the file, because it does not exists.

IMHO the emitter builds the full graph and the builder runs over the
nodes and creates them (physical nodes).
So I can't analyse the tar.gz without downloading and extracting!?

Hope I understand the working structure of scons correct

Phil




More information about the Scons-users mailing list