[Scons-users] solving dependency cycle

Chris BeHanna chris at behanna.org
Fri Aug 17 13:06:12 EDT 2012


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.

--
Chris BeHanna
chris at behanna.org


More information about the Scons-users mailing list