scons experts -
Scons thinks that this failing command succeeds, and running scons another time indicates all targets are up-to-date. The fribbleblat
command doesn't exist. This behavior occurs when a 'middle' command in a pipeline fails, but not when the last command in the pipeline fails.
How can I propagate errors in piped commands to scons?
import os
from SCons.Script import Environment
env = Environment()
env.Command(source='foo',
target='bar',
action='cat $SOURCE | fribbleblat | cat >$TARGET')
Running it twice demonstrates that scons thinks it has built the target correctly.
[edit: I created a file 'foo' with random content, echo dslkfjds >foo
]
$ scons -f SConstruct.exp
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
cat foo | fribbleblat | cat > bar
sh: 1: fribbleblat: not found
cat: write error: Broken pipe
scons: done building targets.
$ scons -f SConstruct.exp
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: `.' is up to date.
scons: done building targets.
$ scons --version
SCons by Steven Knight et al.:
script: v2.3.0.rel_2.3.0:2870:c8dbbaa4598e, 2013/07/31 13:02:49, by bdbaddog on Williams-MacBook
engine: v2.3.0, 2013/03/03 09:48:35, by garyo on reepicheep
engine path: ['/usr/lib/scons/SCons']
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation