fmt/v1: correctly infer result from assembler

If a pipeline has an assembler and that assembler failed, the
overall status of the build also needs to be marked as failed.
This used to be the case, but a bug got introduced when the
format abstraction code was added.
This commit is contained in:
Christian Kellner 2021-03-09 16:27:57 +00:00 committed by Tom Gundersen
parent 72ffa50c45
commit dfd7ff2500

View file

@ -216,18 +216,23 @@ def output(manifest: Manifest, res: Dict) -> Dict:
stages = current.get("stages")
if stages:
retval["stages"] = stages
assembler = current.get("assembler")
if assembler:
retval["assembler"] = assembler
return retval
result = result_for_pipeline(manifest["tree"])
assembler = manifest.get("assembler")
if assembler:
current = res.get(assembler.id)
if current:
result["assembler"] = current["stages"][0]
if not assembler:
return result
current = res.get(assembler.id)
# if there was an error before getting to the assembler
# pipeline, there might not be a result present
if not current:
return result
result["assembler"] = current["stages"][0]
if not result["assembler"]["success"]:
result["success"] = False
return result