[Scons-users] Builder execution order?
Dirk Bächle
tshortik at gmx.de
Sat Jan 18 17:37:39 EST 2014
Hi,
On 18.01.2014 20:53, delbert dev wrote:
> URLDOWNLOAD_USEURLFILENAME=False makes it possible to override that it
> should NOT use the filename from the url.
>
> I tried this:
>
> pkg = env.URLDownload(gtestOutputFile, gtestUrl)
> dir = env.Unpack( ouutdir, gtestOutputFile )
> Depends(dir, pkg)
> a = env.Alias('abc', pkg)
> b = env.Alias('xyz', dir)
>
> scons: *** source file [gtest-1.7.0.zip] must be exist Stop.
>
this error message is not directly related to SCons dependency analysis,
that's why explicitly specifying dependencies with Depends() doesn't help.
The underlying problem is that the Unpack() Tool tries to read the
archive 'gtestOutputFile', such that it can detect which files are
contained in the archive and therefore have to get emitted as targets of
the whole Unpack() operation.
But in your case the gtestOutputFile doesn't exist yet, since it hasn't
been downloaded yet.
That's why you need to kickstart the whole thing by using the UNPACKLIST
variable, as is described on the page
http://www.scons.org/wiki/DownloadUnpack :
<quote>
The emitter __emitter must read the archive data, so it must create a
file- and/or dictory list of the content, so for each extractor must be
set a list command and an optional splitting function. The Unpack
builder should be used in combination with the Download builder. In this
process the emitter can create a problem, because the emitter of the
Download builder does not create a correct archive, which can be read by
the emitter of the Unpack builder, so there must be an "injection hack"
with "user knowledge". The user knows which files are needed by the
build process, so the Unpack builder has got a flag UNPACKLIST, which
can be used for injection the emitter, so the filelist can be pushed
into the emitter and is returned during the build process. With this
injection the Download- and Unpack builder can connect in order, so the
full build process works correct. The emitter reads equal to the builder
the extractor commands, if an unpacklist is set, the emitter returns
this list, if not the emitter uses the list command of the toolkit and
runs the command in a subprocess, get its output and push the output
line-by-line to the splitting function, uniquifies the resulted file- &
directorylist and returns the list.
</quote>
>
>
> and it gives the same result.
>
> It appears to me that scons is not designed to design/implement a
> buildflow (like ant, maven, gradle etc.) but are specialized to simply
> compiling/building a single cross platform cpp/c binary.
>
> Maybe its time to give this a try:
> http://www.gradleware.com/news/blog/creating-world-class-cc-build-system-gradle
> http://www.gradle.org/docs/current/userguide/userguide_single.html#native_binaries:languages
> http://www.gradle.org/docs/current/userguide/userguide_single.html#nativeBinaries
>
I hope the above convinces you that this step isn't really necessary.
Best regards,
Dirk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140118/26b2a313/attachment-0001.html
More information about the Scons-users
mailing list