From 57fea1bf748fb6008970600264a6597641fdb68f Mon Sep 17 00:00:00 2001 From: Dexter Chua Date: Thu, 31 Dec 2020 20:19:41 +0800 Subject: [PATCH] BLD Make package build output less verbose (#947) --- pyodide_build/buildall.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pyodide_build/buildall.py b/pyodide_build/buildall.py index 4612fe7fc..886152ce5 100755 --- a/pyodide_build/buildall.py +++ b/pyodide_build/buildall.py @@ -72,10 +72,15 @@ class Package: stderr=subprocess.STDOUT, ) - with open(self.pkgdir / "build.log", "r") as f: - shutil.copyfileobj(f, sys.stdout) + try: + p.check_returncode() + except subprocess.CalledProcessError: + print(f"Error building {self.name}. Printing build logs.") - p.check_returncode() + with open(self.pkgdir / "build.log", "r") as f: + shutil.copyfileobj(f, sys.stdout) + + raise if not self.library: shutil.copyfile(