[Scons-users] Surprising behavior with pipes

Tom Tanner trtanner at btinternet.com
Sun Oct 1 13:44:57 EDT 2017


On 20/09/2017 15:39, Andrew C. Morrow wrote:
>
> I noticed to my surprise recently that an Action that uses a pipeline 
> doesn't fail if one of the subcommands fails:
>
> https://github.com/mongodb/mongo/blob/master/site_scons/site_tools/abilink.py#L66
>
> I had a buggy version of abidw installed, and when it crashed with an 
> assertion, the SCons build did not terminate with an error. Instead 
> the partial output up to the crash was consumed by md5 and used as the 
> result.
>
> Is there a way to ask SCons to enforce pipefail?
>
> Or should I be approaching this in a different way and not attempting 
> to use pipelines in Actions?
>
> Thanks,
> Andrew
>
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users

That rule does two of the worst things you could possibly do


1 - it uses a pipe

2 - it uses output redirection to a file.


It's sort of a pity scons fires things off to a shell to execute, as 
both of the above can lead to unexpected failures and totally stuff your 
build / cache


Firstly, if something in a pipeline fails, there's a good chance the 
failure will just be eaten

Secondly, if your output redirection goes astray - well, no runtime 
system I've come across checks the error return when closing STDOUT. And 
yes, I have had had to recover the mess when disk space ran out, and the 
build was considered successful.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20171001/e6424805/attachment-0001.html>


More information about the Scons-users mailing list