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

andreas.ames at de.transport.bombardier.com andreas.ames at de.transport.bombardier.com
Thu Nov 14 06:42:46 EST 2013


Hi all,

I have a local Builder defined as follows:

sql_gen = SCons.Script.Builder(action = _primos_sql_gen
, emitter = _primos_sql_gen_emitter
, source_scanner = PrimosSqlGenScanner
, src_suffix = '.sql'
, suffix = '.c'
, single_source = 1)

Please note, that it is a single-source builder. I call it with a long
list of sources (like 60 input files). The action is a python function
and I like that the builds of the individual targets are nicely seperated
from each other.

However the performance of this approach is somewhat lacking as the the
function _primos_sql_gen has to call an expensive preparation process and
an equally expensive tear-down process in a try-finally environment.

Thus I'm wondering if there is any mechanism avaiable in scons that allows
me to:

1. Make sure that scons builds all out-of-date targets defined by a single
call to the Builder (with multiple sources) in sequence without scheduling
other build actions from different builders in between this sequence.
(This is necessary as the preperation step has side-effects that might
influence other build actions.) (NB: A more flexible approach would be to
provide a way to define such a non-premptable sequence as a list of
targets whose build actions must always be executed in sequence.)

2. Specify one preparation and one tear-down process around that sequence.
It would be good if there was a way to run the tear-down step regardless
of the way the action sequence is ended (i.e. even in the face of
exceptions). (NB: This could be specified as hooks, i.e. python function
callbacks, for the sequence mentioned above.)

Such a mechanism would allow me to speed-up my build considerably while
preseving the nice modularisation and self-containedness of my current
approach.

Please note, that it would not be necessary in my case to require
transactional semantics from such a mechanism.


Thanks in advance,

aa


Please consider the environment before you print / Merci de penser à
l'environnement avant d'imprimer / Bitte denken Sie an die Umwelt bevor
Sie drucken

Bombardier Transportation GmbH
Vorsitzender des Aufsichtsrats / Chairman of Supervisory Board: Prof. Dr.
Wilhelm Bender
Geschäftsführung / Executive Board: Michael Clausecker
(Vorsitzender/Chairman), Dr. Susanne Kortendick, David Barry, Matthias
Keller
Sitz der Gesellschaft / Principal Office: Berlin
Registergericht / Registration Court: Amtsgericht Charlottenburg, HRB
64838

_______________________________________________________________________________________________________________

This e-mail communication (and any attachment/s) may contain confidential
or privileged information and is intended only for the individual(s) or
entity named above and to others who have been specifically authorized to
receive it. If you are not the intended recipient, please do not read,
copy, use or disclose the contents of this communication to others. Please
notify the sender that you have received this e-mail in error by reply
e-mail, and delete the e-mail subsequently. Please note that in order to
protect the security of our information systems an AntiSPAM solution is in
use and will browse through incoming emails.
Thank you.
_________________________________________________________________________________________________________________


Ce message (ainsi que le(s) fichier(s)), transmis par courriel, peut
contenir des renseignements confidentiels ou protégés et est destiné à
l?usage exclusif du destinataire ci-dessus. Toute autre personne est, par
les présentes, avisée qu?il est strictement interdit de le diffuser, le
distribuer ou le reproduire. Si vous l?avez reçu par inadvertance,
veuillez nous en aviser et détruire ce message. Veuillez prendre note
qu'une solution antipollupostage (AntiSPAM) est utilisée afin d'assurer la
sécurité de nos systèmes d'information et qu'elle furètera les courriels
entrants.
Merci.
_________________________________________________________________________________________________________________


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20131114/5656ea8b/attachment.html


More information about the Scons-users mailing list