[Scons-users] Dealing with headers appearing from Command builders

Dirk Bächle tshortik at gmx.de
Wed Apr 8 13:36:39 EDT 2015


Hi Matthias,

On 08.04.2015 15:33, Bill Deegan wrote:
> Split your building in to two:
> 1) downloads the package and puts in the correct dir in your tree
> 2) takes the downloaded package and builds it.  (at this point the emitter or perhaps a scanner can determine the output files).
>

I'd like to second this...it's better to not mix "package managing" with "build dependency tracking".

> [...]
>
>     But as I see it my problem is - even if using an Emitter - that I need
>     to know in advance what headers at what locations will result from
>     third-party package builds.
>

You always have to provide this kind of information, if you want your dependencies being tracked correctly under all possible 
circumstances (parallel builds, variant dir builds, first build from scratch,...).

>     For example, many third party packages use autotools as a build system.
>     So my current Command builder fetches some version of the package
>     archive, extracts it, calls configure, make and make install and only
>     then I really know what the resulting output is.
>
>     The input file, like some "package.tar.gz" results in a directory
>     containing a bunch of headers and libraries etc. The process
>     from input to output is pretty much opaque to me until the whole thing
>     is finished.
>

If your "package.tar.gz" changes from one build to the next and it suddenly contains an additional header file that gets included in 
your build (implicit dependency), how is SCons supposed to know that it has to unpack the archive first? Note that all Nodes 
(=Files/Dirs/Values) are equal regarding processing order by the TaskManager, so your choices are:

- fixing the dependency tree by providing full info about the Build step to SCons (as suggested via a custom Emitter), or
- running the download/unpacking of the archive every time (just to be sure).

In the latter case you don't need a fully-fledged build system, based on content change detection...a simple script (wrapper) will do.

>     Knowing this only after the target is built doesn't really help me in
>     the context of an Emitter or am I missing something?

Correct, that's why you'd have to parse the output of "tar tvf" or similar to get a list of filenames in advance.

Best regards,

Dirk



More information about the Scons-users mailing list