[Scons-users] Surprising behavior with pipes

Andrew C. Morrow andrew.c.morrow at gmail.com
Sun Oct 1 11:46:15 EDT 2017

That does assume that SHELL is set to bash though, right? I'd be OK
limiting it to POSIX, but going so far as to mandate one particular shell
implementation feels pretty fragile.

I guess the right solution is to not use pipes, but instead redirect the
output to an intermediate target and then consume that, making a two step

Somewhat unfortunate in my case as I really don't need the intermediate
state and would prefer to avoid the IO cost. Perhaps the intermediate could
be a tempfile of some sort. Basically, re-implement the pipe by hand.

On Wed, Sep 20, 2017 at 12:51 PM, Gary Granger <granger at ucar.edu> wrote:

> When I have had to use pipelines in actions, I have had to set pipefail
> explicitly, eg:
> "set -o pipefail; %s 2>&1 | ${ASAN_FILTER}" % (command)
> On 09/20/2017 08:39 AM, 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?
> >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20171001/585fd4c5/attachment.html>

More information about the Scons-users mailing list