From cff6df637ea4d59134f31ecd1011b6a036fbfc33 Mon Sep 17 00:00:00 2001 From: Dongge Liu Date: Wed, 11 Dec 2024 15:48:07 +1100 Subject: [PATCH] Do not print logs when building project image --- experiment/oss_fuzz_checkout.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/experiment/oss_fuzz_checkout.py b/experiment/oss_fuzz_checkout.py index 6fc194a84..c466ca13f 100644 --- a/experiment/oss_fuzz_checkout.py +++ b/experiment/oss_fuzz_checkout.py @@ -465,11 +465,17 @@ def _build_image(project_name: str) -> str: 'python3', 'infra/helper.py', 'build_image', '--pull', project_name ] try: - sp.run(command, cwd=OSS_FUZZ_DIR, env=adjusted_env, check=True) + sp.run(command, + cwd=OSS_FUZZ_DIR, + env=adjusted_env, + stdout=sp.PIPE, + stderr=sp.PIPE, + check=True) logger.info('Successfully build project image for %s', project_name) return f'gcr.io/oss-fuzz/{project_name}' - except sp.CalledProcessError: - logger.info('Failed to build project image for %s', project_name) + except sp.CalledProcessError as e: + logger.error('Failed to build project image for %s: %s', project_name, + e.stderr.decode('utf-8')) return ''