[PATCH] setup: print subprocess stderr if there is any

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sat Nov 10 00:43:03 UTC 2012


On 10 nov. 2012, at 01:06, Bryan O'Sullivan wrote:

> # HG changeset patch
> # User Bryan O'Sullivan <bryano at fb.com>
> # Date 1352505972 28800
> # Node ID 123560a9b0f5b45858feb54d95ee5d6da5730783
> # Parent  fb14a5dcdc62987512820531fe60719d650491b6
> setup: print subprocess stderr if there is any
> 
> I just spent 1.5 days trying to debug a failing buildbot because
> setup.py was silently dropping the errors that were being printed
> by in-place hg.
> 
> diff --git a/setup.py b/setup.py
> --- a/setup.py
> +++ b/setup.py
> @@ -151,6 +151,8 @@ def runhg(cmd, env):
>            if not e.startswith(b('Not trusting file')) \
>               and not e.startswith(b('warning: Not importing'))]
>     if err:
> +        print >> sys.stderr, 'stderr from %r:' % (' '.join(cmd))
> +        print >> sys.stderr, '\n'.join(['  ' + e for e in err])
>         return ''
>     return out

Looks very sane to me. Extra legit print could still be added to the exclusion list.

-- 
Pierre-Yves


More information about the Mercurial-devel mailing list