Safeguard
Developer Tools•

What should you check in a pull request for build reproducibility?

A reviewer checklist for pull requests that touch builds: timestamps, ordering, paths, pins, downloads and caches, with automated checks to back it up.

Safeguard Security Team
4 min read

Check six things in any pull request that touches build, packaging or CI files: new timestamps or dates, unsorted output, embedded paths or usernames, unpinned tools and dependencies, downloads without checksums, and caches that cross trust boundaries. Back each with an automated test, so reviewers do not rely on memory.

Why a checklist

Reproducibility is easy to lose. One new step that writes the build date, or one new unpinned download, and two builds of the same commit stop matching. The Reproducible Builds project distils the causes into a short list of commandments, which makes a good base for review.

The checklist

CheckWhat to look forSource of the rule
Names and placesUsername, hostname or checkout path written into outputDo not record the name of the maker or the place of making
Dates and timesCurrent time embedded anywhereUse SOURCE_DATE_EPOCH instead
OrderDirectory listings, hash maps or sets written out without sortingDo all work in order
RandomnessUUIDs, random numbers or keys generated into outputDo not record random numbers
ParallelismSteps that race and write shared outputDo one thing at a time or ensure races do no harm
Machine specificsOptimisations that depend on the build machine's CPUDo not look at build machine capabilities
EnvironmentTimezone, locale and umask differencesKeep the workspace clean of them or ensure they do no harm
NetworkNew fetches during the buildAllow for offline builds
InputsMissing record of what the build usedTake note of build inputs when publishing binaries

Add two items that come from other Reproducible Builds pages: version strings must come from source, not from the clock or a counter, and short git hashes must have a fixed length. See the git hash trap.

Automate what you can

  1. Rebuild twice in CI. Build in two directories and compare SHA-256. Fail the check on mismatch.
  2. Vary the environment. Run the second build with a different timezone and locale, to catch leaks.
  3. Diff on failure. Attach the diffoscope report to the failed job, so the author can see the cause. See finding why two builds differ.
  4. Lockfile checks. Fail the build if the lockfile is out of date.
  5. Protect the build files. Use code owners on workflow and packaging files, so changes get the right reviewer.
  6. Review caches. Check cache keys and who can write them. See cache-mode in GitHub Actions.

What reviewers should ask

  • Does this change add an input to the build? If so, where is it pinned or recorded?
  • Could this value be different tomorrow, or on another machine?
  • If this step fails, would we know?

A short answer in the pull request description is enough. The point is that someone asked.

Try it yourself

Safeguard's policies and gates can run rules on pull requests before they merge. Click through the demo and look at how a gate blocks a change and explains why.

Click through it at your own pace, or open it full screen.

Quick check

Do I need to review every pull request this way?

Only those touching build, packaging, CI, Dockerfile or dependency files. Path based review rules can route them.

Is a two build comparison in CI too slow?

It doubles build time for that job. Many teams run it on release branches and on changes to build files, not on every commit.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.