What Clean and Incremental Builds Exercise

An incremental build reuses existing results under its rules. A clean build starts from a prepared state without those generated outputs.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Find a hidden prerequisite
  2. Keep a reuse check too
  3. Exercise empty-output and stale-output conditions separately
  4. Compare the results at the consumer boundary

Find a hidden prerequisite

A report can succeed locally because a generated glossary already exists, and fail from a fresh checkout. Test the clean case to prove the glossary is produced by an earlier rule. See declared build dependencies.

Keep a reuse check too

Edit the glossary source and rebuild. If the report stays stale, the clean build alone would not have shown the invalidation problem. Incremental freshness explains that separate guarantee.[1]

Exercise empty-output and stale-output conditions separately

A generated table from an earlier run can make an incomplete rule look adequate. Building in an empty output directory checks whether all needed outputs can be recreated. Rebuilding after changing an input checks whether stale output is invalidated. See incremental freshness.

Clean run: delete only designated scratch outputs, create complete package
Incremental no-change run: reuse eligible work
Incremental changed-input run: rebuild affected steps

Compare the results at the consumer boundary

A successful compile may miss an obsolete file still included in packaging. Compare outputs or their parsed contents between a clean run and an incremental run with the same final inputs. Keep the comparison focused on expected differences.

References

  1. Free Software Foundation, GNU Make Manual ↩