summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-04-02 12:00:47 +0300
committerLars Wirzenius <liw@liw.fi>2022-04-10 15:27:08 +0300
commit4de2f265070089b59f4151e8ebba5fa463002ed5 (patch)
tree7380aa63847865cfb99578293d873da20b1e5eaf
parent94d337a1592431b64e41e9938fdf020163bb9b67 (diff)
downloadsubplot-4de2f265070089b59f4151e8ebba5fa463002ed5.tar.gz
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
-rwxr-xr-xcheck7
1 files 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", {})