setup: treat error output and non-zero return code differently
Choking on Mercurial's stderr mean armless warning can derails the whole install
process. We do like to be able to issue warning to people so we stop considering
any stderr is a fatal mistake.
This allow us to actually boostrap a version of Mercurial without loosing to
many sanity point. For example in case where evolve is not loaded, something
that happens when the recorded version is malformatted. Creating a wonderful
ouroboros.
--- a/setup.py Mon Jan 30 18:41:59 2023 +0100
+++ b/setup.py Mon Jan 30 18:50:11 2023 +0100
@@ -221,9 +221,10 @@
cmd = self.cmd + args
returncode, out, err = runcmd(cmd, self.env)
err = filterhgerr(err)
- if err or returncode != 0:
+ if err:
print("stderr from '%s':" % (' '.join(cmd)), file=sys.stderr)
print(err, file=sys.stderr)
+ if returncode != 0:
return b''
return out