From b2d3d157e33d7a6f3311f6f458841e6b8af6a08c Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Tue, 10 Nov 2020 17:25:43 -0800 Subject: [PATCH] Make generate_projects.sh fail earlier on job errors --- tools/buildgen/generate_projects.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/buildgen/generate_projects.py b/tools/buildgen/generate_projects.py index d86cfcdf74f..841abbdc07e 100755 --- a/tools/buildgen/generate_projects.py +++ b/tools/buildgen/generate_projects.py @@ -89,8 +89,18 @@ for template in reversed(sorted(templates)): cmd.append(args.base + '/' + root + '/' + f) jobs.append(jobset.JobSpec(cmd, shortname=out, timeout_seconds=None)) -jobset.run(pre_jobs, maxjobs=args.jobs) -jobset.run(jobs, maxjobs=args.jobs) +err_cnt, _ = jobset.run(pre_jobs, maxjobs=args.jobs) +if err_cnt != 0: + print('ERROR: {count} error(s) encountered during preprocessing.'.format( + count=err_cnt), + file=sys.stderr) + sys.exit(1) +err_cnt, _ = jobset.run(jobs, maxjobs=args.jobs) +if err_cnt != 0: + print('ERROR: {count} error(s) found while generating projects.'.format( + count=err_cnt), + file=sys.stderr) + sys.exit(1) if test is not None: for s, g in test.items():