From 4de2f265070089b59f4151e8ebba5fa463002ed5 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 2 Apr 2022 12:00:47 +0300 Subject: fix: check capturing stderr of cargo, mixing it with stdout When ./check runs a command, in the runcmd_unchecked method, it collects by default stdout and stderr into on string. The two outputs get mixed. So far, this has been OK, but I'm about to make change where it won't be OK. The get_template method needs to be able to distinguish between stdout and stderr, when I change Subplot to write warnings into stderr. Sponsored-by: author --- check | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/check b/check index 533ac50..9dac5d8 100755 --- a/check +++ b/check @@ -58,8 +58,10 @@ class Runcmd: self.msg(f"RUN: {argv} {kwargs}") if not self._verbose: - kwargs["stdout"] = PIPE - kwargs["stderr"] = STDOUT + if "stdout" not in kwargs: + kwargs["stdout"] = PIPE + if "stderr" not in kwargs: + kwargs["stderr"] = STDOUT assert "key" not in kwargs env = dict(os.environ) @@ -179,6 +181,7 @@ class Runcmd: filename, ], stdout=PIPE, + stderr=PIPE, ).stdout.decode("UTF-8") metadata = json.loads(metadata) impls = metadata.get("impls", {}) -- cgit v1.2.1