[Scons-users] interrupted or failed build action handling

Mats Wichmann mats at wichmann.us
Wed Apr 29 11:10:34 EDT 2020


On 4/29/20 6:19 AM, daggs wrote:
> Greetings,
> 
> I have a scons build script that I want to adjust with pre start and pre end actions, as I see it, it is quite simple, e.g.
> adding new target named prep and set it as dep of the first target I have today.
> the same goes for the end part, e.g. add a new target named end and set the current last target as it's dep.
> but here is my problem, I need to run target end no matter how the script ends, e.g. even if I get compilation failure, target failure or even user interruption I need target end to be executed.
> 
> I've seen this: https://scons.org/doc/2.0.1/HTML/scons-user/x2045.html which I think can help me with compilation or target failure but I'm not sure it will with user interruption.
> I know I can use the python signal handling but I'm not sure how scons will behave.
> 
> is there a standard way in scons to act on user interruptions? if no, will using python signal has any bad affect on scons's behavior?

Does this help?

https://scons.org/doc/3.1.2/HTML/scons-man.html#f-GetBuildFailures

an atexit function should be able to catch user interruptions as well.




More information about the Scons-users mailing list