Build Determinism Discipline

Same input, same output.

What deterministic builds mean

Deterministic builds produce byte-identical artifacts from byte-identical inputs. Independent of machine, time, or parallelism. The property catches supply-chain and reproducibility failures and is increasingly required by SLSA Level 3 and regulated industries.

Common sources of non-determinism

Non-determinism creeps in from predictable places. Timestamps embedded in artifacts, ordering of file globs and parallel outputs, and unpinned dependency versions are the usual culprits.

How to fix non-determinism

Fixes are mechanical. Set the standard env vars, sort lists explicitly, pin dependencies to hashes rather than versions, and treat the toolchain as part of the input.

Validate determinism

Validation is the proof. Build twice on different machines, compare hashes, investigate any drift with diffoscope. CI job catches latent regressions.

When to invest

Investment is selective. Required for external artifacts customers will hash-verify, recommended for production deploys, skip for internal-only tools where reproducibility is not load-bearing.