mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 19:02:52 +02:00
Print more output from snapcraft remote-build (#8321)
* Print more output from snapcraft remote-build. * Include the build target in the output.
This commit is contained in:
@@ -52,27 +52,25 @@ def _build_snap(target, archs, status, lock):
|
|||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
with lock:
|
with lock:
|
||||||
|
dump_output = exit_code != 0
|
||||||
failed_archs = [arch for arch in archs if status[target][arch] == 'Failed to build']
|
failed_archs = [arch for arch in archs if status[target][arch] == 'Failed to build']
|
||||||
if exit_code == 0 and not failed_archs:
|
if exit_code == 0 and not failed_archs:
|
||||||
# We expect to have all target snaps available, or something bad happened.
|
# We expect to have all target snaps available, or something bad happened.
|
||||||
snaps_list = glob.glob(join(workspace, '*.snap'))
|
snaps_list = glob.glob(join(workspace, '*.snap'))
|
||||||
if not len(snaps_list) == len(archs):
|
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(f'Some of the expected snaps for a successful build are missing (current list: {snaps_list}).')
|
||||||
print('Dumping snapcraft remote-build output build:')
|
dump_output = True
|
||||||
print('\n'.join(process_output))
|
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
if failed_archs:
|
if failed_archs:
|
||||||
# We expect each failed build to have a log file, or something bad happened.
|
# We expect each failed build to have a log file, or something bad happened.
|
||||||
missing_outputs = False
|
|
||||||
for arch in failed_archs:
|
for arch in failed_archs:
|
||||||
if not exists(join(workspace, f'{target}_{arch}.txt')):
|
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}.')
|
print(f'Missing output on a failed build {target} for {arch}.')
|
||||||
if missing_outputs:
|
if dump_output:
|
||||||
print('Dumping snapcraft remote-build output build:')
|
print(f'Dumping snapcraft remote-build output build for {target}:')
|
||||||
print('\n'.join(process_output))
|
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 the remote build if it has been interrupted (non zero status code) or if some builds have failed.
|
||||||
retry = retry - 1
|
retry = retry - 1
|
||||||
|
|||||||
Reference in New Issue
Block a user