Exit Status for Build Steps

A step's result should indicate failure reliably enough that downstream stages do not publish output from a failed upstream operation.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace a report pipeline
  2. Test interruption
  3. Follow each command's outcome through a pipeline
  4. Test what downstream steps are allowed to consume

Trace a report pipeline

A generator can emit a header and then fail while reading rows. A compressor can still produce an artifact from that partial stream. Exit status and output explains why artifact existence is a separate observation.

Test interruption

Simulate a failure midway and verify that no partial replacement becomes the published output. Replacing files after a complete write gives one way to control the publication boundary.[1]

Follow each command's outcome through a pipeline

A compiler can fail while a downstream log formatter exits successfully after reading a partial stream. Depending on shell and options, the aggregate pipeline status can hide that earlier failure. Inspect each needed operation or configure the shell to propagate the required failures. See standard output and error.

Compiler → exits with error
Log formatter → exits successfully
Build result should reflect missing or invalid artifact
Test the specified shell's pipeline status

Test what downstream steps are allowed to consume

An empty or stale output may still be present at an expected path. A release task should depend on both successful execution and validated artifact identity. Include a synthetic failure in the first component of the pipeline.

References

  1. Free Software Foundation, GNU Make Manual ↩