From 6fd37bae3bc491b12d75e581b1c9aeb1d15f9c4e Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Thu, 24 Sep 2020 16:29:33 -0700 Subject: [PATCH] Print more output from snapcraft remote-build. --- tools/snap/build_remote.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tools/snap/build_remote.py b/tools/snap/build_remote.py index 176fff9c8..9af77cf0c 100755 --- a/tools/snap/build_remote.py +++ b/tools/snap/build_remote.py @@ -52,27 +52,25 @@ def _build_snap(target, archs, status, lock): sys.stdout.flush() with lock: + dump_output = exit_code != 0 failed_archs = [arch for arch in archs if status[target][arch] == 'Failed to build'] if exit_code == 0 and not failed_archs: # We expect to have all target snaps available, or something bad happened. snaps_list = glob.glob(join(workspace, '*.snap')) if not len(snaps_list) == len(archs): print(f'Some of the expected snaps for a successful build are missing (current list: {snaps_list}).') - print('Dumping snapcraft remote-build output build:') - print('\n'.join(process_output)) + dump_output = True else: break - if failed_archs: # We expect each failed build to have a log file, or something bad happened. - missing_outputs = False for arch in failed_archs: if not exists(join(workspace, f'{target}_{arch}.txt')): - missing_outputs = True + dump_output = True print(f'Missing output on a failed build {target} for {arch}.') - if missing_outputs: - print('Dumping snapcraft remote-build output build:') - print('\n'.join(process_output)) + if dump_output: + print('Dumping snapcraft remote-build output build:') + print('\n'.join(process_output)) # Retry the remote build if it has been interrupted (non zero status code) or if some builds have failed. retry = retry - 1