[Scons-users] Is there something like a try-finally surrounding for multiple actions in scons?

Dirk Bächle tshortik at gmx.de
Mon Nov 18 14:10:55 EST 2013


Hi Andreas,

On 15.11.2013 09:42, andreas.ames at de.transport.bombardier.com wrote:

> Hi Dirk,

>

> thanks for your information.

>

> I'm using pseudo builders quite regularly but I don't understand how I can

> solve my problem. I guess that my description of the problem was unclear.


no, you're right. My idea was rubbish and doesn't apply. I thought you
could process your actions one by one in the pseudo-Builder, while doing
the setup and teardown for the first and last item in the list,
respectively.
But this is not necessarily the same order in which the Actions get
built later on. :(

Here's my next idea: Can you setup your fixture at the start of the
SConstruct, and then register an atexit handler where you do the
teardown of your SQL framework? In between you'd simply run the single
Builder calls, assuming that everything is properly set up. For an
example of the atexit handler, check the UserGuide at "9.4. Printing
Detailed Build Status: the GetBuildFailures Function":

http://www.scons.org/doc/production/HTML/scons-user/x2061.html



> In the meantime I found the batch_key parameter in the constructor of

> build actions. AFAIU it could help solving my issue. Rebuilding only

> necessary out-dated targets seems to be supported by the CHANGED_SOURCES

> entry of the construction environment and build those targets in a loop

> with the preparation and the tear-down processes executed before and after

> that loop.

>

> I will try that.

>


Another user has experimented with this some while ago:


http://four.pairlist.net/pipermail/scons-users/2013-October/001893.html

Check the whole thread and all its comments, this functionality might
not be in a "ready-for-production" state.

Best regards,

Dirk



More information about the Scons-users mailing list